diff --git a/src/balancer/OceanPool.ts b/src/balancer/OceanPool.ts new file mode 100644 index 00000000..3e394a6e --- /dev/null +++ b/src/balancer/OceanPool.ts @@ -0,0 +1,291 @@ +import { BalancerPool } from './balancerlib' + +export class OceanPool extends BalancerPool { + /** Ocean related functions */ + 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 + ) { + super(web3, account, FactoryABI, PoolABI, 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 + } + } */ + + /** + * 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 super.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 super.addToPool(tokens) + await super.setSwapFee(fee) + if (finalize) await super.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 super.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 super.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 super.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 super.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 + * @return {any} + */ + public async addDTLiquidity(amount: string): Promise { + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + await this.approve( + this.dtAddress, + this.poolAddress, + this.web3.utils.toWei(amount) + ) + const result = await this.joinswapExternAmountIn(this.dtAddress, amount, '0') + return result + } + + /** + * Remove Data Token amount from pool liquidity + * @param {String} amount pool Liquidity Amount + * @return {any} + */ + public removeDTLiquidity(amount: string, maximumPoolShares: string): Promise { + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + // TODO Check balance of PoolShares before doing exit + return this.exitswapExternAmountOut(this.dtAddress, amount, maximumPoolShares) + } + + /** + * Add Ocean Token amount to pool liquidity + * @param {String} amount Data Token Amount + * @return {any} + */ + public async addOceanLiquidity(amount: string): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + await this.approve( + this.oceanAddress, + this.poolAddress, + this.web3.utils.toWei(amount) + ) + const result = await this.joinswapExternAmountIn(this.oceanAddress, amount, '0') + return result + } + + /** + * Remove Ocean Token amount from pool liquidity + * @param {String} amount pool Liquidity Amount + * @return {any} + */ + public removeOceanLiquidity(amount: string, maximumPoolShares: string): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + // TODO Check balance of PoolShares before doing exit + return this.exitswapExternAmountOut(this.oceanAddress, amount, maximumPoolShares) + } + + /** + * 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/src/balancer/artifacts/SFactory.json b/src/balancer/artifacts/SFactory.json new file mode 100644 index 00000000..760d20ef --- /dev/null +++ b/src/balancer/artifacts/SFactory.json @@ -0,0 +1,3988 @@ +{ + "contractName": "SFactory", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "MAX_TOTAL_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "BPOW_PRECISION", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "str1", + "type": "string" + }, + { + "name": "str2", + "type": "string" + } + ], + "name": "concatenateStrings", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BALANCE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "INIT_POOL_SUPPLY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_OUT_RATIO", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getColor", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BOUND_TOKENS", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BOUND_TOKENS", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BPOW_BASE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BPOW_BASE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "BONE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "EXIT_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "value", + "type": "uint256" + } + ], + "name": "uintToString", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_IN_RATIO", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "spoolTemplate", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "newSPoolAddress", + "type": "address" + }, + { + "indexed": true, + "name": "spoolTemplateAddress", + "type": "address" + } + ], + "name": "SPoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "spoolAddress", + "type": "address" + }, + { + "indexed": true, + "name": "registeredBy", + "type": "address" + }, + { + "indexed": true, + "name": "registeredAt", + "type": "uint256" + } + ], + "name": "SPoolRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "instance", + "type": "address" + } + ], + "name": "InstanceDeployed", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "controller", + "type": "address" + } + ], + "name": "newSPool", + "outputs": [ + { + "name": "spool", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getSPool", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOTAL_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BPOW_PRECISION\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSPool\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"str1\",\"type\":\"string\"},{\"name\":\"str2\",\"type\":\"string\"}],\"name\":\"concatenateStrings\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BALANCE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INIT_POOL_SUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"newSPool\",\"outputs\":[{\"name\":\"spool\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_OUT_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getColor\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BONE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"EXIT_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"uintToString\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_IN_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"spoolTemplate\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newSPoolAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spoolTemplateAddress\",\"type\":\"address\"}],\"name\":\"SPoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"spoolAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"registeredBy\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"registeredAt\",\"type\":\"uint256\"}],\"name\":\"SPoolRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"instance\",\"type\":\"address\"}],\"name\":\"InstanceDeployed\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"concatenateStrings(string,string)\":{\"details\":\"concatenateStrings concatenates two strings\",\"params\":{\"str1\":\"refers to first string\",\"str2\":\"refers to second string\"},\"return\":\"catenated string value\"},\"uintToString(uint256)\":{\"details\":\"uintToString converts an integer value to a string value\",\"params\":{\"value\":\"refers to integer value\"},\"return\":\"converted string value\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SFactory.sol\":\"SFactory\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BColor.sol\":{\"keccak256\":\"0xb8fce6d6c6e980125a8c0eb5931f047e124c1d40467ef48e50f89a2526d12dbf\",\"urls\":[\"bzzr://406bed48b9e36adc57469e50bd9ecc4930effd7a7fa4e280de84f723a0c98bdd\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BConst.sol\":{\"keccak256\":\"0xa38887070afc6e1f858307f0bc706107cbb4c51fef8c6147d8559b31dbe1e0e7\",\"urls\":[\"bzzr://dd49bb371f311bba1befef8e302cfc155a27f00eb8a0c72567d48f32e34f87d4\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BMath.sol\":{\"keccak256\":\"0x8720737688f58763c866f93670d7bd4ceeb539668f88e887599f2cdc65373da7\",\"urls\":[\"bzzr://0c6d9e3f13fd2b853aeed81d812c3a66f1cea7300cd611d357fd6eab21e593c6\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BNum.sol\":{\"keccak256\":\"0xc4e5c934d6b04c1fad116ea81c2fa65eaa2700e4e48bcc5045c8c96f55e729c8\",\"urls\":[\"bzzr://a3946b7fd2095ca3c7c4bb3daf3078cc48e20b0e107f113e10fb0c6ebaa77e74\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BToken.sol\":{\"keccak256\":\"0xb073099f95167d63a123e545b32ef98ff3648fd9390eba5f38c82b94420dc4dd\",\"urls\":[\"bzzr://728271d35f3155828ae676abb63cf7f432516ba1a4c67f2962d6ea996f6fa586\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SFactory.sol\":{\"keccak256\":\"0xea429952b883941014c9d4fbb4ae13ef93bbf9c2db9842b0c8dc316faf704e81\",\"urls\":[\"bzzr://97d10129935f22b9a50126f1335751ceb92fe3dfe5973e23821221bf3d1c5516\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol\":{\"keccak256\":\"0xee71ef4113f81712ffececfa0e073dda161c56d69ac0a4a734b977a4fc8a0040\",\"urls\":[\"bzzr://a822a75a0efc02b3675e099f8bfb8d84b17d51430e3c5677541d7de0358bdcf7\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Converter.sol\":{\"keccak256\":\"0xe66be94c26885df4f4cce4b4a58861208b4edee463ba87aaf51e492c0605af33\",\"urls\":[\"bzzr://37165616d54d34409a770d71508525e3fc6508131e951aa2a51f43de0a5e7f9d\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Deployer.sol\":{\"keccak256\":\"0x274fa96796fb2b5978a6dbd7fe4314ac0462327ac9fd9e93e41c681d2bc72cc8\",\"urls\":[\"bzzr://808e0586af5a54e6fe1664b684640dab8e4e5be7886fbcb30a59198c5f583a51\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405160208061106c8339810180604052602081101561003057600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f414444524553535f300000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610f38806101346000396000f3fe608060405234801561001057600080fd5b5060043610610154576000357c0100000000000000000000000000000000000000000000000000000000900480639a86139b116100d5578063bc694ea211610099578063bc694ea21461055a578063c36596a614610578578063c6580d1214610596578063e4a28a52146105b4578063e9395679146105d2578063ec0930211461067957610154565b80639a86139b146104c4578063b0e0d136146104e2578063b7b800a414610500578063ba019dab1461051e578063bc063e1a1461053c57610154565b80637a36b3ee1161011c5780637a36b3ee1461021b578063867378c5146103e65780639381cd2b1461040457806393e433b214610422578063992e2a92146104a657610154565b806309a3bbe414610159578063189d00ca14610177578063218b538214610195578063409f84fc146101b357806376c7a3c7146101fd575b600080fd5b610161610697565b6040518082815260200191505060405180910390f35b61017f6106a6565b6040518082815260200191505060405180910390f35b61019d6106c0565b6040518082815260200191505060405180910390f35b6101bb6106cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102056106f5565b6040518082815260200191505060405180910390f35b61036b6004803603604081101561023157600080fd5b810190808035906020019064010000000081111561024e57600080fd5b82018360208201111561026057600080fd5b8035906020019184600183028401116401000000008311171561028257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184600183028401116401000000008311171561031957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061070d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ab578082015181840152602081019050610390565b50505050905090810190601f1680156103d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ee6107d5565b6040518082815260200191505060405180910390f35b61040c6107ef565b6040518082815260200191505060405180910390f35b6104646004803603602081101561043857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ae610c36565b6040518082815260200191505060405180910390f35b6104cc610c4f565b6040518082815260200191505060405180910390f35b6104ea610c77565b6040518082815260200191505060405180910390f35b610508610c7c565b6040518082815260200191505060405180910390f35b610526610c81565b6040518082815260200191505060405180910390f35b610544610c86565b6040518082815260200191505060405180910390f35b610562610c9c565b6040518082815260200191505060405180910390f35b610580610cae565b6040518082815260200191505060405180910390f35b61059e610cba565b6040518082815260200191505060405180910390f35b6105bc610cbf565b6040518082815260200191505060405180910390f35b6105fe600480360360208110156105e857600080fd5b8101908080359060200190929190505050610cce565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561063e578082015181840152602081019050610623565b50505050905090810190601f16801561066b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610681610e1d565b6040518082815260200191505060405180910390f35b6032670de0b6b3a76400000281565b6402540be400670de0b6b3a7640000816106bc57fe5b0481565b670de0b6b3a764000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b620f4240670de0b6b3a76400008161070957fe5b0481565b606082826040516020018083805190602001908083835b602083106107475780518252602082019150602081019050602083039250610724565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083106107985780518252602082019150602081019050602083039250610775565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b64e8d4a51000670de0b6b3a7640000816107eb57fe5b0481565b6064670de0b6b3a76400000281565b600061082a6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e33565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f414444524553535f300000000000000000000000000000000000000081525060200191505060405180910390fd5b600081905060003090506000620f4240670de0b6b3a7640000816108ef57fe5b049050600080905060008090508473ffffffffffffffffffffffffffffffffffffffff1663506de97488868686866040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001831515151581526020018215151515815260200195505050505050602060405180830381600087803b1580156109eb57600080fd5b505af11580156109ff573d6000803e3d6000fd5b505050506040513d6020811015610a1557600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff1663392e53cd6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b8101908080519060200190929190505050610b36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e495449414c495a455f53504f4f4c00000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f75c84bc3fea03d287558c86073810ad6f2c1bd373d9982ac615203d1539aff1360405160405180910390a3433373ffffffffffffffffffffffffffffffffffffffff167f14e7567eaf089d4c31f0ebf88996f9e09fdb0dd445800675a7c81a5dfe8e37e588604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a35050505050919050565b60016003670de0b6b3a764000081610c4a57fe5b040181565b60007f42524f4e5a450000000000000000000000000000000000000000000000000000905090565b600881565b600281565b600181565b600a670de0b6b3a764000081610c9857fe5b0481565b6001670de0b6b3a76400006002020381565b670de0b6b3a764000081565b600081565b6032670de0b6b3a76400000281565b60606000821415610d16576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050610e18565b600082905060005b60008214610d40578080600101915050600a8281610d3857fe5b049150610d1e565b6060816040519080825280601f01601f191660200182016040528015610d755781602001600182028038833980820191505090505b50905060006001830390508593505b60008414610e1057600a8481610d9657fe5b066030017f01000000000000000000000000000000000000000000000000000000000000000282828060019003935081518110610dcf57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8481610e0857fe5b049350610d84565b819450505050505b919050565b6002670de0b6b3a764000081610e2f57fe5b0481565b600080826c010000000000000000000000000290506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f09250507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15091905056fea165627a7a72305820e40cca69c9bd7ead45cb45f922554f414b22a98c5db8c79bb66ebfeb7fd1c1440029", + "deployedBytecode": "0x608060405234801561001057600080fd5b5060043610610154576000357c0100000000000000000000000000000000000000000000000000000000900480639a86139b116100d5578063bc694ea211610099578063bc694ea21461055a578063c36596a614610578578063c6580d1214610596578063e4a28a52146105b4578063e9395679146105d2578063ec0930211461067957610154565b80639a86139b146104c4578063b0e0d136146104e2578063b7b800a414610500578063ba019dab1461051e578063bc063e1a1461053c57610154565b80637a36b3ee1161011c5780637a36b3ee1461021b578063867378c5146103e65780639381cd2b1461040457806393e433b214610422578063992e2a92146104a657610154565b806309a3bbe414610159578063189d00ca14610177578063218b538214610195578063409f84fc146101b357806376c7a3c7146101fd575b600080fd5b610161610697565b6040518082815260200191505060405180910390f35b61017f6106a6565b6040518082815260200191505060405180910390f35b61019d6106c0565b6040518082815260200191505060405180910390f35b6101bb6106cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102056106f5565b6040518082815260200191505060405180910390f35b61036b6004803603604081101561023157600080fd5b810190808035906020019064010000000081111561024e57600080fd5b82018360208201111561026057600080fd5b8035906020019184600183028401116401000000008311171561028257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184600183028401116401000000008311171561031957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061070d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103ab578082015181840152602081019050610390565b50505050905090810190601f1680156103d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ee6107d5565b6040518082815260200191505060405180910390f35b61040c6107ef565b6040518082815260200191505060405180910390f35b6104646004803603602081101561043857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ae610c36565b6040518082815260200191505060405180910390f35b6104cc610c4f565b6040518082815260200191505060405180910390f35b6104ea610c77565b6040518082815260200191505060405180910390f35b610508610c7c565b6040518082815260200191505060405180910390f35b610526610c81565b6040518082815260200191505060405180910390f35b610544610c86565b6040518082815260200191505060405180910390f35b610562610c9c565b6040518082815260200191505060405180910390f35b610580610cae565b6040518082815260200191505060405180910390f35b61059e610cba565b6040518082815260200191505060405180910390f35b6105bc610cbf565b6040518082815260200191505060405180910390f35b6105fe600480360360208110156105e857600080fd5b8101908080359060200190929190505050610cce565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561063e578082015181840152602081019050610623565b50505050905090810190601f16801561066b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610681610e1d565b6040518082815260200191505060405180910390f35b6032670de0b6b3a76400000281565b6402540be400670de0b6b3a7640000816106bc57fe5b0481565b670de0b6b3a764000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b620f4240670de0b6b3a76400008161070957fe5b0481565b606082826040516020018083805190602001908083835b602083106107475780518252602082019150602081019050602083039250610724565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083106107985780518252602082019150602081019050602083039250610775565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b64e8d4a51000670de0b6b3a7640000816107eb57fe5b0481565b6064670de0b6b3a76400000281565b600061082a6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e33565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f414444524553535f300000000000000000000000000000000000000081525060200191505060405180910390fd5b600081905060003090506000620f4240670de0b6b3a7640000816108ef57fe5b049050600080905060008090508473ffffffffffffffffffffffffffffffffffffffff1663506de97488868686866040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001831515151581526020018215151515815260200195505050505050602060405180830381600087803b1580156109eb57600080fd5b505af11580156109ff573d6000803e3d6000fd5b505050506040513d6020811015610a1557600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff1663392e53cd6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b8101908080519060200190929190505050610b36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e495449414c495a455f53504f4f4c00000000000000000000000081525060200191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f75c84bc3fea03d287558c86073810ad6f2c1bd373d9982ac615203d1539aff1360405160405180910390a3433373ffffffffffffffffffffffffffffffffffffffff167f14e7567eaf089d4c31f0ebf88996f9e09fdb0dd445800675a7c81a5dfe8e37e588604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a35050505050919050565b60016003670de0b6b3a764000081610c4a57fe5b040181565b60007f42524f4e5a450000000000000000000000000000000000000000000000000000905090565b600881565b600281565b600181565b600a670de0b6b3a764000081610c9857fe5b0481565b6001670de0b6b3a76400006002020381565b670de0b6b3a764000081565b600081565b6032670de0b6b3a76400000281565b60606000821415610d16576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050610e18565b600082905060005b60008214610d40578080600101915050600a8281610d3857fe5b049150610d1e565b6060816040519080825280601f01601f191660200182016040528015610d755781602001600182028038833980820191505090505b50905060006001830390508593505b60008414610e1057600a8481610d9657fe5b066030017f01000000000000000000000000000000000000000000000000000000000000000282828060019003935081518110610dcf57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8481610e0857fe5b049350610d84565b819450505050505b919050565b6002670de0b6b3a764000081610e2f57fe5b0481565b600080826c010000000000000000000000000290506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f09250507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15091905056fea165627a7a72305820e40cca69c9bd7ead45cb45f922554f414b22a98c5db8c79bb66ebfeb7fd1c1440029", + "sourceMap": "686:1790:7:-;;;1198:166;8:9:-1;5:2;;;30:1;27;20:12;5:2;1198:166:7;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1198:166:7;;;;;;;;;;;;;;;;1297:1;1272:27;;:13;:27;;;;1264:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1344:13;1327:14;;:30;;;;;;;;;;;;;;;;;;1198:166;686:1790;;;;;;", + "deployedSourceMap": "686:1790:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;686:1790:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1146:50:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1438:54;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1039:45;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2356:118:7;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;875:53:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1395:214:12;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1395:214:12;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1395:214:12;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1395:214:12;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1395:214:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1395:214:12;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1395:214:12;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1395:214:12;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1395:214:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1395:214:12;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1395:214:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1202:54:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1263:51;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1535:732:7;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1535:732:7;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1554:59:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;794:101:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;826:42:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;778;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1321:46;;;:::i;:::-;;;;;;;;;;;;;;;;;;;934:50;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1373:59;;;:::i;:::-;;;;;;;;;;;;;;;;;;;724:47;;;:::i;:::-;;;;;;;;;;;;;;;;;;;990:42;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1090:50;;;:::i;:::-;;;;;;;;;;;;;;;;;;;593:589:12;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;593:589:12;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;593:589:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1499:49:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1146:50;1194:2;765:6;1187:9;1146:50;:::o;1438:54::-;1486:6;765;1479:13;;;;;;1438:54;:::o;1039:45::-;765:6;1039:45;:::o;2356:118:7:-;2423:7;2453:14;;;;;;;;;;;2446:21;;2356:118;:::o;875:53:3:-;923:5;765:6;916:12;;;;;;875:53;:::o;1395:214:12:-;1530:13;1590:4;1596;1573:28;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1573:28:12;;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1573:28:12;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1573:28:12;;;1559:43;;1395:214;;;;:::o;1202:54:3:-;1250:6;765;1243:13;;;;;;1202:54;:::o;1263:51::-;1311:3;765:6;1304:10;1263:51;:::o;1535:732:7:-;1606:13;1643:22;1650:14;;;;;;;;;;;1643:6;:22::i;:::-;1635:30;;1700:1;1683:19;;:5;:19;;;;1675:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1739:19;1767:5;1739:34;;1785:15;1811:4;1785:31;;1826:12;923:5:3;765:6;916:12;;;;;;1826:22:7;;1858:15;1876:5;1858:23;;1891:14;1908:5;1891:22;;1923:13;:24;;;1961:10;1986:7;2008;2030:10;2054:9;1923:150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1923:150:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1923:150:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1923:150:7;;;;;;;;;;;;;;;;;2093:13;:27;;;:29;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2093:29:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2093:29:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2093:29:7;;;;;;;;;;;;;;;;2085:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2182:14;;;;;;;;;;;2162:35;;2175:5;2162:35;;;;;;;;;;;;2247:12;2235:10;2212:48;;;2228:5;2212:48;;;;;;;;;;;;;;;;;;;;;;1535:732;;;;;;;;:::o;1554:59:3:-;1608:5;1603:1;765:6;1596:8;;;;;;1595:18;1554:59;:::o;794:101:2:-;845:7;871:17;864:24;;794:101;:::o;826:42:3:-;867:1;826:42;:::o;778:::-;819:1;778:42;:::o;1321:46::-;1362:5;1321:46;:::o;934:50::-;982:2;765:6;975:9;;;;;;934:50;:::o;1373:59::-;1427:5;765:6;1415:1;:8;1414:18;1373:59;:::o;724:47::-;765:6;724:47;:::o;990:42::-;1031:1;990:42;:::o;1090:50::-;1138:2;765:6;1131:9;1090:50;:::o;593:589:12:-;694:13;738:1;729:5;:10;724:52;;;755:10;;;;;;;;;;;;;;;;;;;;;724:52;785:13;801:5;785:21;;816:8;834:80;853:1;841:8;:13;834:80;;870:5;;;;;;;901:2;889:14;;;;;;;;;834:80;;;932:17;962:3;952:14;;;;;;;;;;;;;;;;;;;;;;;;;29:1:-1;21:6;17:14;116:4;104:10;96:6;87:34;147:4;139:6;135:17;125:27;;0:156;952:14:12;;;;932:34;;976:6;991:1;985:3;:7;976:16;;1013:5;1002:16;;1029:118;1048:1;1036:8;:13;1029:118;;1104:2;1093:8;:13;;;;;;1088:2;:18;1077:31;;1065:4;1070:3;;;;;;;1065:9;;;;;;;;;;;:43;;;;;;;;;;;1134:2;1122:14;;;;;;;;;1029:118;;;1170:4;1156:19;;;;;;593:589;;;;:::o;1499:49:3:-;1547:1;765:6;1540:8;;;;;;1499:49;:::o;812:624:13:-;890:16;923:19;953:6;945:15;;923:37;;1077:4;1071:11;1107:66;1100:5;1093:81;1210:11;1203:4;1196:5;1192:16;1185:37;1258:66;1251:4;1244:5;1240:16;1233:92;1365:4;1358:5;1355:1;1348:22;1336:34;;1046:334;1394:35;1419:8;1394:35;;;;;;;;;;;;;;;;;;;;;;812:624;;;;:::o", + "source": "pragma solidity ^0.5.7;\n// Copyright BigchainDB GmbH and Ocean Protocol contributors\n// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)\n// Code is Apache-2.0 and docs are CC-BY-4.0\n\nimport '../utils/Deployer.sol';\nimport '../utils/Converter.sol';\nimport './SPool.sol';\nimport './BConst.sol';\n\n/*\n* @title SFactory contract\n* @author Ocean Protocol (with code from Balancer Labs)\n*\n* @dev Ocean implementation of Balancer SPool Factory\n* SFactory deploys SPool proxy contracts.\n* New SPool proxy contracts are links to the template contract's bytecode. \n* Proxy contract functionality is based on Ocean Protocol custom\n* implementation of ERC1167 standard.\n*/\n\ncontract SFactory is BConst, Deployer, Converter {\n\n address private _spoolTemplate;\n\n event SPoolCreated(\n address indexed newSPoolAddress, \n address indexed spoolTemplateAddress\n );\n \n event SPoolRegistered(\n address spoolAddress,\n address indexed registeredBy,\n uint256 indexed registeredAt\n );\n \n /* @dev Called on contract deployment. Cannot be called with zero address.\n @param _spoolTemplate -- address of a deployed SPool contract. */\n constructor(address spoolTemplate) \n public \n {\n require(spoolTemplate != address(0), 'ERR_ADDRESS_0');\n _spoolTemplate = spoolTemplate;\n }\n\n /* @dev Deploys new SPool proxy contract.\n Template contract address could not be a zero address. \n @return address of a new proxy SPool contract */\n function newSPool(address controller) \n public\n returns (address spool)\n {\n spool = deploy(_spoolTemplate);\n require(spool != address(0), 'ERR_ADDRESS_0');\n \n SPool spoolInstance = SPool(spool);\n\t\n address factory = address(this);\n uint swapFee = MIN_FEE;\n bool publicSwap = false;\n bool finalized = false;\n spoolInstance.initialize(\n controller, \n factory, \n swapFee, \n publicSwap,\n finalized\n );\n\t\n require(spoolInstance.isInitialized(), 'ERR_INITIALIZE_SPOOL');\n emit SPoolCreated(spool, _spoolTemplate);\n emit SPoolRegistered(spool, msg.sender, block.number);\n }\n\n\n /* @dev get the spool template address\n @return the template address */\n function getSPool()\n external\n view\n returns (address)\n {\n return _spoolTemplate;\n }\n}\n", + "sourcePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SFactory.sol", + "ast": { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SFactory.sol", + "exportedSymbols": { + "SFactory": [ + 2061 + ] + }, + "id": 2062, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1930, + "literals": [ + "solidity", + "^", + "0.5", + ".7" + ], + "nodeType": "PragmaDirective", + "src": "0:23:7" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Deployer.sol", + "file": "../utils/Deployer.sol", + "id": 1931, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4933, + "src": "186:31:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Converter.sol", + "file": "../utils/Converter.sol", + "id": 1932, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4905, + "src": "218:32:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol", + "file": "./SPool.sol", + "id": 1933, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4308, + "src": "251:21:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BConst.sol", + "file": "./BConst.sol", + "id": 1934, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 308, + "src": "273:22:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1935, + "name": "BConst", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 307, + "src": "707:6:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BConst_$307", + "typeString": "contract BConst" + } + }, + "id": 1936, + "nodeType": "InheritanceSpecifier", + "src": "707:6:7" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1937, + "name": "Deployer", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4932, + "src": "715:8:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Deployer_$4932", + "typeString": "contract Deployer" + } + }, + "id": 1938, + "nodeType": "InheritanceSpecifier", + "src": "715:8:7" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1939, + "name": "Converter", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4904, + "src": "725:9:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Converter_$4904", + "typeString": "contract Converter" + } + }, + "id": 1940, + "nodeType": "InheritanceSpecifier", + "src": "725:9:7" + } + ], + "contractDependencies": [ + 206, + 219, + 307, + 4904, + 4932 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 2061, + "linearizedBaseContracts": [ + 2061, + 4904, + 4932, + 307, + 219, + 206 + ], + "name": "SFactory", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 1942, + "name": "_spoolTemplate", + "nodeType": "VariableDeclaration", + "scope": 2061, + "src": "742:30:7", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "742:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": null, + "id": 1948, + "name": "SPoolCreated", + "nodeType": "EventDefinition", + "parameters": { + "id": 1947, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1944, + "indexed": true, + "name": "newSPoolAddress", + "nodeType": "VariableDeclaration", + "scope": 1948, + "src": "807:31:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1943, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "807:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1946, + "indexed": true, + "name": "spoolTemplateAddress", + "nodeType": "VariableDeclaration", + "scope": 1948, + "src": "849:36:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1945, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "849:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "797:94:7" + }, + "src": "779:113:7" + }, + { + "anonymous": false, + "documentation": null, + "id": 1956, + "name": "SPoolRegistered", + "nodeType": "EventDefinition", + "parameters": { + "id": 1955, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1950, + "indexed": false, + "name": "spoolAddress", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "933:20:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1949, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "933:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1952, + "indexed": true, + "name": "registeredBy", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "963:28:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1951, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "963:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1954, + "indexed": true, + "name": "registeredAt", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "1001:28:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1953, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1001:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "923:112:7" + }, + "src": "902:134:7" + }, + { + "body": { + "id": 1974, + "nodeType": "Block", + "src": "1254:110:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1962, + "name": "spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1958, + "src": "1272:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1297:1:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1289:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1289:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1272:27:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414444524553535f30", + "id": 1967, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1301:15:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + }, + "value": "ERR_ADDRESS_0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + } + ], + "id": 1961, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1264:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1264:53:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1969, + "nodeType": "ExpressionStatement", + "src": "1264:53:7" + }, + { + "expression": { + "argumentTypes": null, + "id": 1972, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1970, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "1327:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1971, + "name": "spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1958, + "src": "1344:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1327:30:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1973, + "nodeType": "ExpressionStatement", + "src": "1327:30:7" + } + ] + }, + "documentation": null, + "id": 1975, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1959, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1958, + "name": "spoolTemplate", + "nodeType": "VariableDeclaration", + "scope": 1975, + "src": "1210:21:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1957, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1210:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1209:23:7" + }, + "returnParameters": { + "id": 1960, + "nodeType": "ParameterList", + "parameters": [], + "src": "1254:0:7" + }, + "scope": 2061, + "src": "1198:166:7", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2051, + "nodeType": "Block", + "src": "1625:642:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1982, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1635:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1984, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "1650:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1983, + "name": "deploy", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4931, + "src": "1643:6:7", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$", + "typeString": "function (address) returns (address)" + } + }, + "id": 1985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1643:22:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1635:30:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1987, + "nodeType": "ExpressionStatement", + "src": "1635:30:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1993, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1989, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1683:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1991, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1700:1:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1990, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1692:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1992, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1692:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1683:19:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414444524553535f30", + "id": 1994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1704:15:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + }, + "value": "ERR_ADDRESS_0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + } + ], + "id": 1988, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1675:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1675:45:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1996, + "nodeType": "ExpressionStatement", + "src": "1675:45:7" + }, + { + "assignments": [ + 1998 + ], + "declarations": [ + { + "constant": false, + "id": 1998, + "name": "spoolInstance", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1739:19:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + }, + "typeName": { + "contractScope": null, + "id": 1997, + "name": "SPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4307, + "src": "1739:5:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2002, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2000, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1767:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1999, + "name": "SPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4307, + "src": "1761:5:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SPool_$4307_$", + "typeString": "type(contract SPool)" + } + }, + "id": 2001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1761:12:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1739:34:7" + }, + { + "assignments": [ + 2004 + ], + "declarations": [ + { + "constant": false, + "id": 2004, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1785:15:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2003, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1785:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2008, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2006, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5677, + "src": "1811:4:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SFactory_$2061", + "typeString": "contract SFactory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SFactory_$2061", + "typeString": "contract SFactory" + } + ], + "id": 2005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1803:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1803:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1785:31:7" + }, + { + "assignments": [ + 2010 + ], + "declarations": [ + { + "constant": false, + "id": 2010, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1826:12:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2009, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1826:4:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2012, + "initialValue": { + "argumentTypes": null, + "id": 2011, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "1841:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1826:22:7" + }, + { + "assignments": [ + 2014 + ], + "declarations": [ + { + "constant": false, + "id": 2014, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1858:15:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2013, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1858:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2016, + "initialValue": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2015, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1876:5:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1858:23:7" + }, + { + "assignments": [ + 2018 + ], + "declarations": [ + { + "constant": false, + "id": 2018, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1891:14:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2017, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1891:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2020, + "initialValue": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2019, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1908:5:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1891:22:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2024, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1977, + "src": "1961:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2025, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2004, + "src": "1986:7:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2026, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2010, + "src": "2008:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2027, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2014, + "src": "2030:10:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 2028, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2018, + "src": "2054:9:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "argumentTypes": null, + "id": 2021, + "name": "spoolInstance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1998, + "src": "1923:13:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "id": 2023, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "initialize", + "nodeType": "MemberAccess", + "referencedDeclaration": 2239, + "src": "1923:24:7", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) external returns (bool)" + } + }, + "id": 2029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1923:150:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2030, + "nodeType": "ExpressionStatement", + "src": "1923:150:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2032, + "name": "spoolInstance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1998, + "src": "2093:13:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "id": 2033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isInitialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 2199, + "src": "2093:27:7", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$", + "typeString": "function () view external returns (bool)" + } + }, + "id": 2034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2093:29:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f494e495449414c495a455f53504f4f4c", + "id": 2035, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2124:22:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b1ed8a9d39103e6736c29515ab2dad1ac45525b0089126af9d27483683df7511", + "typeString": "literal_string \"ERR_INITIALIZE_SPOOL\"" + }, + "value": "ERR_INITIALIZE_SPOOL" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b1ed8a9d39103e6736c29515ab2dad1ac45525b0089126af9d27483683df7511", + "typeString": "literal_string \"ERR_INITIALIZE_SPOOL\"" + } + ], + "id": 2031, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "2085:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2085:62:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2037, + "nodeType": "ExpressionStatement", + "src": "2085:62:7" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2039, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "2175:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2040, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "2182:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2038, + "name": "SPoolCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1948, + "src": "2162:12:7", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 2041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2162:35:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2042, + "nodeType": "EmitStatement", + "src": "2157:40:7" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2044, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "2228:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2045, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "2235:3:7", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2046, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2235:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2047, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5625, + "src": "2247:5:7", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 2048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2247:12:7", + "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": 2043, + "name": "SPoolRegistered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1956, + "src": "2212:15:7", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2212:48:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2050, + "nodeType": "EmitStatement", + "src": "2207:53:7" + } + ] + }, + "documentation": null, + "id": 2052, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "newSPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1978, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1977, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2052, + "src": "1553:18:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1976, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1553:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1552:20:7" + }, + "returnParameters": { + "id": 1981, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1980, + "name": "spool", + "nodeType": "VariableDeclaration", + "scope": 2052, + "src": "1606:13:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1979, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1606:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1605:15:7" + }, + "scope": 2061, + "src": "1535:732:7", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2059, + "nodeType": "Block", + "src": "2436:38:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2057, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "2453:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 2056, + "id": 2058, + "nodeType": "Return", + "src": "2446:21:7" + } + ] + }, + "documentation": null, + "id": 2060, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2053, + "nodeType": "ParameterList", + "parameters": [], + "src": "2373:2:7" + }, + "returnParameters": { + "id": 2056, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2055, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2060, + "src": "2423:7:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2054, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2423:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2422:9:7" + }, + "scope": 2061, + "src": "2356:118:7", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 2062, + "src": "686:1790:7" + } + ], + "src": "0:2477:7" + }, + "legacyAST": { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SFactory.sol", + "exportedSymbols": { + "SFactory": [ + 2061 + ] + }, + "id": 2062, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1930, + "literals": [ + "solidity", + "^", + "0.5", + ".7" + ], + "nodeType": "PragmaDirective", + "src": "0:23:7" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Deployer.sol", + "file": "../utils/Deployer.sol", + "id": 1931, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4933, + "src": "186:31:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/utils/Converter.sol", + "file": "../utils/Converter.sol", + "id": 1932, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4905, + "src": "218:32:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol", + "file": "./SPool.sol", + "id": 1933, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 4308, + "src": "251:21:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BConst.sol", + "file": "./BConst.sol", + "id": 1934, + "nodeType": "ImportDirective", + "scope": 2062, + "sourceUnit": 308, + "src": "273:22:7", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1935, + "name": "BConst", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 307, + "src": "707:6:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BConst_$307", + "typeString": "contract BConst" + } + }, + "id": 1936, + "nodeType": "InheritanceSpecifier", + "src": "707:6:7" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1937, + "name": "Deployer", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4932, + "src": "715:8:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Deployer_$4932", + "typeString": "contract Deployer" + } + }, + "id": 1938, + "nodeType": "InheritanceSpecifier", + "src": "715:8:7" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1939, + "name": "Converter", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4904, + "src": "725:9:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Converter_$4904", + "typeString": "contract Converter" + } + }, + "id": 1940, + "nodeType": "InheritanceSpecifier", + "src": "725:9:7" + } + ], + "contractDependencies": [ + 206, + 219, + 307, + 4904, + 4932 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 2061, + "linearizedBaseContracts": [ + 2061, + 4904, + 4932, + 307, + 219, + 206 + ], + "name": "SFactory", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 1942, + "name": "_spoolTemplate", + "nodeType": "VariableDeclaration", + "scope": 2061, + "src": "742:30:7", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1941, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "742:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "anonymous": false, + "documentation": null, + "id": 1948, + "name": "SPoolCreated", + "nodeType": "EventDefinition", + "parameters": { + "id": 1947, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1944, + "indexed": true, + "name": "newSPoolAddress", + "nodeType": "VariableDeclaration", + "scope": 1948, + "src": "807:31:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1943, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "807:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1946, + "indexed": true, + "name": "spoolTemplateAddress", + "nodeType": "VariableDeclaration", + "scope": 1948, + "src": "849:36:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1945, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "849:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "797:94:7" + }, + "src": "779:113:7" + }, + { + "anonymous": false, + "documentation": null, + "id": 1956, + "name": "SPoolRegistered", + "nodeType": "EventDefinition", + "parameters": { + "id": 1955, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1950, + "indexed": false, + "name": "spoolAddress", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "933:20:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1949, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "933:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1952, + "indexed": true, + "name": "registeredBy", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "963:28:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1951, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "963:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1954, + "indexed": true, + "name": "registeredAt", + "nodeType": "VariableDeclaration", + "scope": 1956, + "src": "1001:28:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1953, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1001:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "923:112:7" + }, + "src": "902:134:7" + }, + { + "body": { + "id": 1974, + "nodeType": "Block", + "src": "1254:110:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1966, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1962, + "name": "spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1958, + "src": "1272:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1297:1:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1289:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1289:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1272:27:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414444524553535f30", + "id": 1967, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1301:15:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + }, + "value": "ERR_ADDRESS_0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + } + ], + "id": 1961, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1264:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1264:53:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1969, + "nodeType": "ExpressionStatement", + "src": "1264:53:7" + }, + { + "expression": { + "argumentTypes": null, + "id": 1972, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1970, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "1327:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1971, + "name": "spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1958, + "src": "1344:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1327:30:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1973, + "nodeType": "ExpressionStatement", + "src": "1327:30:7" + } + ] + }, + "documentation": null, + "id": 1975, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1959, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1958, + "name": "spoolTemplate", + "nodeType": "VariableDeclaration", + "scope": 1975, + "src": "1210:21:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1957, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1210:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1209:23:7" + }, + "returnParameters": { + "id": 1960, + "nodeType": "ParameterList", + "parameters": [], + "src": "1254:0:7" + }, + "scope": 2061, + "src": "1198:166:7", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2051, + "nodeType": "Block", + "src": "1625:642:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1986, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1982, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1635:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1984, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "1650:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1983, + "name": "deploy", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4931, + "src": "1643:6:7", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$", + "typeString": "function (address) returns (address)" + } + }, + "id": 1985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1643:22:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1635:30:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1987, + "nodeType": "ExpressionStatement", + "src": "1635:30:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1993, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1989, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1683:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1991, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1700:1:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1990, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1692:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1992, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1692:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1683:19:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414444524553535f30", + "id": 1994, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1704:15:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + }, + "value": "ERR_ADDRESS_0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e6c768aaee254d4b4d102b54a4d209534ad6cb78ee0bff5b81df6f32a7a2d556", + "typeString": "literal_string \"ERR_ADDRESS_0\"" + } + ], + "id": 1988, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1675:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1675:45:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1996, + "nodeType": "ExpressionStatement", + "src": "1675:45:7" + }, + { + "assignments": [ + 1998 + ], + "declarations": [ + { + "constant": false, + "id": 1998, + "name": "spoolInstance", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1739:19:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + }, + "typeName": { + "contractScope": null, + "id": 1997, + "name": "SPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4307, + "src": "1739:5:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2002, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2000, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "1767:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1999, + "name": "SPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4307, + "src": "1761:5:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SPool_$4307_$", + "typeString": "type(contract SPool)" + } + }, + "id": 2001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1761:12:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1739:34:7" + }, + { + "assignments": [ + 2004 + ], + "declarations": [ + { + "constant": false, + "id": 2004, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1785:15:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2003, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1785:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2008, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2006, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5677, + "src": "1811:4:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SFactory_$2061", + "typeString": "contract SFactory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SFactory_$2061", + "typeString": "contract SFactory" + } + ], + "id": 2005, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1803:7:7", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1803:13:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1785:31:7" + }, + { + "assignments": [ + 2010 + ], + "declarations": [ + { + "constant": false, + "id": 2010, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1826:12:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2009, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1826:4:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2012, + "initialValue": { + "argumentTypes": null, + "id": 2011, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "1841:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1826:22:7" + }, + { + "assignments": [ + 2014 + ], + "declarations": [ + { + "constant": false, + "id": 2014, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1858:15:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2013, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1858:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2016, + "initialValue": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2015, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1876:5:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1858:23:7" + }, + { + "assignments": [ + 2018 + ], + "declarations": [ + { + "constant": false, + "id": 2018, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2051, + "src": "1891:14:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2017, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1891:4:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2020, + "initialValue": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2019, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1908:5:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1891:22:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2024, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1977, + "src": "1961:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2025, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2004, + "src": "1986:7:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2026, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2010, + "src": "2008:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2027, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2014, + "src": "2030:10:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 2028, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2018, + "src": "2054:9:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "expression": { + "argumentTypes": null, + "id": 2021, + "name": "spoolInstance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1998, + "src": "1923:13:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "id": 2023, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "initialize", + "nodeType": "MemberAccess", + "referencedDeclaration": 2239, + "src": "1923:24:7", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) external returns (bool)" + } + }, + "id": 2029, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1923:150:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2030, + "nodeType": "ExpressionStatement", + "src": "1923:150:7" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2032, + "name": "spoolInstance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1998, + "src": "2093:13:7", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + }, + "id": 2033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isInitialized", + "nodeType": "MemberAccess", + "referencedDeclaration": 2199, + "src": "2093:27:7", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$", + "typeString": "function () view external returns (bool)" + } + }, + "id": 2034, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2093:29:7", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f494e495449414c495a455f53504f4f4c", + "id": 2035, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2124:22:7", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b1ed8a9d39103e6736c29515ab2dad1ac45525b0089126af9d27483683df7511", + "typeString": "literal_string \"ERR_INITIALIZE_SPOOL\"" + }, + "value": "ERR_INITIALIZE_SPOOL" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b1ed8a9d39103e6736c29515ab2dad1ac45525b0089126af9d27483683df7511", + "typeString": "literal_string \"ERR_INITIALIZE_SPOOL\"" + } + ], + "id": 2031, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "2085:7:7", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2085:62:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2037, + "nodeType": "ExpressionStatement", + "src": "2085:62:7" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2039, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "2175:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2040, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "2182:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2038, + "name": "SPoolCreated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1948, + "src": "2162:12:7", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 2041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2162:35:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2042, + "nodeType": "EmitStatement", + "src": "2157:40:7" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2044, + "name": "spool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1980, + "src": "2228:5:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2045, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "2235:3:7", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2046, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2235:10:7", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2047, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5625, + "src": "2247:5:7", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 2048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "number", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2247:12:7", + "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": 2043, + "name": "SPoolRegistered", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1956, + "src": "2212:15:7", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2212:48:7", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2050, + "nodeType": "EmitStatement", + "src": "2207:53:7" + } + ] + }, + "documentation": null, + "id": 2052, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "newSPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1978, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1977, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2052, + "src": "1553:18:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1976, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1553:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1552:20:7" + }, + "returnParameters": { + "id": 1981, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1980, + "name": "spool", + "nodeType": "VariableDeclaration", + "scope": 2052, + "src": "1606:13:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1979, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1606:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1605:15:7" + }, + "scope": 2061, + "src": "1535:732:7", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2059, + "nodeType": "Block", + "src": "2436:38:7", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2057, + "name": "_spoolTemplate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1942, + "src": "2453:14:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 2056, + "id": 2058, + "nodeType": "Return", + "src": "2446:21:7" + } + ] + }, + "documentation": null, + "id": 2060, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getSPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2053, + "nodeType": "ParameterList", + "parameters": [], + "src": "2373:2:7" + }, + "returnParameters": { + "id": 2056, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2055, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2060, + "src": "2423:7:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2054, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2423:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2422:9:7" + }, + "scope": 2061, + "src": "2356:118:7", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 2062, + "src": "686:1790:7" + } + ], + "src": "0:2477:7" + }, + "compiler": { + "name": "solc", + "version": "0.5.7+commit.6da8b019.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.2.0", + "updatedAt": "2020-07-01T18:39:45.208Z", + "devdoc": { + "methods": { + "concatenateStrings(string,string)": { + "details": "concatenateStrings concatenates two strings", + "params": { + "str1": "refers to first string", + "str2": "refers to second string" + }, + "return": "catenated string value" + }, + "uintToString(uint256)": { + "details": "uintToString converts an integer value to a string value", + "params": { + "value": "refers to integer value" + }, + "return": "converted string value" + } + } + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/balancer/artifacts/SPool.json b/src/balancer/artifacts/SPool.json new file mode 100644 index 00000000..4739c056 --- /dev/null +++ b/src/balancer/artifacts/SPool.json @@ -0,0 +1,63563 @@ +{ + "contractName": "SPool", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "amt", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_TOTAL_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "BPOW_PRECISION", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "amt", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "name": "poolSupply", + "type": "uint256" + }, + { + "name": "totalWeight", + "type": "uint256" + }, + { + "name": "poolAmountOut", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSingleInGivenPoolOut", + "outputs": [ + { + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "amt", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "whom", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "name": "poolSupply", + "type": "uint256" + }, + { + "name": "totalWeight", + "type": "uint256" + }, + { + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcPoolInGivenSingleOut", + "outputs": [ + { + "name": "poolAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "name": "poolSupply", + "type": "uint256" + }, + { + "name": "totalWeight", + "type": "uint256" + }, + { + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcPoolOutGivenSingleIn", + "outputs": [ + { + "name": "poolAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BALANCE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "name": "poolSupply", + "type": "uint256" + }, + { + "name": "totalWeight", + "type": "uint256" + }, + { + "name": "poolAmountIn", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSingleOutGivenPoolIn", + "outputs": [ + { + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "INIT_POOL_SUPPLY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_OUT_RATIO", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getColor", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSpotPrice", + "outputs": [ + { + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "amt", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BOUND_TOKENS", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BOUND_TOKENS", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BPOW_BASE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcOutGivenIn", + "outputs": [ + { + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BPOW_BASE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "BONE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "EXIT_FEE", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "amt", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_WEIGHT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_IN_RATIO", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcInGivenOut", + "outputs": [ + { + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "name": "tokenIn", + "type": "address" + }, + { + "indexed": true, + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "indexed": false, + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "name": "LOG_SWAP", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "name": "LOG_JOIN", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "name": "LOG_EXIT", + "type": "event" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "LOG_CALL", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "amt", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "amt", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "controller", + "type": "address" + }, + { + "name": "factory", + "type": "address" + }, + { + "name": "swapFee", + "type": "uint256" + }, + { + "name": "publicSwap", + "type": "bool" + }, + { + "name": "finalized", + "type": "bool" + } + ], + "name": "initialize", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isPublicSwap", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isFinalized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "t", + "type": "address" + } + ], + "name": "isBound", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNumTokens", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCurrentTokens", + "outputs": [ + { + "name": "tokens", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFinalTokens", + "outputs": [ + { + "name": "tokens", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "getDenormalizedWeight", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalDenormalizedWeight", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "getNormalizedWeight", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getSwapFee", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getController", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "swapFee", + "type": "uint256" + } + ], + "name": "setSwapFee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "manager", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "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": [ + { + "name": "token", + "type": "address" + }, + { + "name": "balance", + "type": "uint256" + }, + { + "name": "denorm", + "type": "uint256" + } + ], + "name": "bind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "token", + "type": "address" + }, + { + "name": "balance", + "type": "uint256" + }, + { + "name": "denorm", + "type": "uint256" + } + ], + "name": "rebind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "unbind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "gulp", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "tokenOut", + "type": "address" + } + ], + "name": "getSpotPrice", + "outputs": [ + { + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "tokenOut", + "type": "address" + } + ], + "name": "getSpotPriceSansFee", + "outputs": [ + { + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "poolAmountOut", + "type": "uint256" + }, + { + "name": "maxAmountsIn", + "type": "uint256[]" + } + ], + "name": "joinPool", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "poolAmountIn", + "type": "uint256" + }, + { + "name": "minAmountsOut", + "type": "uint256[]" + } + ], + "name": "exitPool", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "name": "tokenOut", + "type": "address" + }, + { + "name": "minAmountOut", + "type": "uint256" + }, + { + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "swapExactAmountIn", + "outputs": [ + { + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "name": "spotPriceAfter", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "maxAmountIn", + "type": "uint256" + }, + { + "name": "tokenOut", + "type": "address" + }, + { + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "swapExactAmountOut", + "outputs": [ + { + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "name": "spotPriceAfter", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "name": "minPoolAmountOut", + "type": "uint256" + } + ], + "name": "joinswapExternAmountIn", + "outputs": [ + { + "name": "poolAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenIn", + "type": "address" + }, + { + "name": "poolAmountOut", + "type": "uint256" + }, + { + "name": "maxAmountIn", + "type": "uint256" + } + ], + "name": "joinswapPoolAmountOut", + "outputs": [ + { + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenOut", + "type": "address" + }, + { + "name": "poolAmountIn", + "type": "uint256" + }, + { + "name": "minAmountOut", + "type": "uint256" + } + ], + "name": "exitswapPoolAmountIn", + "outputs": [ + { + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenOut", + "type": "address" + }, + { + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "name": "maxPoolAmountIn", + "type": "uint256" + } + ], + "name": "exitswapExternAmountOut", + "outputs": [ + { + "name": "poolAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"tokenOut\",\"type\":\"address\"},{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"name\":\"maxPoolAmountIn\",\"type\":\"uint256\"}],\"name\":\"exitswapExternAmountOut\",\"outputs\":[{\"name\":\"poolAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOTAL_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"getSpotPriceSansFee\",\"outputs\":[{\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"getSpotPrice\",\"outputs\":[{\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BPOW_PRECISION\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"src\",\"type\":\"address\"},{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"t\",\"type\":\"address\"}],\"name\":\"isBound\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getController\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"setSwapFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"balance\",\"type\":\"uint256\"},{\"name\":\"denorm\",\"type\":\"uint256\"}],\"name\":\"rebind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenOut\",\"type\":\"address\"},{\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"name\":\"minAmountOut\",\"type\":\"uint256\"}],\"name\":\"exitswapPoolAmountIn\",\"outputs\":[{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"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\":[{\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"name\":\"maxAmountsIn\",\"type\":\"uint256[]\"}],\"name\":\"joinPool\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"controller\",\"type\":\"address\"},{\"name\":\"factory\",\"type\":\"address\"},{\"name\":\"swapFee\",\"type\":\"uint256\"},{\"name\":\"publicSwap\",\"type\":\"bool\"},{\"name\":\"finalized\",\"type\":\"bool\"}],\"name\":\"initialize\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSingleInGivenPoolOut\",\"outputs\":[{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"name\":\"minPoolAmountOut\",\"type\":\"uint256\"}],\"name\":\"joinswapExternAmountIn\",\"outputs\":[{\"name\":\"poolAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"name\":\"maxAmountIn\",\"type\":\"uint256\"}],\"name\":\"joinswapPoolAmountOut\",\"outputs\":[{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"whom\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"maxAmountIn\",\"type\":\"uint256\"},{\"name\":\"tokenOut\",\"type\":\"address\"},{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"name\":\"maxPrice\",\"type\":\"uint256\"}],\"name\":\"swapExactAmountOut\",\"outputs\":[{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"name\":\"spotPriceAfter\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenIn\",\"type\":\"address\"},{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"name\":\"tokenOut\",\"type\":\"address\"},{\"name\":\"minAmountOut\",\"type\":\"uint256\"},{\"name\":\"maxPrice\",\"type\":\"uint256\"}],\"name\":\"swapExactAmountIn\",\"outputs\":[{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"name\":\"spotPriceAfter\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcPoolInGivenSingleOut\",\"outputs\":[{\"name\":\"poolAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcPoolOutGivenSingleIn\",\"outputs\":[{\"name\":\"poolAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BALANCE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSingleOutGivenPoolIn\",\"outputs\":[{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"gulp\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isFinalized\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"manager\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTotalDenormalizedWeight\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INIT_POOL_SUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getDenormalizedWeight\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_OUT_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getColor\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSpotPrice\",\"outputs\":[{\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"name\":\"minAmountsOut\",\"type\":\"uint256[]\"}],\"name\":\"exitPool\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcOutGivenIn\",\"outputs\":[{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getFinalTokens\",\"outputs\":[{\"name\":\"tokens\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BONE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"EXIT_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentTokens\",\"outputs\":[{\"name\":\"tokens\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"unbind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSwapFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"src\",\"type\":\"address\"},{\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"balance\",\"type\":\"uint256\"},{\"name\":\"denorm\",\"type\":\"uint256\"}],\"name\":\"bind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_IN_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getNormalizedWeight\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcInGivenOut\",\"outputs\":[{\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isPublicSwap\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"tokenOut\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"name\":\"LOG_SWAP\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"name\":\"LOG_JOIN\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"tokenOut\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"name\":\"LOG_EXIT\",\"type\":\"event\"},{\"anonymous\":true,\"inputs\":[{\"indexed\":true,\"name\":\"sig\",\"type\":\"bytes4\"},{\"indexed\":true,\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"LOG_CALL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Used by the (Ocean version) SFactory contract as a bytecode reference to deploy new SPools. * This contract is is nearly identical to the BPool.sol contract at [1] The only difference is the \\\"Proxy contract functionality\\\" section given below. We'd inherit from BPool if we could, for simplicity. But we can't, because the proxy section needs to access private variables declared in BPool, and Solidity disallows this. Therefore the best we can do for now is clearly demarcate the proxy section. * [1] https://github.com/balancer-labs/balancer-core/contracts/.\",\"methods\":{},\"title\":\"SPool \"},\"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\":{\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol\":\"SPool\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BColor.sol\":{\"keccak256\":\"0xb8fce6d6c6e980125a8c0eb5931f047e124c1d40467ef48e50f89a2526d12dbf\",\"urls\":[\"bzzr://406bed48b9e36adc57469e50bd9ecc4930effd7a7fa4e280de84f723a0c98bdd\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BConst.sol\":{\"keccak256\":\"0xa38887070afc6e1f858307f0bc706107cbb4c51fef8c6147d8559b31dbe1e0e7\",\"urls\":[\"bzzr://dd49bb371f311bba1befef8e302cfc155a27f00eb8a0c72567d48f32e34f87d4\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BMath.sol\":{\"keccak256\":\"0x8720737688f58763c866f93670d7bd4ceeb539668f88e887599f2cdc65373da7\",\"urls\":[\"bzzr://0c6d9e3f13fd2b853aeed81d812c3a66f1cea7300cd611d357fd6eab21e593c6\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BNum.sol\":{\"keccak256\":\"0xc4e5c934d6b04c1fad116ea81c2fa65eaa2700e4e48bcc5045c8c96f55e729c8\",\"urls\":[\"bzzr://a3946b7fd2095ca3c7c4bb3daf3078cc48e20b0e107f113e10fb0c6ebaa77e74\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BToken.sol\":{\"keccak256\":\"0xb073099f95167d63a123e545b32ef98ff3648fd9390eba5f38c82b94420dc4dd\",\"urls\":[\"bzzr://728271d35f3155828ae676abb63cf7f432516ba1a4c67f2962d6ea996f6fa586\"]},\"/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol\":{\"keccak256\":\"0xee71ef4113f81712ffececfa0e073dda161c56d69ac0a4a734b977a4fc8a0040\",\"urls\":[\"bzzr://a822a75a0efc02b3675e099f8bfb8d84b17d51430e3c5677541d7de0358bdcf7\"]}},\"version\":1}", + "bytecode": "0x60806040526040518060400160405280601381526020017f42616c616e63657220506f6f6c20546f6b656e00000000000000000000000000815250600390805190602001906200005192919062000215565b506040518060400160405280600381526020017f4250540000000000000000000000000000000000000000000000000000000000815250600490805190602001906200009f92919062000215565b506012600560006101000a81548160ff021916908360ff1602179055506000600c60006101000a81548160ff021916908315150217905550348015620000e457600080fd5b50620001193333620f4240670de0b6b3a7640000816200010057fe5b0460008062000120640100000000026401000000009004565b50620002c4565b600085600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600560026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360078190555082600660146101000a81548160ff02191690831515021790555081600860006101000a81548160ff0219169083151502179055506001600c60006101000a81548160ff021916908315150217905550600c60009054906101000a900460ff16905095945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200025857805160ff191683800117855562000289565b8280016001018555821562000289579182015b82811115620002885782518255916020019190600101906200026b565b5b5090506200029891906200029c565b5090565b620002c191905b80821115620002bd576000816000905550600101620002a3565b5090565b90565b619bde80620002d46000396000f3fe608060405234801561001057600080fd5b506004361061040e576000357c0100000000000000000000000000000000000000000000000000000000900480638c28cbe811610232578063bc694ea211610142578063d73dd623116100d5578063ec093021116100a4578063ec09302114611693578063f1b8a9b7146116b1578063f8b2cb4f14611709578063f8d6aed414611761578063fde924f7146117d55761040e565b8063d73dd6231461153f578063dd62ed3e146115a5578063e4a28a521461161d578063e4e1e5381461163b5761040e565b8063cc77828d11610111578063cc77828d14611460578063cd2ed8fb146114bf578063cf5e7bd3146114dd578063d4cadf68146115215761040e565b8063bc694ea2146113a7578063be3bbd2e146113c5578063c36596a614611424578063c6580d12146114425761040e565b80639a86139b116101c5578063b0e0d13611610194578063b0e0d136146112bb578063b7b800a4146112d9578063ba019dab146112f7578063ba9530a614611315578063bc063e1a146113895761040e565b80639a86139b1461114a578063a221ee4914611168578063a9059cbb146111d2578063b02f0b73146112385761040e565b80639381cd2b116102015780639381cd2b14611033578063948d8ce61461105157806395d89b41146110a9578063992e2a921461112c5761040e565b80638c28cbe814610f6b5780638d4e408314610faf57806392eefe9b14610fd1578063936c3477146110155761040e565b806346ab38f11161032d5780636d06dfa0116102c05780638201aa3f1161028f5780638201aa3f14610d5457806382f652ad14610df15780638656b65314610e65578063867378c514610ed95780638929801214610ef75761040e565b80636d06dfa014610bd557806370a0823114610c4157806376c7a3c714610c995780637c5e9ea414610cb75761040e565b8063506de974116102fc578063506de974146109f15780635c1bbaf714610a8f5780635db3427714610b035780636618846314610b6f5761040e565b806346ab38f1146108c857806349b59552146109345780634bb278f3146109645780634f69c0d41461096e5761040e565b8063218b5382116103a5578063313ce56711610374578063313ce567146107fc57806334e1990714610820578063392e53cd1461084e5780633fdddaa2146108705761040e565b8063218b5382146106b257806323b872dd146106d05780632f37b624146107565780633018205f146107b25761040e565b80631446a7ff116103e15780631446a7ff1461058657806315e84af9146105fe57806318160ddd14610676578063189d00ca146106945761040e565b806302c967481461041357806306fdde031461047f578063095ea7b31461050257806309a3bbe414610568575b600080fd5b6104696004803603606081101561042957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506117f7565b6040518082815260200191505060405180910390f35b610487611da1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c75780820151818401526020810190506104ac565b50505050905090810190601f1680156104f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e43565b604051808215151515815260200191505060405180910390f35b610570611f35565b6040518082815260200191505060405180910390f35b6105e86004803603604081101561059c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f44565b6040518082815260200191505060405180910390f35b6106606004803603604081101561061457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121fb565b6040518082815260200191505060405180910390f35b61067e6124b3565b6040518082815260200191505060405180910390f35b61069c6124bd565b6040518082815260200191505060405180910390f35b6106ba6124d7565b6040518082815260200191505060405180910390f35b61073c600480360360608110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506124e3565b604051808215151515815260200191505060405180910390f35b6107986004803603602081101561076c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128e8565b604051808215151515815260200191505060405180910390f35b6107ba612941565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108046129ee565b604051808260ff1660ff16815260200191505060405180910390f35b61084c6004803603602081101561083657600080fd5b8101908080359060200190929190505050612a05565b005b610856612dbe565b604051808215151515815260200191505060405180910390f35b6108c66004803603606081101561088657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612dd5565b005b61091e600480360360608110156108de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061353d565b6040518082815260200191505060405180910390f35b6109626004803603602081101561094a57600080fd5b81019080803515159060200190929190505050613a70565b005b61096c613d2a565b005b6109ef6004803603604081101561098457600080fd5b8101908080359060200190929190803590602001906401000000008111156109ab57600080fd5b8201836020820111156109bd57600080fd5b803590602001918460208302840111640100000000831117156109df57600080fd5b90919293919293905050506140a4565b005b610a75600480360360a0811015610a0757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506145de565b604051808215151515815260200191505060405180910390f35b610aed600480360360c0811015610aa557600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061467b565b6040518082815260200191505060405180910390f35b610b5960048036036060811015610b1957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614737565b6040518082815260200191505060405180910390f35b610bbb60048036036040811015610b8557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614c22565b604051808215151515815260200191505060405180910390f35b610c2b60048036036060811015610beb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614eaa565b6040518082815260200191505060405180910390f35b610c8360048036036020811015610c5757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061540c565b6040518082815260200191505060405180910390f35b610ca1615454565b6040518082815260200191505060405180910390f35b610d37600480360360a0811015610ccd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061546c565b604051808381526020018281526020019250505060405180910390f35b610dd4600480360360a0811015610d6a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050615c80565b604051808381526020018281526020019250505060405180910390f35b610e4f600480360360c0811015610e0757600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050616491565b6040518082815260200191505060405180910390f35b610ec3600480360360c0811015610e7b57600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061655d565b6040518082815260200191505060405180910390f35b610ee1616602565b6040518082815260200191505060405180910390f35b610f55600480360360c0811015610f0d57600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061661c565b6040518082815260200191505060405180910390f35b610fad60048036036020811015610f8157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506166f3565b005b610fb7616a29565b604051808215151515815260200191505060405180910390f35b61101360048036036020811015610fe757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050616a40565b005b61101d616c9e565b6040518082815260200191505060405180910390f35b61103b616d2b565b6040518082815260200191505060405180910390f35b6110936004803603602081101561106757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050616d3a565b6040518082815260200191505060405180910390f35b6110b1616ecb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110f15780820151818401526020810190506110d6565b50505050905090810190601f16801561111e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b611134616f6d565b6040518082815260200191505060405180910390f35b611152616f86565b6040518082815260200191505060405180910390f35b6111bc600480360360a081101561117e57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050616fae565b6040518082815260200191505060405180910390f35b61121e600480360360408110156111e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061701c565b604051808215151515815260200191505060405180910390f35b6112b96004803603604081101561124e57600080fd5b81019080803590602001909291908035906020019064010000000081111561127557600080fd5b82018360208201111561128757600080fd5b803590602001918460208302840111640100000000831117156112a957600080fd5b9091929391929390505050617033565b005b6112c36175b8565b6040518082815260200191505060405180910390f35b6112e16175bd565b6040518082815260200191505060405180910390f35b6112ff6175c2565b6040518082815260200191505060405180910390f35b611373600480360360c081101561132b57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506175c7565b6040518082815260200191505060405180910390f35b611391617651565b6040518082815260200191505060405180910390f35b6113af617667565b6040518082815260200191505060405180910390f35b6113cd617679565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156114105780820151818401526020810190506113f5565b505050509050019250505060405180910390f35b61142c61780c565b6040518082815260200191505060405180910390f35b61144a617818565b6040518082815260200191505060405180910390f35b61146861781d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156114ab578082015181840152602081019050611490565b505050509050019250505060405180910390f35b6114c761792e565b6040518082815260200191505060405180910390f35b61151f600480360360208110156114f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061793b565b005b611529617fd2565b6040518082815260200191505060405180910390f35b61158b6004803603604081101561155557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061805f565b604051808215151515815260200191505060405180910390f35b611607600480360360408110156115bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050618252565b6040518082815260200191505060405180910390f35b6116256182d9565b6040518082815260200191505060405180910390f35b6116916004803603606081101561165157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506182e8565b005b61169b61872b565b6040518082815260200191505060405180910390f35b6116f3600480360360208110156116c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050618741565b6040518082815260200191505060405180910390f35b61174b6004803603602081101561171f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506188e3565b6040518082815260200191505060405180910390f35b6117bf600480360360c081101561177757600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050618a74565b6040518082815260200191505060405180910390f35b6117dd618afb565b604051808215151515815260200191505060405180910390f35b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff161561191a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611a79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b611ada600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460016003670de0b6b3a764000081611ad357fe5b0401618b12565b831115611b4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611bae81600301548260020154600254600b5488600754616491565b91506000821415611c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b82821115611c9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b611cab816003015485618c54565b81600301819055506000611cc0836000618b12565b90508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed876040518082815260200191505060405180910390a3611d313384618ce6565b611d43611d3e8483618c54565b618cf4565b611d6f600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682618d00565b611d7a863387618d0e565b82925050506000600560016101000a81548160ff0219169083151502179055509392505050565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e395780601f10611e0e57610100808354040283529160200191611e39565b820191906000526020600020905b815481529060010190602001808311611e1c57829003601f168201915b5050505050905090565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6032670de0b6b3a76400000281565b6000600560019054906101000a900460ff1615611fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661208b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661214d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506121f182600301548360020154836003015484600201546000616fae565b9250505092915050565b6000600560019054906101000a900460ff1615612280576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612404576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506124a98260030154836002015483600301548460020154600754616fae565b9250505092915050565b6000600254905090565b6402540be400670de0b6b3a7640000816124d357fe5b0481565b670de0b6b3a764000081565b60008373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061259b5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b61260d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4552525f42544f4b454e5f4241445f43414c4c4552000000000000000000000081525060200191505060405180910390fd5b612618848484618e69565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126f057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156128dd5761277b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483618c54565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a35b600190509392505050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff169050919050565b6000600560019054906101000a900460ff16156129c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615612b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1615612bc4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612c87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b620f4240670de0b6b3a764000081612c9b57fe5b04811015612d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f4d494e5f46454500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a670de0b6b3a764000081612d2357fe5b04811115612d99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f4d41585f46454500000000000000000000000000000000000000000081525060200191505060405180910390fd5b806007819055506000600560016101000a81548160ff02191690831515021790555050565b6000600c60009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615612ef6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612fd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615613119576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a7640000811015613197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d494e5f57454947485400000000000000000000000000000000000081525060200191505060405180910390fd5b6032670de0b6b3a764000002811115613218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d41585f57454947485400000000000000000000000000000000000081525060200191505060405180910390fd5b64e8d4a51000670de0b6b3a76400008161322e57fe5b048210156132a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d494e5f42414c414e4345000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490508082111561339657613308600b546133038484618c54565b61909b565b600b819055506032670de0b6b3a764000002600b541115613391576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f4d41585f544f54414c5f57454947485400000000000000000000000081525060200191505060405180910390fd5b6133bb565b808210156133ba576133b3600b546133ae8385618c54565b618c54565b600b819055505b5b81600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905083600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550808411156134b1576134ac85336134a78785618c54565b619123565b61351b565b8084101561351a5760006134c58286618c54565b905060006134d4826000618b12565b90506134ea87336134e58585618c54565b618d0e565b61351787600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683618d0e565b50505b5b50506000600560016101000a81548160ff021916908315150217905550505050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166136fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166137bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061381e81600301548260020154600254600b548860075461661c565b915082821015613896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b6138f7600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460016003670de0b6b3a7640000816138f057fe5b0401618b12565b82111561396c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b61397a816003015483618c54565b8160030181905550600061398f856000618b12565b90508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed856040518082815260200191505060405180910390a3613a003386618ce6565b613a12613a0d8683618c54565b618cf4565b613a3e600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682618d00565b613a49863385618d0e565b82925050506000600560016101000a81548160ff0219169083151502179055509392505050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1615613c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613cf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b80600660146101000a81548160ff0219169083151502179055506000600560016101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613e4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613f29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615613fac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b60026009805490501015614028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d494e5f544f4b454e5300000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860006101000a81548160ff0219169083151502179055506001600660146101000a81548160ff0219169083151502179055506140726064670de0b6b3a7640000026192b2565b614087336064670de0b6b3a764000002618d00565b6000600560016101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff16156141c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff16614262576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600061426c6124b3565b9050600061427a85836192be565b905060008114156142f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b6009805490508110156145a85760006009828154811061431557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905060006143958583618b12565b9050600081141561440e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b87878581811061441a57fe5b90506020020135811115614496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b6144e2600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301548261909b565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a836040518082815260200191505060405180910390a3614598833383619123565b50505080806001019150506142f9565b506145b2856192b2565b6145bc3386618d00565b50506000600560016101000a81548160ff021916908315150217905550505050565b6000600c60009054906101000a900460ff1615614663576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4552525f414c52454144595f494e495449414c495a454400000000000000000081525060200191505060405180910390fd5b6146708686868686619477565b905095945050505050565b60008061468887866192be565b90506000614696878661909b565b905060006146a482896192be565b905060006146ba670de0b6b3a7640000856192be565b905060006146c8838361956c565b905060006146d6828e618b12565b905060006146e4828f618c54565b905060006147036146fd670de0b6b3a76400008a618c54565b8b618b12565b90506147208261471b670de0b6b3a764000084618c54565b6192be565b985088985050505050505050509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff161561485a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166148f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166149b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b614a17600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546002670de0b6b3a764000081614a1157fe5b04618b12565b831115614a8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050614aeb81600301548260020154600254600b548860075461655d565b915082821015614b63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b614b7181600301548561909b565b81600301819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a866040518082815260200191505060405180910390a3614be7826192b2565b614bf13383618d00565b614bfc853386619123565b819150506000600560016101000a81548160ff0219169083151502179055509392505050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115614d33576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614dbe565b614d3d8184618c54565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615614fcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1661506a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661512c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061518b81600301548260020154600254600b548860075461467b565b91506000821415615204576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8282111561527a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b6152d8600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546002670de0b6b3a7640000816152d257fe5b04618b12565b82111561534d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b61535b81600301548361909b565b81600301819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a846040518082815260200191505060405180910390a36153d1846192b2565b6153db3385618d00565b6153e6853384619123565b819150506000600560016101000a81548160ff0219169083151502179055509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b620f4240670de0b6b3a76400008161546857fe5b0481565b6000803373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615615590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661566d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661572f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600660149054906101000a900460ff166157b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f535741505f4e4f545f5055424c49430000000000000000000000000081525060200191505060405180910390fd5b6000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061585a816003015460016003670de0b6b3a76400008161585357fe5b0401618b12565b8611156158cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b60006158f08360030154846002015484600301548560020154600754616fae565b905085811115615968576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f4241445f4c494d49545f50524943450000000000000000000000000081525060200191505060405180910390fd5b61598883600301548460020154846003015485600201548b600754618a74565b945088851115615a00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b615a0e83600301548661909b565b8360030181905550615a24826003015488618c54565b8260030181905550615a4b8360030154846002015484600301548560020154600754616fae565b935080841015615ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b85841115615b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4c494d49545f5052494345000000000000000000000000000000000081525060200191505060405180910390fd5b615b4385886192be565b811115615bb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a4615c478a3387619123565b615c52883389618d0e565b8484945094505050506000600560016101000a81548160ff0219169083151502179055509550959350505050565b6000803373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615615da4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16615e81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16615f43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600660149054906101000a900460ff16615fc5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f535741505f4e4f545f5055424c49430000000000000000000000000081525060200191505060405180910390fd5b6000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061606b82600301546002670de0b6b3a76400008161606557fe5b04618b12565b8811156160e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b60006161018360030154846002015484600301548560020154600754616fae565b905085811115616179576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f4241445f4c494d49545f50524943450000000000000000000000000081525060200191505060405180910390fd5b61619983600301548460020154846003015485600201548d6007546175c7565b945086851015616211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b61621f83600301548a61909b565b8360030181905550616235826003015486618c54565b826003018190555061625c8360030154846002015484600301548560020154600754616fae565b9350808410156162d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8584111561634a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4c494d49545f5052494345000000000000000000000000000000000081525060200191505060405180910390fd5b61635489866192be565b8111156163c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46164588a338b619123565b616463883387618d0e565b8484945094505050506000600560016101000a81548160ff0219169083151502179055509550959350505050565b60008061649e87866192be565b905060006164b4670de0b6b3a764000083618c54565b905060006164c28286618b12565b905060006164e1876164dc670de0b6b3a764000085618c54565b6192be565b905060006164ef8c83618c54565b905060006164fd828e6192be565b9050600061650b828861956c565b90506000616519828e618b12565b905060006165278e83618c54565b905061654581616540670de0b6b3a76400006000618c54565b6192be565b99508999505050505050505050509695505050505050565b60008061656a87866192be565b90506000616589616583670de0b6b3a764000084618c54565b85618b12565b905060006165a8866165a3670de0b6b3a764000085618c54565b618b12565b905060006165b68b8361909b565b905060006165c4828d6192be565b905060006165d2828761956c565b905060006165e0828d618b12565b90506165ec818d618c54565b9750879750505050505050509695505050505050565b64e8d4a51000670de0b6b3a76400008161661857fe5b0481565b60008061662987866192be565b9050600061664985616644670de0b6b3a76400006000618c54565b618b12565b905060006166578883618c54565b90506000616665828a6192be565b905060006166848261667f670de0b6b3a7640000886192be565b61956c565b90506000616692828e618b12565b905060006166a08e83618c54565b905060006166bf6166b9670de0b6b3a76400008a618c54565b8b618b12565b90506166dc826166d7670de0b6b3a764000084618c54565b618b12565b985088985050505050505050509695505050505050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615616814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166168f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561698a57600080fd5b505afa15801561699e573d6000803e3d6000fd5b505050506040513d60208110156169b457600080fd5b8101908080519060200190929190505050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000600560016101000a81548160ff02191690831515021790555050565b6000600860009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615616b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614616c3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560016101000a81548160ff02191690831515021790555050565b6000600560019054906101000a900460ff1615616d23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600b54905090565b6064670de0b6b3a76400000281565b6000600560019054906101000a900460ff1615616dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16616e81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015616f635780601f10616f3857610100808354040283529160200191616f63565b820191906000526020600020905b815481529060010190602001808311616f4657829003601f168201915b5050505050905090565b60016003670de0b6b3a764000081616f8157fe5b040181565b60007f42524f4e5a450000000000000000000000000000000000000000000000000000905090565b600080616fbb87876192be565b90506000616fc986866192be565b90506000616fd783836192be565b90506000616ffe670de0b6b3a7640000616ff9670de0b6b3a764000089618c54565b6192be565b905061700a8282618b12565b94508494505050505095945050505050565b6000617029338484618e69565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615617154576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166171f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b60006171fb6124b3565b9050600061720a856000618b12565b905060006172188683618c54565b9050600061722682856192be565b9050600081141561729f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b6172a93388618ce6565b6172d5600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684618d00565b6172de82618cf4565b60008090505b6009805490508110156175935760006009828154811061730057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905060006173808583618b12565b905060008114156173f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b89898581811061740557fe5b90506020020135811015617481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b6174cd600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015482618c54565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed836040518082815260200191505060405180910390a3617583833383618d0e565b50505080806001019150506172e4565b50505050506000600560016101000a81548160ff021916908315150217905550505050565b600881565b600281565b600181565b6000806175d487866192be565b905060006175ea670de0b6b3a764000085618c54565b90506175f68582618b12565b9050600061760d8a6176088c8561909b565b6192be565b9050600061761b828561956c565b90506000617631670de0b6b3a764000083618c54565b905061763d8a82618b12565b955085955050505050509695505050505050565b600a670de0b6b3a76400008161766357fe5b0481565b6001670de0b6b3a76400006002020381565b6060600560019054906101000a900460ff16156176fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff16617780576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600980548060200260200160405190810160405280929190818152602001828054801561780257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116177b8575b5050505050905090565b670de0b6b3a764000081565b600081565b6060600560019054906101000a900460ff16156178a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600980548060200260200160405190810160405280929190818152602001828054801561792457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116178da575b5050505050905090565b6000600980549050905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615617a5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614617b3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16617bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615617c7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015490506000617cd3826000618b12565b9050617d23600b54600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154618c54565b600b819055506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600160098054905003905060098181548110617d8a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660098381548110617dc257fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a600060098581548110617e1c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506009805480617e9357fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055604051806080016040528060001515815260200160008152602001600081526020016000815250600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015560608201518160030155905050617f838533617f7e8787618c54565b618d0e565b617fb085600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685618d0e565b505050506000600560016101000a81548160ff02191690831515021790555050565b6000600560019054906101000a900460ff1615618057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600754905090565b60006180e7600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361909b565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6032670de0b6b3a76400000281565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614618449576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561850c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f49535f424f554e44000000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff161561858f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b60086009805490501061860a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d41585f544f4b454e5300000000000000000000000000000000000081525060200191505060405180910390fd5b60405180608001604052806001151581526020016009805490508152602001600081526020016000815250600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201556060820151816003015590505060098390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050618726838383612dd5565b505050565b6002670de0b6b3a76400008161873d57fe5b0481565b6000600560019054906101000a900460ff16156187c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16618888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490506188db81600b546192be565b915050919050565b6000600560019054906101000a900460ff1615618968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16618a2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b600080618a8185886192be565b90506000618a8f8786618c54565b90506000618a9d88836192be565b90506000618aab828561956c565b9050618abf81670de0b6b3a7640000618c54565b9050618ad3670de0b6b3a764000087618c54565b9450618ae8618ae28c83618b12565b866192be565b9450849450505050509695505050505050565b6000600660149054906101000a900460ff16905090565b60008082840290506000841480618b31575082848281618b2e57fe5b04145b618ba3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d554c5f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b60006002670de0b6b3a764000081618bb757fe5b048201905081811015618c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d554c5f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b6000670de0b6b3a76400008281618c4557fe5b04905080935050505092915050565b6000806000618c6385856196ea565b915091508015618cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f5355425f554e444552464c4f5700000000000000000000000000000081525060200191505060405180910390fd5b819250505092915050565b618cf08282619713565b5050565b618cfd81619722565b50565b618d0a82826198db565b5050565b60008373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015618db357600080fd5b505af1158015618dc7573d6000803e3d6000fd5b505050506040513d6020811015618ddd57600080fd5b8101908080519060200190929190505050905080618e63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f45524332305f46414c5345000000000000000000000000000000000081525060200191505060405180910390fd5b50505050565b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015618f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e53554646494349454e545f42414c00000000000000000000000081525060200191505060405180910390fd5b618f656000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482618c54565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550618fef6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261909b565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015619119576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4144445f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b8091505092915050565b60008373ffffffffffffffffffffffffffffffffffffffff166323b872dd8430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156191fc57600080fd5b505af1158015619210573d6000803e3d6000fd5b505050506040513d602081101561922657600080fd5b81019080805190602001909291905050509050806192ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f45524332305f46414c5345000000000000000000000000000000000081525060200191505060405180910390fd5b50505050565b6192bb816198ea565b50565b600080821415619336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4449565f5a45524f000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000670de0b6b3a76400008402905060008414806193645750670de0b6b3a764000084828161936157fe5b04145b6193d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4449565f494e5445524e414c0000000000000000000000000000000081525060200191505060405180910390fd5b6000600284816193e257fe5b04820190508181101561945d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4449565f494e5445524e414c0000000000000000000000000000000081525060200191505060405180910390fd5b600084828161946857fe5b04905080935050505092915050565b600085600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600560026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360078190555082600660146101000a81548160ff02191690831515021790555081600860006101000a81548160ff0219169083151502179055506001600c60006101000a81548160ff021916908315150217905550600c60009054906101000a900460ff16905095945050505050565b600060018310156195e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4552525f42504f575f424153455f544f4f5f4c4f57000000000000000000000081525060200191505060405180910390fd5b6001670de0b6b3a764000060020203831115619669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4552525f42504f575f424153455f544f4f5f484947480000000000000000000081525060200191505060405180910390fd5b6000619674836199ef565b905060006196828483618c54565b905060006196988661969385619a0b565b619a26565b905060008214156196ae578093505050506196e4565b60006196d187846402540be400670de0b6b3a7640000816196cb57fe5b04619ab0565b90506196dd8282618b12565b9450505050505b92915050565b6000808284106197025782840360009150915061970c565b8383036001915091505b9250929050565b61971e823083618e69565b5050565b806000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156197d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e53554646494349454e545f42414c00000000000000000000000081525060200191505060405180910390fd5b61981e6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482618c54565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061986c60025482618c54565b600281905550600073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6198e6308383618e69565b5050565b6199326000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261909b565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506199806002548261909b565b6002819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000670de0b6b3a7640000619a0383619a0b565b029050919050565b6000670de0b6b3a76400008281619a1e57fe5b049050919050565b60008083905060008060028581619a3957fe5b061415619a4e57670de0b6b3a7640000619a50565b815b905060028481619a5c57fe5b0493505b60008414619aa557619a728283618b12565b9150600060028581619a8057fe5b0614619a9357619a908183618b12565b90505b60028481619a9d57fe5b049350619a60565b809250505092915050565b600080839050600080619acb87670de0b6b3a76400006196ea565b915091506000670de0b6b3a76400009050600081905060008090506000600190505b888410619ba1576000670de0b6b3a764000082029050600080619b218a619b1c85670de0b6b3a7640000618c54565b6196ea565b91509150619b3887619b33848c618b12565b618b12565b9650619b4487846192be565b96506000871415619b5757505050619ba1565b8715619b6257841594505b8015619b6d57841594505b8415619b8457619b7d8688618c54565b9550619b91565b619b8e868861909b565b95505b5050508080600101915050619aed565b50819650505050505050939250505056fea165627a7a723058208e5fc63b5ae038413af53bb4c6d79268d7daa2dc8cd0e25c64d038ae87fb2da00029", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061040e576000357c0100000000000000000000000000000000000000000000000000000000900480638c28cbe811610232578063bc694ea211610142578063d73dd623116100d5578063ec093021116100a4578063ec09302114611693578063f1b8a9b7146116b1578063f8b2cb4f14611709578063f8d6aed414611761578063fde924f7146117d55761040e565b8063d73dd6231461153f578063dd62ed3e146115a5578063e4a28a521461161d578063e4e1e5381461163b5761040e565b8063cc77828d11610111578063cc77828d14611460578063cd2ed8fb146114bf578063cf5e7bd3146114dd578063d4cadf68146115215761040e565b8063bc694ea2146113a7578063be3bbd2e146113c5578063c36596a614611424578063c6580d12146114425761040e565b80639a86139b116101c5578063b0e0d13611610194578063b0e0d136146112bb578063b7b800a4146112d9578063ba019dab146112f7578063ba9530a614611315578063bc063e1a146113895761040e565b80639a86139b1461114a578063a221ee4914611168578063a9059cbb146111d2578063b02f0b73146112385761040e565b80639381cd2b116102015780639381cd2b14611033578063948d8ce61461105157806395d89b41146110a9578063992e2a921461112c5761040e565b80638c28cbe814610f6b5780638d4e408314610faf57806392eefe9b14610fd1578063936c3477146110155761040e565b806346ab38f11161032d5780636d06dfa0116102c05780638201aa3f1161028f5780638201aa3f14610d5457806382f652ad14610df15780638656b65314610e65578063867378c514610ed95780638929801214610ef75761040e565b80636d06dfa014610bd557806370a0823114610c4157806376c7a3c714610c995780637c5e9ea414610cb75761040e565b8063506de974116102fc578063506de974146109f15780635c1bbaf714610a8f5780635db3427714610b035780636618846314610b6f5761040e565b806346ab38f1146108c857806349b59552146109345780634bb278f3146109645780634f69c0d41461096e5761040e565b8063218b5382116103a5578063313ce56711610374578063313ce567146107fc57806334e1990714610820578063392e53cd1461084e5780633fdddaa2146108705761040e565b8063218b5382146106b257806323b872dd146106d05780632f37b624146107565780633018205f146107b25761040e565b80631446a7ff116103e15780631446a7ff1461058657806315e84af9146105fe57806318160ddd14610676578063189d00ca146106945761040e565b806302c967481461041357806306fdde031461047f578063095ea7b31461050257806309a3bbe414610568575b600080fd5b6104696004803603606081101561042957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506117f7565b6040518082815260200191505060405180910390f35b610487611da1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c75780820151818401526020810190506104ac565b50505050905090810190601f1680156104f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e43565b604051808215151515815260200191505060405180910390f35b610570611f35565b6040518082815260200191505060405180910390f35b6105e86004803603604081101561059c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f44565b6040518082815260200191505060405180910390f35b6106606004803603604081101561061457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121fb565b6040518082815260200191505060405180910390f35b61067e6124b3565b6040518082815260200191505060405180910390f35b61069c6124bd565b6040518082815260200191505060405180910390f35b6106ba6124d7565b6040518082815260200191505060405180910390f35b61073c600480360360608110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506124e3565b604051808215151515815260200191505060405180910390f35b6107986004803603602081101561076c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128e8565b604051808215151515815260200191505060405180910390f35b6107ba612941565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108046129ee565b604051808260ff1660ff16815260200191505060405180910390f35b61084c6004803603602081101561083657600080fd5b8101908080359060200190929190505050612a05565b005b610856612dbe565b604051808215151515815260200191505060405180910390f35b6108c66004803603606081101561088657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612dd5565b005b61091e600480360360608110156108de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061353d565b6040518082815260200191505060405180910390f35b6109626004803603602081101561094a57600080fd5b81019080803515159060200190929190505050613a70565b005b61096c613d2a565b005b6109ef6004803603604081101561098457600080fd5b8101908080359060200190929190803590602001906401000000008111156109ab57600080fd5b8201836020820111156109bd57600080fd5b803590602001918460208302840111640100000000831117156109df57600080fd5b90919293919293905050506140a4565b005b610a75600480360360a0811015610a0757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506145de565b604051808215151515815260200191505060405180910390f35b610aed600480360360c0811015610aa557600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061467b565b6040518082815260200191505060405180910390f35b610b5960048036036060811015610b1957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614737565b6040518082815260200191505060405180910390f35b610bbb60048036036040811015610b8557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050614c22565b604051808215151515815260200191505060405180910390f35b610c2b60048036036060811015610beb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614eaa565b6040518082815260200191505060405180910390f35b610c8360048036036020811015610c5757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061540c565b6040518082815260200191505060405180910390f35b610ca1615454565b6040518082815260200191505060405180910390f35b610d37600480360360a0811015610ccd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061546c565b604051808381526020018281526020019250505060405180910390f35b610dd4600480360360a0811015610d6a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050615c80565b604051808381526020018281526020019250505060405180910390f35b610e4f600480360360c0811015610e0757600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050616491565b6040518082815260200191505060405180910390f35b610ec3600480360360c0811015610e7b57600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061655d565b6040518082815260200191505060405180910390f35b610ee1616602565b6040518082815260200191505060405180910390f35b610f55600480360360c0811015610f0d57600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061661c565b6040518082815260200191505060405180910390f35b610fad60048036036020811015610f8157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506166f3565b005b610fb7616a29565b604051808215151515815260200191505060405180910390f35b61101360048036036020811015610fe757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050616a40565b005b61101d616c9e565b6040518082815260200191505060405180910390f35b61103b616d2b565b6040518082815260200191505060405180910390f35b6110936004803603602081101561106757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050616d3a565b6040518082815260200191505060405180910390f35b6110b1616ecb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110f15780820151818401526020810190506110d6565b50505050905090810190601f16801561111e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b611134616f6d565b6040518082815260200191505060405180910390f35b611152616f86565b6040518082815260200191505060405180910390f35b6111bc600480360360a081101561117e57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050616fae565b6040518082815260200191505060405180910390f35b61121e600480360360408110156111e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061701c565b604051808215151515815260200191505060405180910390f35b6112b96004803603604081101561124e57600080fd5b81019080803590602001909291908035906020019064010000000081111561127557600080fd5b82018360208201111561128757600080fd5b803590602001918460208302840111640100000000831117156112a957600080fd5b9091929391929390505050617033565b005b6112c36175b8565b6040518082815260200191505060405180910390f35b6112e16175bd565b6040518082815260200191505060405180910390f35b6112ff6175c2565b6040518082815260200191505060405180910390f35b611373600480360360c081101561132b57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506175c7565b6040518082815260200191505060405180910390f35b611391617651565b6040518082815260200191505060405180910390f35b6113af617667565b6040518082815260200191505060405180910390f35b6113cd617679565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156114105780820151818401526020810190506113f5565b505050509050019250505060405180910390f35b61142c61780c565b6040518082815260200191505060405180910390f35b61144a617818565b6040518082815260200191505060405180910390f35b61146861781d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156114ab578082015181840152602081019050611490565b505050509050019250505060405180910390f35b6114c761792e565b6040518082815260200191505060405180910390f35b61151f600480360360208110156114f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061793b565b005b611529617fd2565b6040518082815260200191505060405180910390f35b61158b6004803603604081101561155557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061805f565b604051808215151515815260200191505060405180910390f35b611607600480360360408110156115bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050618252565b6040518082815260200191505060405180910390f35b6116256182d9565b6040518082815260200191505060405180910390f35b6116916004803603606081101561165157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506182e8565b005b61169b61872b565b6040518082815260200191505060405180910390f35b6116f3600480360360208110156116c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050618741565b6040518082815260200191505060405180910390f35b61174b6004803603602081101561171f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506188e3565b6040518082815260200191505060405180910390f35b6117bf600480360360c081101561177757600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050618a74565b6040518082815260200191505060405180910390f35b6117dd618afb565b604051808215151515815260200191505060405180910390f35b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff161561191a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166119b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611a79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b611ada600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460016003670de0b6b3a764000081611ad357fe5b0401618b12565b831115611b4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611bae81600301548260020154600254600b5488600754616491565b91506000821415611c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b82821115611c9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b611cab816003015485618c54565b81600301819055506000611cc0836000618b12565b90508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed876040518082815260200191505060405180910390a3611d313384618ce6565b611d43611d3e8483618c54565b618cf4565b611d6f600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682618d00565b611d7a863387618d0e565b82925050506000600560016101000a81548160ff0219169083151502179055509392505050565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e395780601f10611e0e57610100808354040283529160200191611e39565b820191906000526020600020905b815481529060010190602001808311611e1c57829003601f168201915b5050505050905090565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6032670de0b6b3a76400000281565b6000600560019054906101000a900460ff1615611fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661208b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661214d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506121f182600301548360020154836003015484600201546000616fae565b9250505092915050565b6000600560019054906101000a900460ff1615612280576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612404576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506124a98260030154836002015483600301548460020154600754616fae565b9250505092915050565b6000600254905090565b6402540be400670de0b6b3a7640000816124d357fe5b0481565b670de0b6b3a764000081565b60008373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061259b5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b61260d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4552525f42544f4b454e5f4241445f43414c4c4552000000000000000000000081525060200191505060405180910390fd5b612618848484618e69565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126f057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156128dd5761277b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483618c54565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a35b600190509392505050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff169050919050565b6000600560019054906101000a900460ff16156129c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615612b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1615612bc4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612c87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b620f4240670de0b6b3a764000081612c9b57fe5b04811015612d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f4d494e5f46454500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a670de0b6b3a764000081612d2357fe5b04811115612d99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f4d41585f46454500000000000000000000000000000000000000000081525060200191505060405180910390fd5b806007819055506000600560016101000a81548160ff02191690831515021790555050565b6000600c60009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615612ef6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612fd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615613119576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a7640000811015613197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d494e5f57454947485400000000000000000000000000000000000081525060200191505060405180910390fd5b6032670de0b6b3a764000002811115613218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d41585f57454947485400000000000000000000000000000000000081525060200191505060405180910390fd5b64e8d4a51000670de0b6b3a76400008161322e57fe5b048210156132a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d494e5f42414c414e4345000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490508082111561339657613308600b546133038484618c54565b61909b565b600b819055506032670de0b6b3a764000002600b541115613391576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f4d41585f544f54414c5f57454947485400000000000000000000000081525060200191505060405180910390fd5b6133bb565b808210156133ba576133b3600b546133ae8385618c54565b618c54565b600b819055505b5b81600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905083600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550808411156134b1576134ac85336134a78785618c54565b619123565b61351b565b8084101561351a5760006134c58286618c54565b905060006134d4826000618b12565b90506134ea87336134e58585618c54565b618d0e565b61351787600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683618d0e565b50505b5b50506000600560016101000a81548160ff021916908315150217905550505050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166136fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166137bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061381e81600301548260020154600254600b548860075461661c565b915082821015613896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b6138f7600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460016003670de0b6b3a7640000816138f057fe5b0401618b12565b82111561396c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b61397a816003015483618c54565b8160030181905550600061398f856000618b12565b90508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed856040518082815260200191505060405180910390a3613a003386618ce6565b613a12613a0d8683618c54565b618cf4565b613a3e600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682618d00565b613a49863385618d0e565b82925050506000600560016101000a81548160ff0219169083151502179055509392505050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1615613c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613cf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b80600660146101000a81548160ff0219169083151502179055506000600560016101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615613e4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613f29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615613fac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b60026009805490501015614028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d494e5f544f4b454e5300000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860006101000a81548160ff0219169083151502179055506001600660146101000a81548160ff0219169083151502179055506140726064670de0b6b3a7640000026192b2565b614087336064670de0b6b3a764000002618d00565b6000600560016101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff16156141c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff16614262576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600061426c6124b3565b9050600061427a85836192be565b905060008114156142f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b6009805490508110156145a85760006009828154811061431557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905060006143958583618b12565b9050600081141561440e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b87878581811061441a57fe5b90506020020135811115614496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b6144e2600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301548261909b565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a836040518082815260200191505060405180910390a3614598833383619123565b50505080806001019150506142f9565b506145b2856192b2565b6145bc3386618d00565b50506000600560016101000a81548160ff021916908315150217905550505050565b6000600c60009054906101000a900460ff1615614663576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4552525f414c52454144595f494e495449414c495a454400000000000000000081525060200191505060405180910390fd5b6146708686868686619477565b905095945050505050565b60008061468887866192be565b90506000614696878661909b565b905060006146a482896192be565b905060006146ba670de0b6b3a7640000856192be565b905060006146c8838361956c565b905060006146d6828e618b12565b905060006146e4828f618c54565b905060006147036146fd670de0b6b3a76400008a618c54565b8b618b12565b90506147208261471b670de0b6b3a764000084618c54565b6192be565b985088985050505050505050509695505050505050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff161561485a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166148f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166149b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b614a17600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546002670de0b6b3a764000081614a1157fe5b04618b12565b831115614a8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050614aeb81600301548260020154600254600b548860075461655d565b915082821015614b63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b614b7181600301548561909b565b81600301819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a866040518082815260200191505060405180910390a3614be7826192b2565b614bf13383618d00565b614bfc853386619123565b819150506000600560016101000a81548160ff0219169083151502179055509392505050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115614d33576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614dbe565b614d3d8184618c54565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615614fcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff1661506a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661512c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061518b81600301548260020154600254600b548860075461467b565b91506000821415615204576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8282111561527a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b6152d8600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546002670de0b6b3a7640000816152d257fe5b04618b12565b82111561534d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b61535b81600301548361909b565b81600301819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a846040518082815260200191505060405180910390a36153d1846192b2565b6153db3385618d00565b6153e6853384619123565b819150506000600560016101000a81548160ff0219169083151502179055509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b620f4240670de0b6b3a76400008161546857fe5b0481565b6000803373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615615590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661566d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661572f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600660149054906101000a900460ff166157b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f535741505f4e4f545f5055424c49430000000000000000000000000081525060200191505060405180910390fd5b6000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061585a816003015460016003670de0b6b3a76400008161585357fe5b0401618b12565b8611156158cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4d41585f4f55545f524154494f00000000000000000000000000000081525060200191505060405180910390fd5b60006158f08360030154846002015484600301548560020154600754616fae565b905085811115615968576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f4241445f4c494d49545f50524943450000000000000000000000000081525060200191505060405180910390fd5b61598883600301548460020154846003015485600201548b600754618a74565b945088851115615a00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4c494d49545f494e000000000000000000000000000000000000000081525060200191505060405180910390fd5b615a0e83600301548661909b565b8360030181905550615a24826003015488618c54565b8260030181905550615a4b8360030154846002015484600301548560020154600754616fae565b935080841015615ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b85841115615b39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4c494d49545f5052494345000000000000000000000000000000000081525060200191505060405180910390fd5b615b4385886192be565b811115615bb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a4615c478a3387619123565b615c52883389618d0e565b8484945094505050506000600560016101000a81548160ff0219169083151502179055509550959350505050565b6000803373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615615da4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16615e81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16615f43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600660149054906101000a900460ff16615fc5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f535741505f4e4f545f5055424c49430000000000000000000000000081525060200191505060405180910390fd5b6000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061606b82600301546002670de0b6b3a76400008161606557fe5b04618b12565b8811156160e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d41585f494e5f524154494f0000000000000000000000000000000081525060200191505060405180910390fd5b60006161018360030154846002015484600301548560020154600754616fae565b905085811115616179576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4552525f4241445f4c494d49545f50524943450000000000000000000000000081525060200191505060405180910390fd5b61619983600301548460020154846003015485600201548d6007546175c7565b945086851015616211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b61621f83600301548a61909b565b8360030181905550616235826003015486618c54565b826003018190555061625c8360030154846002015484600301548560020154600754616fae565b9350808410156162d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8584111561634a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4c494d49545f5052494345000000000000000000000000000000000081525060200191505060405180910390fd5b61635489866192be565b8111156163c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46164588a338b619123565b616463883387618d0e565b8484945094505050506000600560016101000a81548160ff0219169083151502179055509550959350505050565b60008061649e87866192be565b905060006164b4670de0b6b3a764000083618c54565b905060006164c28286618b12565b905060006164e1876164dc670de0b6b3a764000085618c54565b6192be565b905060006164ef8c83618c54565b905060006164fd828e6192be565b9050600061650b828861956c565b90506000616519828e618b12565b905060006165278e83618c54565b905061654581616540670de0b6b3a76400006000618c54565b6192be565b99508999505050505050505050509695505050505050565b60008061656a87866192be565b90506000616589616583670de0b6b3a764000084618c54565b85618b12565b905060006165a8866165a3670de0b6b3a764000085618c54565b618b12565b905060006165b68b8361909b565b905060006165c4828d6192be565b905060006165d2828761956c565b905060006165e0828d618b12565b90506165ec818d618c54565b9750879750505050505050509695505050505050565b64e8d4a51000670de0b6b3a76400008161661857fe5b0481565b60008061662987866192be565b9050600061664985616644670de0b6b3a76400006000618c54565b618b12565b905060006166578883618c54565b90506000616665828a6192be565b905060006166848261667f670de0b6b3a7640000886192be565b61956c565b90506000616692828e618b12565b905060006166a08e83618c54565b905060006166bf6166b9670de0b6b3a76400008a618c54565b8b618b12565b90506166dc826166d7670de0b6b3a764000084618c54565b618b12565b985088985050505050505050509695505050505050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615616814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166168f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561698a57600080fd5b505afa15801561699e573d6000803e3d6000fd5b505050506040513d60208110156169b457600080fd5b8101908080519060200190929190505050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000600560016101000a81548160ff02191690831515021790555050565b6000600860009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615616b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614616c3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560016101000a81548160ff02191690831515021790555050565b6000600560019054906101000a900460ff1615616d23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600b54905090565b6064670de0b6b3a76400000281565b6000600560019054906101000a900460ff1615616dbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16616e81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015616f635780601f10616f3857610100808354040283529160200191616f63565b820191906000526020600020905b815481529060010190602001808311616f4657829003601f168201915b5050505050905090565b60016003670de0b6b3a764000081616f8157fe5b040181565b60007f42524f4e5a450000000000000000000000000000000000000000000000000000905090565b600080616fbb87876192be565b90506000616fc986866192be565b90506000616fd783836192be565b90506000616ffe670de0b6b3a7640000616ff9670de0b6b3a764000089618c54565b6192be565b905061700a8282618b12565b94508494505050505095945050505050565b6000617029338484618e69565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615617154576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600860009054906101000a900460ff166171f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b60006171fb6124b3565b9050600061720a856000618b12565b905060006172188683618c54565b9050600061722682856192be565b9050600081141561729f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b6172a93388618ce6565b6172d5600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684618d00565b6172de82618cf4565b60008090505b6009805490508110156175935760006009828154811061730057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905060006173808583618b12565b905060008114156173f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f4d4154485f415050524f58000000000000000000000000000000000081525060200191505060405180910390fd5b89898581811061740557fe5b90506020020135811015617481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4c494d49545f4f55540000000000000000000000000000000000000081525060200191505060405180910390fd5b6174cd600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015482618c54565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed836040518082815260200191505060405180910390a3617583833383618d0e565b50505080806001019150506172e4565b50505050506000600560016101000a81548160ff021916908315150217905550505050565b600881565b600281565b600181565b6000806175d487866192be565b905060006175ea670de0b6b3a764000085618c54565b90506175f68582618b12565b9050600061760d8a6176088c8561909b565b6192be565b9050600061761b828561956c565b90506000617631670de0b6b3a764000083618c54565b905061763d8a82618b12565b955085955050505050509695505050505050565b600a670de0b6b3a76400008161766357fe5b0481565b6001670de0b6b3a76400006002020381565b6060600560019054906101000a900460ff16156176fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff16617780576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f4e4f545f46494e414c495a454400000000000000000000000000000081525060200191505060405180910390fd5b600980548060200260200160405190810160405280929190818152602001828054801561780257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116177b8575b5050505050905090565b670de0b6b3a764000081565b600081565b6060600560019054906101000a900460ff16156178a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600980548060200260200160405190810160405280929190818152602001828054801561792457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116178da575b5050505050905090565b6000600980549050905090565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600560019054906101000a900460ff1615617a5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600560016101000a81548160ff021916908315150217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614617b3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16617bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff1615617c7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015490506000617cd3826000618b12565b9050617d23600b54600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154618c54565b600b819055506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000600160098054905003905060098181548110617d8a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660098381548110617dc257fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a600060098581548110617e1c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506009805480617e9357fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055604051806080016040528060001515815260200160008152602001600081526020016000815250600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015560608201518160030155905050617f838533617f7e8787618c54565b618d0e565b617fb085600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685618d0e565b505050506000600560016101000a81548160ff02191690831515021790555050565b6000600560019054906101000a900460ff1615618057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600754905090565b60006180e7600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361909b565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6032670de0b6b3a76400000281565b3373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660003660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a2600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614618449576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4552525f4e4f545f434f4e54524f4c4c4552000000000000000000000000000081525060200191505060405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561850c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f49535f424f554e44000000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff161561858f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f49535f46494e414c495a45440000000000000000000000000000000081525060200191505060405180910390fd5b60086009805490501061860a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4552525f4d41585f544f4b454e5300000000000000000000000000000000000081525060200191505060405180910390fd5b60405180608001604052806001151581526020016009805490508152602001600081526020016000815250600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201556060820151816003015590505060098390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050618726838383612dd5565b505050565b6002670de0b6b3a76400008161873d57fe5b0481565b6000600560019054906101000a900460ff16156187c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16618888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015490506188db81600b546192be565b915050919050565b6000600560019054906101000a900460ff1615618968576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4552525f5245454e54525900000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16618a2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4552525f4e4f545f424f554e440000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b600080618a8185886192be565b90506000618a8f8786618c54565b90506000618a9d88836192be565b90506000618aab828561956c565b9050618abf81670de0b6b3a7640000618c54565b9050618ad3670de0b6b3a764000087618c54565b9450618ae8618ae28c83618b12565b866192be565b9450849450505050509695505050505050565b6000600660149054906101000a900460ff16905090565b60008082840290506000841480618b31575082848281618b2e57fe5b04145b618ba3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d554c5f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b60006002670de0b6b3a764000081618bb757fe5b048201905081811015618c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4d554c5f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b6000670de0b6b3a76400008281618c4557fe5b04905080935050505092915050565b6000806000618c6385856196ea565b915091508015618cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552525f5355425f554e444552464c4f5700000000000000000000000000000081525060200191505060405180910390fd5b819250505092915050565b618cf08282619713565b5050565b618cfd81619722565b50565b618d0a82826198db565b5050565b60008373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015618db357600080fd5b505af1158015618dc7573d6000803e3d6000fd5b505050506040513d6020811015618ddd57600080fd5b8101908080519060200190929190505050905080618e63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f45524332305f46414c5345000000000000000000000000000000000081525060200191505060405180910390fd5b50505050565b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015618f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e53554646494349454e545f42414c00000000000000000000000081525060200191505060405180910390fd5b618f656000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482618c54565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550618fef6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261909b565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015619119576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4144445f4f564552464c4f570000000000000000000000000000000081525060200191505060405180910390fd5b8091505092915050565b60008373ffffffffffffffffffffffffffffffffffffffff166323b872dd8430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156191fc57600080fd5b505af1158015619210573d6000803e3d6000fd5b505050506040513d602081101561922657600080fd5b81019080805190602001909291905050509050806192ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4552525f45524332305f46414c5345000000000000000000000000000000000081525060200191505060405180910390fd5b50505050565b6192bb816198ea565b50565b600080821415619336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4552525f4449565f5a45524f000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000670de0b6b3a76400008402905060008414806193645750670de0b6b3a764000084828161936157fe5b04145b6193d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4449565f494e5445524e414c0000000000000000000000000000000081525060200191505060405180910390fd5b6000600284816193e257fe5b04820190508181101561945d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4552525f4449565f494e5445524e414c0000000000000000000000000000000081525060200191505060405180910390fd5b600084828161946857fe5b04905080935050505092915050565b600085600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600560026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360078190555082600660146101000a81548160ff02191690831515021790555081600860006101000a81548160ff0219169083151502179055506001600c60006101000a81548160ff021916908315150217905550600c60009054906101000a900460ff16905095945050505050565b600060018310156195e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4552525f42504f575f424153455f544f4f5f4c4f57000000000000000000000081525060200191505060405180910390fd5b6001670de0b6b3a764000060020203831115619669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4552525f42504f575f424153455f544f4f5f484947480000000000000000000081525060200191505060405180910390fd5b6000619674836199ef565b905060006196828483618c54565b905060006196988661969385619a0b565b619a26565b905060008214156196ae578093505050506196e4565b60006196d187846402540be400670de0b6b3a7640000816196cb57fe5b04619ab0565b90506196dd8282618b12565b9450505050505b92915050565b6000808284106197025782840360009150915061970c565b8383036001915091505b9250929050565b61971e823083618e69565b5050565b806000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156197d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4552525f494e53554646494349454e545f42414c00000000000000000000000081525060200191505060405180910390fd5b61981e6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482618c54565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061986c60025482618c54565b600281905550600073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6198e6308383618e69565b5050565b6199326000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261909b565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506199806002548261909b565b6002819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000670de0b6b3a7640000619a0383619a0b565b029050919050565b6000670de0b6b3a76400008281619a1e57fe5b049050919050565b60008083905060008060028581619a3957fe5b061415619a4e57670de0b6b3a7640000619a50565b815b905060028481619a5c57fe5b0493505b60008414619aa557619a728283618b12565b9150600060028581619a8057fe5b0614619a9357619a908183618b12565b90505b60028481619a9d57fe5b049350619a60565b809250505092915050565b600080839050600080619acb87670de0b6b3a76400006196ea565b915091506000670de0b6b3a76400009050600081905060008090506000600190505b888410619ba1576000670de0b6b3a764000082029050600080619b218a619b1c85670de0b6b3a7640000618c54565b6196ea565b91509150619b3887619b33848c618b12565b618b12565b9650619b4487846192be565b96506000871415619b5757505050619ba1565b8715619b6257841594505b8015619b6d57841594505b8415619b8457619b7d8688618c54565b9550619b91565b619b8e868861909b565b95505b5050508080600101915050619aed565b50819650505050505050939250505056fea165627a7a723058208e5fc63b5ae038413af53bb4c6d79268d7daa2dc8cd0e25c64d038ae87fb2da00029", + "sourceMap": "855:23541:8:-;;;2756:49:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2811:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2878:2;2850:30;;;;;;;;;;;;;;;;;;;;2683:5:8;2656:32;;;;;;;;;;;;;;;;;;;;2980:96;8:9:-1;5:2;;;30:1;27;20:12;5:2;2980:96:8;3011:58;3023:10;3035;923:5:3;765:6;916:12;;;;;;3056:5:8;3063;3011:11;;;:58;;;:::i;:::-;;855:23541;;3621:417;3807:4;3841:10;3827:11;;:24;;;;;;;;;;;;;;;;;;3872:7;3861:8;;:18;;;;;;;;;;;;;;;;;;3900:7;3889:8;:18;;;;3931:10;3917:11;;:24;;;;;;;;;;;;;;;;;;3964:9;3951:10;;:22;;;;;;;;;;;;;;;;;;3999:4;3985:11;;:18;;;;;;;;;;;;;;;;;;4020:11;;;;;;;;;;;4013:18;;3621:417;;;;;;;:::o;855:23541::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "855:23541:8:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;855:23541:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22099:1305;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22099:1305:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2887:81:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;2887:81:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3473:180;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3473:180:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1146:50:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;11538:555:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11538:555:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10977;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10977:555:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3381:86:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1438:54:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1039:45;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4443:565:6;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4443:565:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;4393:118:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4393:118:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;5965:131;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3065:80:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;6102:341:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6102:341:8;;;;;;;;;;;;;;;;;:::i;:::-;;2841:86;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;8052:1603;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8052:1603:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;20846:1247;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;20846:1247:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;6651:242;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6651:242:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;6899:418;;;:::i;:::-;;12099:925;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12099:925:8;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;12099:925:8;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;12099:925:8;;;;;;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;12099:925:8;;;;;;;;;;;;:::i;:::-;;3247:308;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;3247:308:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;8610:1167:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;8610:1167:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18534:1128:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;18534:1128:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3913:388:6;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3913:388:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;19668:1172:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19668:1172:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3275:100:6;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3275:100:6;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;875:53:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;16330:2197:8;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;16330:2197:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;14131:2193;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;14131:2193:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;13293:1324:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;13293:1324:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;6464:1140;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;6464:1140:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1202:54:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10883:1304:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;10883:1304:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10753:218:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10753:218:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;4281:106;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;6449:195;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6449:195:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;5203:142;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1263:51:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4979:218:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4979:218:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2974:85:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;2974:85:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1554:59:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;794:101:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1635:494:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1635:494:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4307:130:6;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4307:130:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;13030:1094:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;13030:1094:8;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;13030:1094:8;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;13030:1094:8;;;;;;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;13030:1094:8;;;;;;;;;;;;:::i;:::-;;826:42:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;778;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1321:46;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3135:664:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;3135:664:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;934:50:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1373:59;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4779:194:8;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;4779:194:8;;;;;;;;;;;;;;;;;724:47:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;990:42;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4635:138:8;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;4635:138:8;;;;;;;;;;;;;;;;;4517:112;;;:::i;:::-;;;;;;;;;;;;;;;;;;;9661:1010;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9661:1010:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;5837:122;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3659:248:6;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3659:248:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3151:118;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3151:118:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1090:50:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;7324:722:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7324:722:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1499:49:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5351:266:8;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5351:266:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5623:208;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5623:208:8;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4805:653:4;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4805:653:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4167:108:8;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;22099:1305;22289:17;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;22330:10;;;;;;;;;;;22322:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22380:8;:18;22389:8;22380:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;22372:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22471:47;22476:8;:18;22485:8;22476:18;;;;;;;;;;;;;;;:26;;;1608:5:3;1603:1;765:6;1596:8;;;;;;1595:18;22471:4:8;:47::i;:::-;22453:14;:65;;22432:130;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22573:24;22600:8;:18;22609:8;22600:18;;;;;;;;;;;;;;;22573:45;;22644:197;22682:9;:17;;;22713:9;:16;;;22743:12;;22769;;22795:14;22823:8;;22644:24;:197::i;:::-;22629:212;;22876:1;22860:12;:17;;22852:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22931:15;22915:12;:31;;22907:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22994:39;22999:9;:17;;;23018:14;22994:4;:39::i;:::-;22974:9;:17;;:59;;;;23044:12;23059:28;23064:12;1031:1:3;23059:4:8;:28::i;:::-;23044:43;;23124:8;23103:46;;23112:10;23103:46;;;23134:14;23103:46;;;;;;;;;;;;;;;;;;23160:40;23175:10;23187:12;23160:14;:40::i;:::-;23210:43;23225:27;23230:12;23244:7;23225:4;:27::i;:::-;23210:14;:43::i;:::-;23263:33;23278:8;;;;;;;;;;;23288:7;23263:14;:33::i;:::-;23306:53;23322:8;23332:10;23344:14;23306:15;:53::i;:::-;23385:12;23378:19;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;22099:1305;;;;;:::o;2887:81:6:-;2924:13;2956:5;2949:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2887:81;:::o;3473:180::-;3531:4;3577:3;3547:10;:22;3558:10;3547:22;;;;;;;;;;;;;;;:27;3570:3;3547:27;;;;;;;;;;;;;;;:33;;;;3616:3;3595:30;;3604:10;3595:30;;;3621:3;3595:30;;;;;;;;;;;;;;;;;;3642:4;3635:11;;3473:180;;;;:::o;1146:50:3:-;1194:2;765:6;1187:9;1146:50;:::o;11538:555:8:-;11660:14;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11698:8;:17;11707:7;11698:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;11690:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11757:8;:18;11766:8;11757:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;11749:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11809:23;11835:8;:17;11844:7;11835:17;;;;;;;;;;;;;;;11809:43;;11862:24;11889:8;:18;11898:8;11889:18;;;;;;;;;;;;;;;11862:45;;11924:162;11951:8;:16;;;11982:8;:15;;;12012:9;:17;;;12044:9;:16;;;12075:1;11924:13;:162::i;:::-;11917:169;;;;11538:555;;;;:::o;10977:::-;11092:14;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11130:8;:17;11139:7;11130:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;11122:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11189:8;:18;11198:8;11189:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;11181:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11241:23;11267:8;:17;11276:7;11267:17;;;;;;;;;;;;;;;11241:43;;11294:24;11321:8;:18;11330:8;11321:18;;;;;;;;;;;;;;;11294:45;;11356:169;11383:8;:16;;;11414:8;:15;;;11444:9;:17;;;11476:9;:16;;;11507:8;;11356:13;:169::i;:::-;11349:176;;;;10977:555;;;;:::o;3381:86:6:-;3425:4;3448:12;;3441:19;;3381:86;:::o;1438:54:3:-;1486:6;765;1479:13;;;;;;1438:54;:::o;1039:45::-;765:6;1039:45;:::o;4443:565:6:-;4561:4;4617:3;4603:17;;:10;:17;;;:55;;;;4631:10;:15;4642:3;4631:15;;;;;;;;;;;;;;;:27;4647:10;4631:27;;;;;;;;;;;;;;;;4624:3;:34;;4603:55;4582:124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4716:20;4722:3;4727;4732;4716:5;:20::i;:::-;4764:3;4750:17;;:10;:17;;;;:63;;;;;4810:2;4771:10;:15;4782:3;4771:15;;;;;;;;;;;;;;;:27;4787:10;4771:27;;;;;;;;;;;;;;;;:42;;4750:63;4746:235;;;4859:38;4864:10;:15;4875:3;4864:15;;;;;;;;;;;;;;;:27;4880:10;4864:27;;;;;;;;;;;;;;;;4893:3;4859:4;:38::i;:::-;4829:10;:15;4840:3;4829:15;;;;;;;;;;;;;;;:27;4845:10;4829:27;;;;;;;;;;;;;;;:68;;;;4937:3;4916:54;;4925:10;4916:54;;;4942:10;:15;4953:3;4942:15;;;;;;;;;;;;;;;:27;4958:10;4942:27;;;;;;;;;;;;;;;;4916:54;;;;;;;;;;;;;;;;;;4746:235;4997:4;4990:11;;4443:565;;;;;:::o;4393:118:8:-;4460:4;4487:8;:11;4496:1;4487:11;;;;;;;;;;;;;;;:17;;;;;;;;;;;;4480:24;;4393:118;;;:::o;5965:131::-;6048:7;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6078:11;;;;;;;;;;;6071:18;;5965:131;:::o;3065:80:6:-;3105:5;3129:9;;;;;;;;;;;3122:16;;3065:80;:::o;6102:341:8:-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;6207:10;;;;;;;;;;;6206:11;6198:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6270:11;;;;;;;;;;;6256:25;;:10;:25;;;6248:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;923:5:3;765:6;916:12;;;;;;6322:7:8;:18;;6314:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;982:2:3;765:6;975:9;;;;;;6374:7:8;:18;;6366:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6429:7;6418:8;:18;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;6102:341;:::o;2841:86::-;2886:4;2909:11;;;;;;;;;;;2902:18;;2841:86;:::o;8052:1603::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;8192:11;;;;;;;;;;;8178:25;;:10;:25;;;8170:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8244:8;:15;8253:5;8244:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;8236:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8302:10;;;;;;;;;;;8301:11;8293:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;765:6:3;8352::8;:20;;8344:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1138:2:3;765:6;1131:9;8409:6:8;:20;;8401:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1250:6:3;765;1243:13;;;;;;8466:7:8;:22;;8458:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8564:14;8581:8;:15;8590:5;8581:15;;;;;;;;;;;;;;;:22;;;8564:39;;8626:9;8617:6;:18;8613:299;;;8666:43;8671:12;;8685:23;8690:6;8698:9;8685:4;:23::i;:::-;8666:4;:43::i;:::-;8651:12;:58;;;;1194:2:3;765:6;1187:9;8731:12:8;;:32;;8723:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8613:299;;;8818:9;8809:6;:18;8805:107;;;8858:43;8863:12;;8877:23;8882:9;8893:6;8877:4;:23::i;:::-;8858:4;:43::i;:::-;8843:12;:58;;;;8805:107;8613:299;8954:6;8929:8;:15;8938:5;8929:15;;;;;;;;;;;;;;;:22;;:31;;;;9033:15;9051:8;:15;9060:5;9051:15;;;;;;;;;;;;;;;:23;;;9033:41;;9110:7;9084:8;:15;9093:5;9084:15;;;;;;;;;;;;;;;:23;;:33;;;;9141:10;9131:7;:20;9127:522;;;9167:61;9183:5;9190:10;9202:25;9207:7;9216:10;9202:4;:25::i;:::-;9167:15;:61::i;:::-;9127:522;;;9259:10;9249:7;:20;9245:404;;;9362:26;9391:25;9396:10;9408:7;9391:4;:25::i;:::-;9362:54;;9430:17;9450:37;9455:21;1031:1:3;9450:4:8;:37::i;:::-;9430:57;;9501:77;9517:5;9524:10;9536:41;9541:21;9564:12;9536:4;:41::i;:::-;9501:15;:77::i;:::-;9592:46;9608:5;9615:8;;;;;;;;;;;9625:12;9592:15;:46::i;:::-;9245:404;;;9127:522;1898:1;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;8052:1603;;;:::o;20846:1247::-;21028:19;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;21071:10;;;;;;;;;;;21063:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21121:8;:18;21130:8;21121:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;21113:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21174:24;21201:8;:18;21210:8;21201:18;;;;;;;;;;;;;;;21174:45;;21247:195;21285:9;:17;;;21316:9;:16;;;21346:12;;21372;;21398;21424:8;;21247:24;:195::i;:::-;21230:212;;21479:12;21461:14;:30;;21453:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21567:47;21572:8;:18;21581:8;21572:18;;;;;;;;;;;;;;;:26;;;1608:5:3;1603:1;765:6;1596:8;;;;;;1595:18;21567:4:8;:47::i;:::-;21549:14;:65;;21528:130;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21689:39;21694:9;:17;;;21713:14;21689:4;:39::i;:::-;21669:9;:17;;:59;;;;21739:12;21754:28;21759:12;1031:1:3;21754:4:8;:28::i;:::-;21739:43;;21819:8;21798:46;;21807:10;21798:46;;;21829:14;21798:46;;;;;;;;;;;;;;;;;;21855:40;21870:10;21882:12;21855:14;:40::i;:::-;21905:43;21920:27;21925:12;21939:7;21920:4;:27::i;:::-;21905:14;:43::i;:::-;21958:33;21973:8;;;;;;;;;;;21983:7;21958:14;:33::i;:::-;22001:53;22017:8;22027:10;22039:14;22001:15;:53::i;:::-;22072:14;22065:21;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;20846:1247;;;;;:::o;6651:242::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;6758:10;;;;;;;;;;;6757:11;6749:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6821:11;;;;;;;;;;;6807:25;;:10;:25;;;6799:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6879:7;6865:11;;:21;;;;;;;;;;;;;;;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;6651:242;:::o;6899:418::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;7002:11;;;;;;;;;;;6988:25;;:10;:25;;;6980:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7055:10;;;;;;;;;;;7054:11;7046:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;819:1:3;7104:7:8;:14;;;;:34;;7096:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7181:4;7168:10;;:17;;;;;;;;;;;;;;;;;;7209:4;7195:11;;:18;;;;;;;;;;;;;;;;;;7224:32;1311:3:3;765:6;1304:10;7224:14:8;:32::i;:::-;7266:44;7281:10;1311:3:3;765:6;1304:10;7266:14:8;:44::i;:::-;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;6899:418::o;12099:925::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;12236:10;;;;;;;;;;;12228:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12279:14;12296:13;:11;:13::i;:::-;12279:30;;12319:10;12332:30;12337:13;12352:9;12332:4;:30::i;:::-;12319:43;;12389:1;12380:5;:10;;12372:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12426:6;12435:1;12426:10;;12421:507;12442:7;:14;;;;12438:1;:18;12421:507;;;12477:9;12489:7;12497:1;12489:10;;;;;;;;;;;;;;;;;;;;;;;;;12477:22;;12513:8;12524;:11;12533:1;12524:11;;;;;;;;;;;;;;;:19;;;12513:30;;12557:18;12578:16;12583:5;12590:3;12578:4;:16::i;:::-;12557:37;;12633:1;12616:13;:18;;12608:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12693:12;;12706:1;12693:15;;;;;;;;;;;;;12676:13;:32;;12668:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12761:40;12766:8;:11;12775:1;12766:11;;;;;;;;;;;;;;;:19;;;12787:13;12761:4;:40::i;:::-;12739:8;:11;12748:1;12739:11;;;;;;;;;;;;;;;:19;;:62;;;;12841:1;12820:38;;12829:10;12820:38;;;12844:13;12820:38;;;;;;;;;;;;;;;;;;12872:45;12888:1;12891:10;12903:13;12872:15;:45::i;:::-;12421:507;;;12458:3;;;;;;;12421:507;;;;12937:29;12952:13;12937:14;:29::i;:::-;12976:41;12991:10;13003:13;12976:14;:41::i;:::-;1898:1;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;12099:925;;;:::o;3247:308::-;3457:4;2757:11;;;;;;;;;;;2756:12;2735:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3484:64;3496:10;3508:7;3517;3526:10;3538:9;3484:11;:64::i;:::-;3477:71;;3247:308;;;;;;;:::o;8610:1167:4:-;8845:18;8879:21;8903:32;8908:13;8923:11;8903:4;:32::i;:::-;8879:56;;8945:18;8966:31;8971:10;8983:13;8966:4;:31::i;:::-;8945:52;;9007:14;9024:31;9029:13;9044:10;9024:4;:31::i;:::-;9007:48;;9130:8;9141:28;765:6:3;9152:16:4;9141:4;:28::i;:::-;9130:39;;9180:17;9200:20;9205:9;9216:3;9200:4;:20::i;:::-;9180:40;;9230:22;9255:34;9260:12;9274:14;9255:4;:34::i;:::-;9230:59;;9299:26;9328:39;9333:17;9352:14;9328:4;:39::i;:::-;9299:68;;9616:8;9627:43;9632:28;765:6:3;9643:16:4;9632:4;:28::i;:::-;9662:7;9627:4;:43::i;:::-;9616:54;;9696:44;9701:21;9724:15;765:6:3;9735:3:4;9724:4;:15::i;:::-;9696:4;:44::i;:::-;9680:60;;9757:13;9750:20;;;;;;;;;;8610:1167;;;;;;;;:::o;18534:1128:8:-;18722:18;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;18773:10;;;;;;;;;;;18765:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18823:8;:17;18832:7;18823:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;18815:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18912:45;18917:8;:17;18926:7;18917:17;;;;;;;;;;;;;;;:25;;;1547:1:3;765:6;1540:8;;;;;;18912:4:8;:45::i;:::-;18895:13;:62;;18874:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19011:23;19037:8;:17;19046:7;19037:17;;;;;;;;;;;;;;;19011:43;;19081:194;19119:8;:16;;;19149:8;:15;;;19178:12;;19204;;19230:13;19257:8;;19081:24;:194::i;:::-;19065:210;;19311:16;19294:13;:33;;19286:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19375:37;19380:8;:16;;;19398:13;19375:4;:37::i;:::-;19356:8;:16;;:56;;;;19449:7;19428:44;;19437:10;19428:44;;;19458:13;19428:44;;;;;;;;;;;;;;;;;;19483:29;19498:13;19483:14;:29::i;:::-;19522:41;19537:10;19549:13;19522:14;:41::i;:::-;19573:51;19589:7;19598:10;19610:13;19573:15;:51::i;:::-;19642:13;19635:20;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;18534:1128;;;;;:::o;3913:388:6:-;3980:4;3996:13;4012:10;:22;4023:10;4012:22;;;;;;;;;;;;;;;:27;4035:3;4012:27;;;;;;;;;;;;;;;;3996:43;;4059:8;4053:3;:14;4049:156;;;4113:1;4083:10;:22;4094:10;4083:22;;;;;;;;;;;;;;;:27;4106:3;4083:27;;;;;;;;;;;;;;;:31;;;;4049:156;;;4175:19;4180:8;4190:3;4175:4;:19::i;:::-;4145:10;:22;4156:10;4145:22;;;;;;;;;;;;;;;:27;4168:3;4145:27;;;;;;;;;;;;;;;:49;;;;4049:156;4240:3;4219:54;;4228:10;4219:54;;;4245:10;:22;4256:10;4245:22;;;;;;;;;;;;;;;:27;4268:3;4245:27;;;;;;;;;;;;;;;;4219:54;;;;;;;;;;;;;;;;;;4290:4;4283:11;;;3913:388;;;;:::o;19668:1172:8:-;19850:18;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;19892:10;;;;;;;;;;;19884:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19942:8;:17;19951:7;19942:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;19934:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19994:23;20020:8;:17;20029:7;20020:17;;;;;;;;;;;;;;;19994:43;;20064:194;20102:8;:16;;;20132:8;:15;;;20161:12;;20187;;20213:13;20240:8;;20064:24;:194::i;:::-;20048:210;;20294:1;20277:13;:18;;20269:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20350:11;20333:13;:28;;20325:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20435:45;20440:8;:17;20449:7;20440:17;;;;;;;;;;;;;;;:25;;;1547:1:3;765:6;1540:8;;;;;;20435:4:8;:45::i;:::-;20418:13;:62;;20397:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20553:37;20558:8;:16;;;20576:13;20553:4;:37::i;:::-;20534:8;:16;;:56;;;;20627:7;20606:44;;20615:10;20606:44;;;20636:13;20606:44;;;;;;;;;;;;;;;;;;20661:29;20676:13;20661:14;:29::i;:::-;20700:41;20715:10;20727:13;20700:14;:41::i;:::-;20751:51;20767:7;20776:10;20788:13;20751:15;:51::i;:::-;20820:13;20813:20;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;19668:1172;;;;;:::o;3275:100:6:-;3331:4;3354:8;:14;3363:4;3354:14;;;;;;;;;;;;;;;;3347:21;;3275:100;;;:::o;875:53:3:-;923:5;765:6;916:12;;;;;;875:53;:::o;16330:2197:8:-;16558:18;16578:19;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;16621:8;:17;16630:7;16621:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;16613:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16680:8;:18;16689:8;16680:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;16672:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16740:11;;;;;;;;;;;16732:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16786:23;16812:8;:26;16829:7;16812:26;;;;;;;;;;;;;;;16786:52;;16848:24;16875:8;:27;16892:8;16875:27;;;;;;;;;;;;;;;16848:54;;16952:38;16957:9;:17;;;1608:5:3;1603:1;765:6;1596:8;;;;;;1595:18;16952:4:8;:38::i;:::-;16934:14;:56;;16913:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17045:20;17068:165;17095:8;:16;;;17125:8;:15;;;17154:9;:17;;;17185:9;:16;;;17215:8;;17068:13;:165::i;:::-;17045:188;;17279:8;17260:15;:27;;17252:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17338:194;17366:8;:16;;;17396:8;:15;;;17425:9;:17;;;17456:9;:16;;;17486:14;17514:8;;17338:14;:194::i;:::-;17322:210;;17567:11;17550:13;:28;;17542:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17625:37;17630:8;:16;;;17648:13;17625:4;:37::i;:::-;17606:8;:16;;:56;;;;17692:39;17697:9;:17;;;17716:14;17692:4;:39::i;:::-;17672:9;:17;;:59;;;;17759:165;17786:8;:16;;;17816:8;:15;;;17845:9;:17;;;17876:9;:16;;;17906:8;;17759:13;:165::i;:::-;17742:182;;17960:15;17942:14;:33;;17934:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18031:8;18013:14;:26;;18005:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18109:35;18114:13;18129:14;18109:4;:35::i;:::-;18090:15;:54;;18069:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18271:8;18202:144;;18249:7;18202:144;;18224:10;18202:144;;;18294:13;18322:14;18202:144;;;;;;;;;;;;;;;;;;;;;;;;18357:51;18373:7;18382:10;18394:13;18357:15;:51::i;:::-;18418:53;18434:8;18444:10;18456:14;18418:15;:53::i;:::-;18490:13;18505:14;18482:38;;;;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;16330:2197;;;;;;;;:::o;14131:2193::-;14357:19;14378;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;14422:8;:17;14431:7;14422:17;;;;;;;;;;;;;;;:23;;;;;;;;;;;;14414:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14481:8;:18;14490:8;14481:18;;;;;;;;;;;;;;;:24;;;;;;;;;;;;14473:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14541:11;;;;;;;;;;;14533:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14587:23;14613:8;:26;14630:7;14613:26;;;;;;;;;;;;;;;14587:52;;14649:24;14676:8;:27;14693:8;14676:27;;;;;;;;;;;;;;;14649:54;;14752:36;14757:8;:16;;;1547:1:3;765:6;1540:8;;;;;;14752:4:8;:36::i;:::-;14735:13;:53;;14714:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14842:20;14865:165;14892:8;:16;;;14922:8;:15;;;14951:9;:17;;;14982:9;:16;;;15012:8;;14865:13;:165::i;:::-;14842:188;;15067:8;15048:15;:27;;15040:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15127:193;15155:8;:16;;;15185:8;:15;;;15214:9;:17;;;15245:9;:16;;;15275:13;15302:8;;15127:14;:193::i;:::-;15110:210;;15356:12;15338:14;:30;;15330:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15416:37;15421:8;:16;;;15439:13;15416:4;:37::i;:::-;15397:8;:16;;:56;;;;15483:39;15488:9;:17;;;15507:14;15483:4;:39::i;:::-;15463:9;:17;;:59;;;;15550:165;15577:8;:16;;;15607:8;:15;;;15636:9;:17;;;15667:9;:16;;;15697:8;;15550:13;:165::i;:::-;15533:182;;15751:15;15733:14;:33;;15725:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15827:8;15809:14;:26;;15801:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15905:35;15910:13;15925:14;15905:4;:35::i;:::-;15886:15;:54;;15865:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16067:8;15998:144;;16045:7;15998:144;;16020:10;15998:144;;;16090:13;16118:14;15998:144;;;;;;;;;;;;;;;;;;;;;;;;16153:51;16169:7;16178:10;16190:13;16153:15;:51::i;:::-;16214:53;16230:8;16240:10;16252:14;16214:15;:53::i;:::-;16286:14;16302;16278:39;;;;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;14131:2193;;;;;;;;:::o;13293:1324:4:-;13531:17;13618:21;13642:33;13647:14;13663:11;13642:4;:33::i;:::-;13618:57;;13756:8;13767:28;765:6:3;13778:16:4;13767:4;:28::i;:::-;13756:39;;13805:8;13816:18;13821:3;13826:7;13816:4;:18::i;:::-;13805:29;;13845:32;13880:72;13898:14;13927:15;765:6:3;13938:3:4;13927:4;:15::i;:::-;13880:4;:72::i;:::-;13845:107;;13963:23;13989:85;14007:15;14037:27;13989:4;:85::i;:::-;13963:111;;14084:18;14105:41;14110:18;14130:15;14105:4;:41::i;:::-;14084:62;;14223:14;14240:37;14245:13;14260:16;14240:4;:37::i;:::-;14223:54;;14287:18;14308:27;14313:9;14324:10;14308:4;:27::i;:::-;14287:48;;14345:29;14377:31;14382:10;14394:13;14377:4;:31::i;:::-;14345:63;;14529:52;14534:24;14560:20;765:6:3;1031:1;14560:4:4;:20::i;:::-;14529:4;:52::i;:::-;14514:67;;14598:12;14591:19;;;;;;;;;;;13293:1324;;;;;;;;:::o;6464:1140::-;6699:18;6977:21;7001:32;7006:13;7021:11;7001:4;:32::i;:::-;6977:56;;7043:8;7054:43;7059:28;765:6:3;7070:16:4;7059:4;:28::i;:::-;7089:7;7054:4;:43::i;:::-;7043:54;;7108:26;7137:36;7142:13;7157:15;765:6:3;7168:3:4;7157:4;:15::i;:::-;7137:4;:36::i;:::-;7108:65;;7184:22;7209:43;7214:14;7230:21;7209:4;:43::i;:::-;7184:68;;7262:17;7282:39;7287:17;7306:14;7282:4;:39::i;:::-;7262:59;;7399:14;7416:36;7421:12;7435:16;7416:4;:36::i;:::-;7399:53;;7462:18;7483:27;7488:9;7499:10;7483:4;:27::i;:::-;7462:48;;7536:31;7541:13;7556:10;7536:4;:31::i;:::-;7520:47;;7584:13;7577:20;;;;;;;;;6464:1140;;;;;;;;:::o;1202:54:3:-;1250:6;765;1243:13;;;;;;1202:54;:::o;10883:1304:4:-;11119:19;11154:21;11178:33;11183:14;11199:11;11178:4;:33::i;:::-;11154:57;;11316:29;11348:75;11366:12;11393:20;765:6:3;1031:1;11393:4:4;:20::i;:::-;11348:4;:75::i;:::-;11316:107;;11433:18;11454:42;11459:10;11471:24;11454:4;:42::i;:::-;11433:63;;11506:14;11523:31;11528:13;11543:10;11523:4;:31::i;:::-;11506:48;;11624:18;11645:45;11650:9;11661:28;765:6:3;11672:16:4;11661:4;:28::i;:::-;11645:4;:45::i;:::-;11624:66;;11700:23;11726:36;11731:13;11746:15;11726:4;:36::i;:::-;11700:62;;11773:32;11808:76;11826:15;11856:18;11808:4;:76::i;:::-;11773:111;;12017:8;12028:43;12033:28;765:6:3;12044:16:4;12033:4;:28::i;:::-;12063:7;12028:4;:43::i;:::-;12017:54;;12099:50;12104:27;12133:15;765:6:3;12144:3:4;12133:4;:15::i;:::-;12099:4;:50::i;:::-;12082:67;;12166:14;12159:21;;;;;;;;;;10883:1304;;;;;;;;:::o;10753:218:8:-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;10851:8;:15;10860:5;10851:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;10843:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10933:5;10926:23;;;10958:4;10926:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10926:38:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10926:38:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10926:38:8;;;;;;;;;;;;;;;;10900:8;:15;10909:5;10900:15;;;;;;;;;;;;;;;:23;;:64;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;10753:218;:::o;4281:106::-;4343:4;4370:10;;;;;;;;;;;4363:17;;4281:106;:::o;6449:195::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;6572:11;;;;;;;;;;;6558:25;;:10;:25;;;6550:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6630:7;6616:11;;:21;;;;;;;;;;;;;;;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;6449:195;:::o;5203:142::-;5299:4;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5326:12;;5319:19;;5203:142;:::o;1263:51:3:-;1311:3;765:6;1304:10;1263:51;:::o;4979:218:8:-;5083:4;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5112:8;:15;5121:5;5112:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;5104:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5168:8;:15;5177:5;5168:15;;;;;;;;;;;;;;;:22;;;5161:29;;4979:218;;;:::o;2974:85:6:-;3013:13;3045:7;3038:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2974:85;:::o;1554:59:3:-;1608:5;1603:1;765:6;1596:8;;;;;;1595:18;1554:59;:::o;794:101:2:-;845:7;871:17;864:24;;794:101;:::o;1635:494:4:-;1839:14;1869:10;1882:35;1887:14;1903:13;1882:4;:35::i;:::-;1869:48;;1927:10;1940:37;1945:15;1962:14;1940:4;:37::i;:::-;1927:50;;1987:10;2000:18;2005:5;2012;2000:4;:18::i;:::-;1987:31;;2028:10;2041:31;765:6:3;2052:19:4;765:6:3;2063:7:4;2052:4;:19::i;:::-;2041:4;:31::i;:::-;2028:44;;2103:18;2108:5;2115;2103:4;:18::i;:::-;2091:30;;;2082:40;;;;;;1635:494;;;;;;;:::o;4307:130:6:-;4366:4;4382:27;4388:10;4400:3;4405;4382:5;:27::i;:::-;4426:4;4419:11;;4307:130;;;;:::o;13030:1094:8:-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;13167:10;;;;;;;;;;;13159:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13210:14;13227:13;:11;:13::i;:::-;13210:30;;13250:12;13265:28;13270:12;1031:1:3;13265:4:8;:28::i;:::-;13250:43;;13303:20;13326:27;13331:12;13345:7;13326:4;:27::i;:::-;13303:50;;13363:10;13376:32;13381:15;13398:9;13376:4;:32::i;:::-;13363:45;;13435:1;13426:5;:10;;13418:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13467:40;13482:10;13494:12;13467:14;:40::i;:::-;13517:33;13532:8;;;;;;;;;;;13542:7;13517:14;:33::i;:::-;13560:31;13575:15;13560:14;:31::i;:::-;13607:6;13616:1;13607:10;;13602:515;13623:7;:14;;;;13619:1;:18;13602:515;;;13658:9;13670:7;13678:1;13670:10;;;;;;;;;;;;;;;;;;;;;;;;;13658:22;;13694:8;13705;:11;13714:1;13705:11;;;;;;;;;;;;;;;:19;;;13694:30;;13738:19;13760:16;13765:5;13772:3;13760:4;:16::i;:::-;13738:38;;13816:1;13798:14;:19;;13790:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13877:13;;13891:1;13877:16;;;;;;;;;;;;;13859:14;:34;;13851:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13947:41;13952:8;:11;13961:1;13952:11;;;;;;;;;;;;;;;:19;;;13973:14;13947:4;:41::i;:::-;13925:8;:11;13934:1;13925:11;;;;;;;;;;;;;;;:19;;:63;;;;14028:1;14007:39;;14016:10;14007:39;;;14031:14;14007:39;;;;;;;;;;;;;;;;;;14060:46;14076:1;14079:10;14091:14;14060:15;:46::i;:::-;13602:515;;;13639:3;;;;;;;13602:515;;;;1898:1;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;13030:1094;;;:::o;826:42:3:-;867:1;826:42;:::o;778:::-;819:1;778:42;:::o;1321:46::-;1362:5;1321:46;:::o;3135:664:4:-;3368:19;3403:16;3422:35;3427:13;3442:14;3422:4;:35::i;:::-;3403:54;;3467:15;3485:19;765:6:3;3496:7:4;3485:4;:19::i;:::-;3467:37;;3527:31;3532:13;3547:10;3527:4;:31::i;:::-;3514:44;;3568:6;3577:54;3582:14;3598:32;3603:14;3619:10;3598:4;:32::i;:::-;3577:4;:54::i;:::-;3568:63;;3641:8;3652:20;3657:1;3660:11;3652:4;:20::i;:::-;3641:31;;3682:8;3693:15;765:6:3;3704:3:4;3693:4;:15::i;:::-;3682:26;;3735;3740:15;3757:3;3735:4;:26::i;:::-;3718:43;;3778:14;3771:21;;;;;;;3135:664;;;;;;;;:::o;934:50:3:-;982:2;765:6;975:9;;;;;;934:50;:::o;1373:59::-;1427:5;765:6;1415:1;:8;1414:18;1373:59;:::o;4779:194:8:-;4863:23;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4910:10;;;;;;;;;;;4902:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4959:7;4952:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4779:194;:::o;724:47:3:-;765:6;724:47;:::o;990:42::-;1031:1;990:42;:::o;4635:138:8:-;4713:23;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4759:7;4752:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4635:138;:::o;4517:112::-;4580:4;4608:7;:14;;;;4601:21;;4517:112;:::o;9661:1010::-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;1821:6;;;;;;;;;;;1820:7;1799:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1884:4;1875:6;;:13;;;;;;;;;;;;;;;;;;9776:11;;;;;;;;;;;9762:25;;:10;:25;;;9754:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9828:8;:15;9837:5;9828:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;9820:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9886:10;;;;;;;;;;;9885:11;9877:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9928:17;9948:8;:15;9957:5;9948:15;;;;;;;;;;;;;;;:23;;;9928:43;;9981:17;10001:28;10006:12;1031:1:3;10001:4:8;:28::i;:::-;9981:48;;10055:42;10060:12;;10074:8;:15;10083:5;10074:15;;;;;;;;;;;;;;;:22;;;10055:4;:42::i;:::-;10040:12;:57;;;;10203:10;10216:8;:15;10225:5;10216:15;;;;;;;;;;;;;;;:21;;;10203:34;;10247:9;10276:1;10259:7;:14;;;;:18;10247:30;;10304:7;10312:4;10304:13;;;;;;;;;;;;;;;;;;;;;;;;;10287:7;10295:5;10287:14;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;;;;;;;10360:5;10327:8;:24;10336:7;10344:5;10336:14;;;;;;;;;;;;;;;;;;;;;;;;;10327:24;;;;;;;;;;;;;;;:30;;:38;;;;10375:7;:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10416:113;;;;;;;;10444:5;10416:113;;;;;;10470:1;10416:113;;;;10493:1;10416:113;;;;10517:1;10416:113;;;10398:8;:15;10407:5;10398:15;;;;;;;;;;;;;;;:131;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10540:68;10556:5;10563:10;10575:32;10580:12;10594;10575:4;:32::i;:::-;10540:15;:68::i;:::-;10618:46;10634:5;10641:8;;;;;;;;;;;10651:12;10618:15;:46::i;:::-;1898:1;;;;1918:5;1909:6;;:14;;;;;;;;;;;;;;;;;;9661:1010;:::o;5837:122::-;5917:4;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5944:8;;5937:15;;5837:122;:::o;3659:248:6:-;3726:4;3772:38;3777:10;:22;3788:10;3777:22;;;;;;;;;;;;;;;:27;3800:3;3777:27;;;;;;;;;;;;;;;;3806:3;3772:4;:38::i;:::-;3742:10;:22;3753:10;3742:22;;;;;;;;;;;;;;;:27;3765:3;3742:27;;;;;;;;;;;;;;;:68;;;;3846:3;3825:54;;3834:10;3825:54;;;3851:10;:22;3862:10;3851:22;;;;;;;;;;;;;;;:27;3874:3;3851:27;;;;;;;;;;;;;;;;3825:54;;;;;;;;;;;;;;;;;;3896:4;3889:11;;3659:248;;;;:::o;3151:118::-;3219:4;3242:10;:15;3253:3;3242:15;;;;;;;;;;;;;;;:20;3258:3;3242:20;;;;;;;;;;;;;;;;3235:27;;3151:118;;;;:::o;1090:50:3:-;1138:2;765:6;1131:9;1090:50;:::o;7324:722:8:-;1726:10;1708:39;;1717:7;;;;1708:39;;;1738:8;;1708:39;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1708:39:8;;;;;;;;;;;;;;7527:11;;;;;;;;;;;7513:25;;:10;:25;;;7505:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7580:8;:15;7589:5;7580:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;7579:22;7571:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7637:10;;;;;;;;;;;7636:11;7628:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;867:1:3;7687:7:8;:14;;;;:33;7679:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7768:202;;;;;;;;7796:4;7768:202;;;;;;7821:7;:14;;;;7768:202;;;;7857:1;7768:202;;;;7933:1;7768:202;;;7750:8;:15;7759:5;7750:15;;;;;;;;;;;;;;;:220;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7980:7;7993:5;7980:19;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;7980:19:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8009:30;8016:5;8023:7;8032:6;8009;:30::i;:::-;7324:722;;;:::o;1499:49:3:-;1547:1;765:6;1540:8;;;;;;1499:49;:::o;5351:266:8:-;5453:4;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5482:8;:15;5491:5;5482:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;5474:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5531:11;5545:8;:15;5554:5;5545:15;;;;;;;;;;;;;;;:22;;;5531:36;;5584:26;5589:6;5597:12;;5584:4;:26::i;:::-;5577:33;;;5351:266;;;:::o;5623:208::-;5716:4;1977:6;;;;;;;;;;;1976:7;1968:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5745:8;:15;5754:5;5745:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;5737:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5801:8;:15;5810:5;5801:15;;;;;;;;;;;;;;;:23;;;5794:30;;5623:208;;;:::o;4805:653:4:-;5039:18;5073:16;5092:35;5097:14;5113:13;5092:4;:35::i;:::-;5073:54;;5137:9;5149:37;5154:15;5171:14;5149:4;:37::i;:::-;5137:49;;5196:6;5205:27;5210:15;5227:4;5205;:27::i;:::-;5196:36;;5242:8;5253:20;5258:1;5261:11;5253:4;:20::i;:::-;5242:31;;5289:15;5294:3;765:6:3;5289:4:4;:15::i;:::-;5283:21;;5330:19;765:6:3;5341:7:4;5330:4;:19::i;:::-;5314:35;;5375:46;5380:25;5385:14;5401:3;5380:4;:25::i;:::-;5407:13;5375:4;:46::i;:::-;5359:62;;5438:13;5431:20;;;;;;4805:653;;;;;;;;:::o;4167:108:8:-;4230:4;4257:11;;;;;;;;;;;4250:18;;4167:108;:::o;1549:301:5:-;1618:4;1638:7;1652:1;1648;:5;1638:15;;1676:1;1671;:6;:21;;;;1691:1;1686;1681:2;:6;;;;;;:11;1671:21;1663:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1723:7;1746:1;765:6:3;1739:8:5;;;;;;1733:2;:15;1723:25;;1772:2;1766;:8;;1758:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1805:7;765:6:3;1815:2:5;:9;;;;;;1805:19;;1841:2;1834:9;;;;;1549:301;;;;:::o;1128:195::-;1197:4;1218:6;1226:9;1239:14;1248:1;1251;1239:8;:14::i;:::-;1217:36;;;;1272:4;1271:5;1263:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1315:1;1308:8;;;;1128:195;;;;:::o;23987:108:8:-;24069:19;24075:4;24081:6;24069:5;:19::i;:::-;23987:108;;:::o;24305:88::-;24373:13;24379:6;24373:5;:13::i;:::-;24305:88;:::o;24101:104::-;24181:17;24187:2;24191:6;24181:5;:17::i;:::-;24101:104;;:::o;23790:191::-;23886:9;23905:5;23898:22;;;23921:2;23925:6;23898:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23898:34:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23898:34:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;23898:34:8;;;;;;;;;;;;;;;;23886:46;;23950:4;23942:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23790:191;;;;:::o;2239:268:6:-;2334:3;2317:8;:13;2326:3;2317:13;;;;;;;;;;;;;;;;:20;;2309:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2388:24;2393:8;:13;2402:3;2393:13;;;;;;;;;;;;;;;;2408:3;2388:4;:24::i;:::-;2372:8;:13;2381:3;2372:13;;;;;;;;;;;;;;;:40;;;;2438:24;2443:8;:13;2452:3;2443:13;;;;;;;;;;;;;;;;2458:3;2438:4;:24::i;:::-;2422:8;:13;2431:3;2422:13;;;;;;;;;;;;;;;:40;;;;2491:3;2477:23;;2486:3;2477:23;;;2496:3;2477:23;;;;;;;;;;;;;;;;;;2239:268;;;:::o;949:173:5:-;1018:4;1038:6;1051:1;1047;:5;1038:14;;1075:1;1070;:6;;1062:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1114:1;1107:8;;;949:173;;;;:::o;23570:214:8:-;23668:9;23687:5;23680:26;;;23707:4;23721;23728:6;23680:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23680:55:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23680:55:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;23680:55:8;;;;;;;;;;;;;;;;23668:67;;23753:4;23745:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23570:214;;;;:::o;24211:88::-;24279:13;24285:6;24279:5;:13::i;:::-;24211:88;:::o;1856:376:5:-;1925:4;1958:1;1953;:6;;1945:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1986:7;765:6:3;1996:1:5;:8;1986:18;;2027:1;2022;:6;:24;;;;765:6:3;2037:1:5;2032:2;:6;;;;;;:14;2022:24;2014:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2094:7;2114:1;2110;:5;;;;;;2104:2;:12;2094:22;;2140:2;2134;:8;;2126:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2190:7;2205:1;2200:2;:6;;;;;;2190:16;;2223:2;2216:9;;;;;1856:376;;;;:::o;3621:417:8:-;3807:4;3841:10;3827:11;;:24;;;;;;;;;;;;;;;;;;3872:7;3861:8;;:18;;;;;;;;;;;;;;;;;;3900:7;3889:8;:18;;;;3931:10;3917:11;;:24;;;;;;;;;;;;;;;;;;3964:9;3951:10;;:22;;;;;;;;;;;;;;;;;;3999:4;3985:11;;:18;;;;;;;;;;;;;;;;;;4020:11;;;;;;;;;;;4013:18;;3621:417;;;;;;;:::o;2733:537:5:-;2807:4;1362:5:3;2835:4:5;:21;;2827:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1427:5:3;765:6;1415:1;:8;1414:18;2900:4:5;:21;;2892:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2959:10;2973:11;2980:3;2973:6;:11::i;:::-;2959:25;;2997:11;3011:16;3016:3;3021:5;3011:4;:16::i;:::-;2997:30;;3038:13;3054:24;3060:4;3066:11;3071:5;3066:4;:11::i;:::-;3054:5;:24::i;:::-;3038:40;;3103:1;3093:6;:11;3089:57;;;3127:8;3120:15;;;;;;;3089:57;3156:18;3177:40;3188:4;3194:6;1486::3;765;1479:13;;;;;;3177:10:5;:40::i;:::-;3156:61;;3234:29;3239:8;3249:13;3234:4;:29::i;:::-;3227:36;;;;;;2733:537;;;;;:::o;1329:214::-;1402:4;1408;1437:1;1432;:6;1428:109;;1466:1;1462;:5;1469;1454:21;;;;;;1428:109;1518:1;1514;:5;1521:4;1506:20;;;;1329:214;;;;;;:::o;2611:96:6:-;2669:31;2675:4;2689;2696:3;2669:5;:31::i;:::-;2611:96;;:::o;1911:322::-;2003:3;1976:8;:23;1993:4;1976:23;;;;;;;;;;;;;;;;:30;;1955:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2089:34;2094:8;:23;2111:4;2094:23;;;;;;;;;;;;;;;;2119:3;2089:4;:34::i;:::-;2063:8;:23;2080:4;2063:23;;;;;;;;;;;;;;;:60;;;;2148:23;2153:12;;2167:3;2148:4;:23::i;:::-;2133:12;:38;;;;2218:1;2186:40;;2203:4;2186:40;;;2222:3;2186:40;;;;;;;;;;;;;;;;;;1911:322;:::o;2513:92::-;2569:29;2583:4;2590:2;2594:3;2569:5;:29::i;:::-;2513:92;;:::o;1691:214::-;1761:34;1766:8;:23;1783:4;1766:23;;;;;;;;;;;;;;;;1791:3;1761:4;:34::i;:::-;1735:8;:23;1752:4;1735:23;;;;;;;;;;;;;;;:60;;;;1820:23;1825:12;;1839:3;1820:4;:23::i;:::-;1805:12;:38;;;;1887:4;1858:40;;1875:1;1858:40;;;1894:3;1858:40;;;;;;;;;;;;;;;;;;1691:214;:::o;832:111:5:-;895:4;765:6:3;922:7:5;927:1;922:4;:7::i;:::-;:14;915:21;;832:111;;;:::o;722:104::-;784:4;765:6:3;811:1:5;:8;;;;;;804:15;;722:104;;;:::o;2257:320::-;2327:4;2347:6;2356:1;2347:10;;2367:6;2385:1;2380;2376;:5;;;;;;:10;;:21;;765:6:3;2376:21:5;;;2389:1;2376:21;2367:30;;2418:1;2413:6;;;;;;;;;2408:145;2426:1;2421;:6;2408:145;;2455:10;2460:1;2463;2455:4;:10::i;:::-;2451:14;;2493:1;2488;2484;:5;;;;;;:10;2480:63;;2518:10;2523:1;2526;2518:4;:10::i;:::-;2514:14;;2480:63;2434:1;2429:6;;;;;;;;;2408:145;;;2569:1;2562:8;;;;2257:320;;;;:::o;3276:1047::-;3372:4;3411:6;3424:3;3411:16;;3438:6;3446:9;3460:20;3469:4;765:6:3;3460:8:5;:20::i;:::-;3437:43;;;;3490:9;765:6:3;3490:16:5;;3516:8;3529:4;3516:17;;3543:13;3559:5;3543:21;;3806:6;3815:1;3806:10;;3801:495;3826:9;3818:4;:17;3801:495;;3856:9;765:6:3;3868:1:5;:8;3856:20;;3891:6;3899:9;3912:29;3921:1;3924:16;3929:4;765:6:3;3924:4:5;:16::i;:::-;3912:8;:29::i;:::-;3890:51;;;;3962:22;3967:4;3973:10;3978:1;3981;3973:4;:10::i;:::-;3962:4;:22::i;:::-;3955:29;;4005:16;4010:4;4016;4005;:16::i;:::-;3998:23;;4047:1;4039:4;:9;4035:20;;;4050:5;;;;;4035:20;4074:4;4070:30;;;4092:8;4091:9;4080:20;;4070:30;4118:4;4114:30;;;4136:8;4135:9;4124:20;;4114:30;4162:8;4158:128;;;4196:15;4201:3;4206:4;4196;:15::i;:::-;4190:21;;4158:128;;;4256:15;4261:3;4266:4;4256;:15::i;:::-;4250:21;;4158:128;3801:495;;;3837:3;;;;;;;3801:495;;;;4313:3;4306:10;;;;;;;;3276:1047;;;;;:::o", + "source": "pragma solidity ^0.5.7;\n// Copyright BigchainDB GmbH and Ocean Protocol contributors\n// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)\n// Code is Apache-2.0 and docs are CC-BY-4.0\n\nimport './BToken.sol';\nimport './BMath.sol';\n\n/**\n* @title SPool\n* \n* @dev Used by the (Ocean version) SFactory contract as a bytecode reference to \n* deploy new SPools.\n*\n* This contract is is nearly identical to the BPool.sol contract at [1]\n* The only difference is the \"Proxy contract functionality\" section \n* given below. We'd inherit from BPool if we could, for simplicity.\n* But we can't, because the proxy section needs to access private\n* variables declared in BPool, and Solidity disallows this. Therefore\n* the best we can do for now is clearly demarcate the proxy section. \n*\n* [1] https://github.com/balancer-labs/balancer-core/contracts/.\n*/\ncontract SPool 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(\n !_mutex, \n 'ERR_REENTRY'\n );\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; // SFactory 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 //-----------------------------------------------------------------------\n //Proxy contract functionality: begin\n bool private initialized = false; \n modifier onlyNotInitialized() {\n require(\n !initialized, \n 'ERR_ALREADY_INITIALIZED'\n );\n _;\n }\n function isInitialized() public view returns(bool) {\n return initialized;\n }\n \n // Called prior to contract deployment\n constructor() public {\n _initialize(msg.sender, msg.sender, MIN_FEE, false, false);\n }\n \n // Called prior to contract initialization (e.g creating new SPool instance)\n // Calls private _initialize function. Only if contract is not initialized.\n function initialize(\n address controller, \n address factory, \n uint swapFee,\n bool publicSwap,\n bool finalized\n )\n public\n onlyNotInitialized\n returns(bool)\n {\n return _initialize(controller, factory, swapFee, publicSwap, finalized);\n }\n\t\n // Private function called on contract initialization.\n function _initialize(\n address controller, \n address factory, \n uint swapFee,\n bool publicSwap, \n bool finalized\n )\n private\n returns(bool)\n {\n _controller = controller;\n _factory = factory;\n _swapFee = swapFee;\n _publicSwap = publicSwap;\n _finalized = finalized;\n\t\n initialized = true;\n return initialized;\n }\n \n //Proxy contract functionality: end\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\t\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,\n // 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(\n inRecord.balance, \n inRecord.denorm, \n outRecord.balance, \n outRecord.denorm, \n _swapFee\n );\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(\n inRecord.balance, \n inRecord.denorm, \n outRecord.balance, \n outRecord.denorm, \n 0\n );\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(\n tokenAmountIn <= bmul(inRecord.balance, MAX_IN_RATIO), \n 'ERR_MAX_IN_RATIO'\n );\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(\n spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut), \n 'ERR_MATH_APPROX'\n );\n\n emit LOG_SWAP(\n msg.sender, \n tokenIn, \n tokenOut, \n tokenAmountIn, \n tokenAmountOut\n );\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(\n tokenAmountOut <= bmul(outRecord.balance, MAX_OUT_RATIO), \n 'ERR_MAX_OUT_RATIO'\n );\n\n uint spotPriceBefore = calcSpotPrice(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n _swapFee\n );\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(\n spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut), \n 'ERR_MATH_APPROX'\n );\n\n emit LOG_SWAP(\n msg.sender, \n tokenIn, \n tokenOut, \n tokenAmountIn, \n tokenAmountOut\n );\n\n _pullUnderlying(tokenIn, msg.sender, tokenAmountIn);\n _pushUnderlying(tokenOut, msg.sender, tokenAmountOut);\n\n return (tokenAmountIn, spotPriceAfter);\n }\n\n\n function joinswapExternAmountIn(\n address tokenIn, \n uint tokenAmountIn, \n uint minPoolAmountOut\n )\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(\n tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO), \n 'ERR_MAX_IN_RATIO'\n );\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(\n address tokenIn, \n uint poolAmountOut, \n uint maxAmountIn\n )\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(\n tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO), \n 'ERR_MAX_IN_RATIO'\n );\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(\n address tokenOut, \n uint poolAmountIn, \n uint minAmountOut\n )\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(\n tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO), \n 'ERR_MAX_OUT_RATIO'\n );\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(\n address tokenOut, \n uint tokenAmountOut, \n uint maxPoolAmountIn\n )\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(\n tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO), \n 'ERR_MAX_OUT_RATIO'\n );\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": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol", + "ast": { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol", + "exportedSymbols": { + "SPool": [ + 4307 + ] + }, + "id": 4308, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2063, + "literals": [ + "solidity", + "^", + "0.5", + ".7" + ], + "nodeType": "PragmaDirective", + "src": "0:23:8" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BToken.sol", + "file": "./BToken.sol", + "id": 2064, + "nodeType": "ImportDirective", + "scope": 4308, + "sourceUnit": 1929, + "src": "186:22:8", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BMath.sol", + "file": "./BMath.sol", + "id": 2065, + "nodeType": "ImportDirective", + "scope": 4308, + "sourceUnit": 879, + "src": "209:21:8", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2066, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 219, + "src": "873:7:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$219", + "typeString": "contract BBronze" + } + }, + "id": 2067, + "nodeType": "InheritanceSpecifier", + "src": "873:7:8" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2068, + "name": "BToken", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1928, + "src": "882:6:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BToken_$1928", + "typeString": "contract BToken" + } + }, + "id": 2069, + "nodeType": "InheritanceSpecifier", + "src": "882:6:8" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2070, + "name": "BMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 878, + "src": "890:5:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BMath_$878", + "typeString": "contract BMath" + } + }, + "id": 2071, + "nodeType": "InheritanceSpecifier", + "src": "890:5:8" + } + ], + "contractDependencies": [ + 206, + 219, + 307, + 878, + 1355, + 1425, + 1622, + 1928 + ], + "contractKind": "contract", + "documentation": "@title SPool\n \n@dev Used by the (Ocean version) SFactory contract as a bytecode reference to \n deploy new SPools.\n* This contract is is nearly identical to the BPool.sol contract at [1]\n The only difference is the \"Proxy contract functionality\" section \n given below. We'd inherit from BPool if we could, for simplicity.\n But we can't, because the proxy section needs to access private\n variables declared in BPool, and Solidity disallows this. Therefore\n the best we can do for now is clearly demarcate the proxy section. \n* [1] https://github.com/balancer-labs/balancer-core/contracts/.", + "fullyImplemented": true, + "id": 4307, + "linearizedBaseContracts": [ + 4307, + 878, + 1928, + 1425, + 1622, + 1355, + 307, + 219, + 206 + ], + "name": "SPool", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "SPool.Record", + "id": 2080, + "members": [ + { + "constant": false, + "id": 2073, + "name": "bound", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "927:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2072, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "927:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2075, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "975:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2074, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "975:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2077, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "1008:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2076, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1008:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2079, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "1053:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2078, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1053:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Record", + "nodeType": "StructDefinition", + "scope": 4307, + "src": "903:169:8", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 2092, + "name": "LOG_SWAP", + "nodeType": "EventDefinition", + "parameters": { + "id": 2091, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2082, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1102:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2081, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1102:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2084, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1134:23:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2083, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1134:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2086, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1167:24:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2085, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1167:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2088, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1201:29:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2087, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1201:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2090, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1240:30:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2089, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1240:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1092:184:8" + }, + "src": "1078:199:8" + }, + { + "anonymous": false, + "documentation": null, + "id": 2100, + "name": "LOG_JOIN", + "nodeType": "EventDefinition", + "parameters": { + "id": 2099, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2094, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1307:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2093, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1307:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2096, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1339:23:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1339:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2098, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1372:29:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2097, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1297:110:8" + }, + "src": "1283:125:8" + }, + { + "anonymous": false, + "documentation": null, + "id": 2108, + "name": "LOG_EXIT", + "nodeType": "EventDefinition", + "parameters": { + "id": 2107, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2102, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1438:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1438:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2104, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1470:24:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2103, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1470:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2106, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1504:30:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2105, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1504:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1428:112:8" + }, + "src": "1414:127:8" + }, + { + "anonymous": true, + "documentation": null, + "id": 2116, + "name": "LOG_CALL", + "nodeType": "EventDefinition", + "parameters": { + "id": 2115, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2110, + "indexed": true, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1571:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 2109, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "1571:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2112, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1600:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2111, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1600:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2114, + "indexed": false, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1632:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2113, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1632:5:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1561:97:8" + }, + "src": "1547:122:8" + }, + { + "body": { + "id": 2128, + "nodeType": "Block", + "src": "1693:72:8", + "statements": [ + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2119, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1717:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sig", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1717:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2121, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1726:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2122, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1726:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2123, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1738:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "data", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1738:8:8", + "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": 2118, + "name": "LOG_CALL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2116, + "src": "1708:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes4,address,bytes memory)" + } + }, + "id": 2125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1708:39:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2126, + "nodeType": "EmitStatement", + "src": "1703:44:8" + }, + { + "id": 2127, + "nodeType": "PlaceholderStatement", + "src": "1757:1:8" + } + ] + }, + "documentation": null, + "id": 2129, + "name": "_logs_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2117, + "nodeType": "ParameterList", + "parameters": [], + "src": "1690:2:8" + }, + "src": "1675:90:8", + "visibility": "internal" + }, + { + "body": { + "id": 2146, + "nodeType": "Block", + "src": "1789:141:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2133, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1820:7:8", + "subExpression": { + "argumentTypes": null, + "id": 2132, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1821:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 2134, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1842:13:8", + "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": 2131, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1799:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2135, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1799:66:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2136, + "nodeType": "ExpressionStatement", + "src": "1799:66:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2137, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1875:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2138, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1884:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1875:13:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2140, + "nodeType": "ExpressionStatement", + "src": "1875:13:8" + }, + { + "id": 2141, + "nodeType": "PlaceholderStatement", + "src": "1898:1:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2142, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1909:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2143, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1918:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1909:14:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2145, + "nodeType": "ExpressionStatement", + "src": "1909:14:8" + } + ] + }, + "documentation": null, + "id": 2147, + "name": "_lock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2130, + "nodeType": "ParameterList", + "parameters": [], + "src": "1786:2:8" + }, + "src": "1771:159:8", + "visibility": "internal" + }, + { + "body": { + "id": 2156, + "nodeType": "Block", + "src": "1958:59:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1976:7:8", + "subExpression": { + "argumentTypes": null, + "id": 2150, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1977:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 2152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1985:13:8", + "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": 2149, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1968:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1968:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2154, + "nodeType": "ExpressionStatement", + "src": "1968:31:8" + }, + { + "id": 2155, + "nodeType": "PlaceholderStatement", + "src": "2009:1:8" + } + ] + }, + "documentation": null, + "id": 2157, + "name": "_viewlock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2148, + "nodeType": "ParameterList", + "parameters": [], + "src": "1955:2:8" + }, + "src": "1936:81:8", + "visibility": "internal" + }, + { + "constant": false, + "id": 2159, + "name": "_mutex", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2027:19:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2158, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2027:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2161, + "name": "_factory", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2053:24:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2160, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2053:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2163, + "name": "_controller", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2131:27:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2162, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2131:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2165, + "name": "_publicSwap", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2184:24:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2164, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2184:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2167, + "name": "_swapFee", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2368:21:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2166, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2368:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2169, + "name": "_finalized", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2395:23:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2395:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2172, + "name": "_tokens", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2425:25:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2170, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2425:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2171, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2425:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2176, + "name": "_records", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2456:42:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record)" + }, + "typeName": { + "id": 2175, + "keyType": { + "id": 2173, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2464:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2456:24:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record)" + }, + "valueType": { + "contractScope": null, + "id": 2174, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "2473:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2178, + "name": "_totalWeight", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2504:25:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2177, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2504:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2181, + "name": "initialized", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2656:32:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2179, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2656:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2180, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2683:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "visibility": "private" + }, + { + "body": { + "id": 2190, + "nodeType": "Block", + "src": "2725:111:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "2756:12:8", + "subExpression": { + "argumentTypes": null, + "id": 2184, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "2757:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414c52454144595f494e495449414c495a4544", + "id": 2186, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2783:25:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1fb8797b66eca6c15df697c66cc4b5186be8e5c9588f384f789ecfab2607b249", + "typeString": "literal_string \"ERR_ALREADY_INITIALIZED\"" + }, + "value": "ERR_ALREADY_INITIALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1fb8797b66eca6c15df697c66cc4b5186be8e5c9588f384f789ecfab2607b249", + "typeString": "literal_string \"ERR_ALREADY_INITIALIZED\"" + } + ], + "id": 2183, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "2735:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2187, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2735:83:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2188, + "nodeType": "ExpressionStatement", + "src": "2735:83:8" + }, + { + "id": 2189, + "nodeType": "PlaceholderStatement", + "src": "2828:1:8" + } + ] + }, + "documentation": null, + "id": 2191, + "name": "onlyNotInitialized", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2182, + "nodeType": "ParameterList", + "parameters": [], + "src": "2722:2:8" + }, + "src": "2695:141:8", + "visibility": "internal" + }, + { + "body": { + "id": 2198, + "nodeType": "Block", + "src": "2892:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2196, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "2909:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2195, + "id": 2197, + "nodeType": "Return", + "src": "2902:18:8" + } + ] + }, + "documentation": null, + "id": 2199, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isInitialized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2192, + "nodeType": "ParameterList", + "parameters": [], + "src": "2863:2:8" + }, + "returnParameters": { + "id": 2195, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2194, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "2886:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2193, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2886:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2885:6:8" + }, + "scope": 4307, + "src": "2841:86:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2212, + "nodeType": "Block", + "src": "3001:75:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "3023:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3023:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2205, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "3035:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3035:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2207, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "3047:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3056:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2209, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3063:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2202, + "name": "_initialize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2281, + "src": "3011:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) returns (bool)" + } + }, + "id": 2210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:58:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2211, + "nodeType": "ExpressionStatement", + "src": "3011:58:8" + } + ] + }, + "documentation": null, + "id": 2213, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2200, + "nodeType": "ParameterList", + "parameters": [], + "src": "2991:2:8" + }, + "returnParameters": { + "id": 2201, + "nodeType": "ParameterList", + "parameters": [], + "src": "3001:0:8" + }, + "scope": 4307, + "src": "2980:96:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2238, + "nodeType": "Block", + "src": "3467:88:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2231, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2215, + "src": "3496:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2232, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2217, + "src": "3508:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2233, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2219, + "src": "3517:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2234, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2221, + "src": "3526:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 2235, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2223, + "src": "3538:9:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2230, + "name": "_initialize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2281, + "src": "3484:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) returns (bool)" + } + }, + "id": 2236, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3484:64:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2229, + "id": 2237, + "nodeType": "Return", + "src": "3477:71:8" + } + ] + }, + "documentation": null, + "id": 2239, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2226, + "modifierName": { + "argumentTypes": null, + "id": 2225, + "name": "onlyNotInitialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2191, + "src": "3422:18:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3422:18:8" + } + ], + "name": "initialize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2215, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3276:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2214, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3276:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2217, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3305:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2216, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3305:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2219, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3331:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2218, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3331:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2221, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3353:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2220, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3353:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2223, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3378:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2222, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3378:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3266:132:8" + }, + "returnParameters": { + "id": 2229, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2228, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3457:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2227, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3457:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3456:6:8" + }, + "scope": 4307, + "src": "3247:308:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2280, + "nodeType": "Block", + "src": "3817:221:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2254, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "3827:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2255, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2241, + "src": "3841:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3827:24:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2257, + "nodeType": "ExpressionStatement", + "src": "3827:24:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2258, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "3861:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2259, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2243, + "src": "3872:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3861:18:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2261, + "nodeType": "ExpressionStatement", + "src": "3861:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2262, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "3889:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2263, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2245, + "src": "3900:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3889:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2265, + "nodeType": "ExpressionStatement", + "src": "3889:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2266, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "3917:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2267, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2247, + "src": "3931:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3917:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2269, + "nodeType": "ExpressionStatement", + "src": "3917:24:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2270, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "3951:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2271, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2249, + "src": "3964:9:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3951:22:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2273, + "nodeType": "ExpressionStatement", + "src": "3951:22:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2274, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "3985:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3999:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3985:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2277, + "nodeType": "ExpressionStatement", + "src": "3985:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2278, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "4020:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2253, + "id": 2279, + "nodeType": "Return", + "src": "4013:18:8" + } + ] + }, + "documentation": null, + "id": 2281, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_initialize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2250, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2241, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3651:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2240, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3651:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2243, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3680:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2242, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3680:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2245, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3706:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2244, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3706:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2247, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3728:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2246, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3728:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2249, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3754:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2248, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3754:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3641:133:8" + }, + "returnParameters": { + "id": 2253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2252, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3807:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2251, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3807:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3806:6:8" + }, + "scope": 4307, + "src": "3621:417:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 2288, + "nodeType": "Block", + "src": "4240:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2286, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "4257:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2285, + "id": 2287, + "nodeType": "Return", + "src": "4250:18:8" + } + ] + }, + "documentation": null, + "id": 2289, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2282, + "nodeType": "ParameterList", + "parameters": [], + "src": "4188:2:8" + }, + "returnParameters": { + "id": 2285, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2284, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2289, + "src": "4230:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2283, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4230:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4229:6:8" + }, + "scope": 4307, + "src": "4167:108:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2296, + "nodeType": "Block", + "src": "4353:34:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2294, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "4370:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2293, + "id": 2295, + "nodeType": "Return", + "src": "4363:17:8" + } + ] + }, + "documentation": null, + "id": 2297, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isFinalized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2290, + "nodeType": "ParameterList", + "parameters": [], + "src": "4301:2:8" + }, + "returnParameters": { + "id": 2293, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2292, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2297, + "src": "4343:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2291, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4343:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4342:6:8" + }, + "scope": 4307, + "src": "4281:106:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2309, + "nodeType": "Block", + "src": "4470:41:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2304, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "4487:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2306, + "indexExpression": { + "argumentTypes": null, + "id": 2305, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2299, + "src": "4496:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4487:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2307, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "4487:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2303, + "id": 2308, + "nodeType": "Return", + "src": "4480:24:8" + } + ] + }, + "documentation": null, + "id": 2310, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBound", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2300, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2299, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2310, + "src": "4410:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2298, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4410:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4409:11:8" + }, + "returnParameters": { + "id": 2303, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2302, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2310, + "src": "4460:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2301, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4460:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4459:6:8" + }, + "scope": 4307, + "src": "4393:118:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2318, + "nodeType": "Block", + "src": "4591:38:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2315, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4608:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2316, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4608:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2314, + "id": 2317, + "nodeType": "Return", + "src": "4601:21:8" + } + ] + }, + "documentation": null, + "id": 2319, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNumTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2311, + "nodeType": "ParameterList", + "parameters": [], + "src": "4538:2:8" + }, + "returnParameters": { + "id": 2314, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2313, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2319, + "src": "4580:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2312, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4580:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4579:6:8" + }, + "scope": 4307, + "src": "4517:112:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2329, + "nodeType": "Block", + "src": "4742:31:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2327, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4759:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 2326, + "id": 2328, + "nodeType": "Return", + "src": "4752:14:8" + } + ] + }, + "documentation": null, + "id": 2330, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2322, + "modifierName": { + "argumentTypes": null, + "id": 2321, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "4685:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4685:10:8" + } + ], + "name": "getCurrentTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2320, + "nodeType": "ParameterList", + "parameters": [], + "src": "4660:2:8" + }, + "returnParameters": { + "id": 2326, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2325, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 2330, + "src": "4713:23:8", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2323, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4713:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2324, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4713:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:25:8" + }, + "scope": 4307, + "src": "4635:138:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2345, + "nodeType": "Block", + "src": "4892:81:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2339, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "4910:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2340, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4922:19:8", + "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": 2338, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "4902:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4902:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2342, + "nodeType": "ExpressionStatement", + "src": "4902:40:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2343, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4959:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 2337, + "id": 2344, + "nodeType": "Return", + "src": "4952:14:8" + } + ] + }, + "documentation": null, + "id": 2346, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2333, + "modifierName": { + "argumentTypes": null, + "id": 2332, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "4835:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4835:10:8" + } + ], + "name": "getFinalTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2331, + "nodeType": "ParameterList", + "parameters": [], + "src": "4802:2:8" + }, + "returnParameters": { + "id": 2337, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2336, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 2346, + "src": "4863:23:8", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2334, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4863:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2335, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4863:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4862:25:8" + }, + "scope": 4307, + "src": "4779:194:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2368, + "nodeType": "Block", + "src": "5093:104:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2356, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5112:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2358, + "indexExpression": { + "argumentTypes": null, + "id": 2357, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2348, + "src": "5121:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5112:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2359, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5112:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2360, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5135:15:8", + "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": 2355, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5104:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5104:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2362, + "nodeType": "ExpressionStatement", + "src": "5104:47:8" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2363, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5168:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2365, + "indexExpression": { + "argumentTypes": null, + "id": 2364, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2348, + "src": "5177:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5168:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2366, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "5168:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2354, + "id": 2367, + "nodeType": "Return", + "src": "5161:29:8" + } + ] + }, + "documentation": null, + "id": 2369, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2351, + "modifierName": { + "argumentTypes": null, + "id": 2350, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5055:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5055:10:8" + } + ], + "name": "getDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2349, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2348, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2369, + "src": "5010:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5010:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5009:15:8" + }, + "returnParameters": { + "id": 2354, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2353, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2369, + "src": "5083:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2352, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5083:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5082:6:8" + }, + "scope": 4307, + "src": "4979:218:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2378, + "nodeType": "Block", + "src": "5309:36:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2376, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "5326:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2375, + "id": 2377, + "nodeType": "Return", + "src": "5319:19:8" + } + ] + }, + "documentation": null, + "id": 2379, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2372, + "modifierName": { + "argumentTypes": null, + "id": 2371, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5271:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5271:10:8" + } + ], + "name": "getTotalDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2370, + "nodeType": "ParameterList", + "parameters": [], + "src": "5238:2:8" + }, + "returnParameters": { + "id": 2375, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2374, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2379, + "src": "5299:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2373, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5299:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5298:6:8" + }, + "scope": 4307, + "src": "5203:142:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2408, + "nodeType": "Block", + "src": "5463:154:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2389, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5482:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2391, + "indexExpression": { + "argumentTypes": null, + "id": 2390, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2381, + "src": "5491:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5482:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2392, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5482:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2393, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5505:15:8", + "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": 2388, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5474:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5474:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2395, + "nodeType": "ExpressionStatement", + "src": "5474:47:8" + }, + { + "assignments": [ + 2397 + ], + "declarations": [ + { + "constant": false, + "id": 2397, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2408, + "src": "5531:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2396, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5531:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2402, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2398, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5545:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2400, + "indexExpression": { + "argumentTypes": null, + "id": 2399, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2381, + "src": "5554:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5545:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2401, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "5545:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5531:36:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2404, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2397, + "src": "5589:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2405, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "5597:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2403, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "5584:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5584:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2387, + "id": 2407, + "nodeType": "Return", + "src": "5577:33:8" + } + ] + }, + "documentation": null, + "id": 2409, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2384, + "modifierName": { + "argumentTypes": null, + "id": 2383, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5425:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5425:10:8" + } + ], + "name": "getNormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2382, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2381, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2409, + "src": "5380:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2380, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5380:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5379:15:8" + }, + "returnParameters": { + "id": 2387, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2386, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2409, + "src": "5453:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2385, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5453:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5452:6:8" + }, + "scope": 4307, + "src": "5351:266:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2431, + "nodeType": "Block", + "src": "5726:105:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2419, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5745:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2421, + "indexExpression": { + "argumentTypes": null, + "id": 2420, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2411, + "src": "5754:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5745:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5745:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2423, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5768:15:8", + "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": 2418, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5737:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2424, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5737:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2425, + "nodeType": "ExpressionStatement", + "src": "5737:47:8" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2426, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5801:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2428, + "indexExpression": { + "argumentTypes": null, + "id": 2427, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2411, + "src": "5810:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5801:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2429, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "5801:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2417, + "id": 2430, + "nodeType": "Return", + "src": "5794:30:8" + } + ] + }, + "documentation": null, + "id": 2432, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2414, + "modifierName": { + "argumentTypes": null, + "id": 2413, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5688:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5688:10:8" + } + ], + "name": "getBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2412, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2411, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2432, + "src": "5643:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2410, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5643:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5642:15:8" + }, + "returnParameters": { + "id": 2417, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2416, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2432, + "src": "5716:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2415, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5716:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5715:6:8" + }, + "scope": 4307, + "src": "5623:208:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2441, + "nodeType": "Block", + "src": "5927:32:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2439, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "5944:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2438, + "id": 2440, + "nodeType": "Return", + "src": "5937:15:8" + } + ] + }, + "documentation": null, + "id": 2442, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2435, + "modifierName": { + "argumentTypes": null, + "id": 2434, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5889:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5889:10:8" + } + ], + "name": "getSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2433, + "nodeType": "ParameterList", + "parameters": [], + "src": "5856:2:8" + }, + "returnParameters": { + "id": 2438, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2437, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2442, + "src": "5917:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2436, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5917:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5916:6:8" + }, + "scope": 4307, + "src": "5837:122:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2451, + "nodeType": "Block", + "src": "6061:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2449, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6078:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 2448, + "id": 2450, + "nodeType": "Return", + "src": "6071:18:8" + } + ] + }, + "documentation": null, + "id": 2452, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2445, + "modifierName": { + "argumentTypes": null, + "id": 2444, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "6020:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6020:10:8" + } + ], + "name": "getController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2443, + "nodeType": "ParameterList", + "parameters": [], + "src": "5987:2:8" + }, + "returnParameters": { + "id": 2448, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2447, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2452, + "src": "6048:7:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2446, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6048:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6047:9:8" + }, + "scope": 4307, + "src": "5965:131:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2493, + "nodeType": "Block", + "src": "6187:256:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2463, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6206:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2462, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "6207:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6219:18:8", + "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": 2461, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6198:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2465, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6198:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2466, + "nodeType": "ExpressionStatement", + "src": "6198:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2468, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6256:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6256:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2470, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6270:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6256:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2472, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6283:20:8", + "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": 2467, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6248:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2473, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6248:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2474, + "nodeType": "ExpressionStatement", + "src": "6248:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2476, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6322:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2477, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "6333:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6322:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f464545", + "id": 2479, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6342:13:8", + "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": 2475, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6314:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6314:42:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2481, + "nodeType": "ExpressionStatement", + "src": "6314:42:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2483, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6374:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2484, + "name": "MAX_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 247, + "src": "6385:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6374:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f464545", + "id": 2486, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6394:13:8", + "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": 2482, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6366:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2487, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6366:42:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2488, + "nodeType": "ExpressionStatement", + "src": "6366:42:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2491, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2489, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "6418:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2490, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6429:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6418:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2492, + "nodeType": "ExpressionStatement", + "src": "6418:18:8" + } + ] + }, + "documentation": null, + "id": 2494, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2457, + "modifierName": { + "argumentTypes": null, + "id": 2456, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6161:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6161:6:8" + }, + { + "arguments": null, + "id": 2459, + "modifierName": { + "argumentTypes": null, + "id": 2458, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6176:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6176:6:8" + } + ], + "name": "setSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2455, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2454, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2494, + "src": "6122:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2453, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6122:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6121:14:8" + }, + "returnParameters": { + "id": 2460, + "nodeType": "ParameterList", + "parameters": [], + "src": "6187:0:8" + }, + "scope": 4307, + "src": "6102:341:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2515, + "nodeType": "Block", + "src": "6540:104:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2504, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6558:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6558:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2506, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6572:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6558:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6585:20:8", + "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": 2503, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6550:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6550:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2510, + "nodeType": "ExpressionStatement", + "src": "6550:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2511, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6616:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2512, + "name": "manager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2496, + "src": "6630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6616:21:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2514, + "nodeType": "ExpressionStatement", + "src": "6616:21:8" + } + ] + }, + "documentation": null, + "id": 2516, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2499, + "modifierName": { + "argumentTypes": null, + "id": 2498, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6514:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6514:6:8" + }, + { + "arguments": null, + "id": 2501, + "modifierName": { + "argumentTypes": null, + "id": 2500, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6529:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6529:6:8" + } + ], + "name": "setController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2497, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2496, + "name": "manager", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "6472:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2495, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6472:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6471:17:8" + }, + "returnParameters": { + "id": 2502, + "nodeType": "ParameterList", + "parameters": [], + "src": "6540:0:8" + }, + "scope": 4307, + "src": "6449:195:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2543, + "nodeType": "Block", + "src": "6739:154:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6757:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2526, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "6758:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6770:18:8", + "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": 2525, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6749:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2529, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6749:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2530, + "nodeType": "ExpressionStatement", + "src": "6749:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2532, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6807:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6807:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2534, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6821:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6807:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6834:20:8", + "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": 2531, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6799:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6799:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2538, + "nodeType": "ExpressionStatement", + "src": "6799:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2539, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "6865:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2540, + "name": "public_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2518, + "src": "6879:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6865:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2542, + "nodeType": "ExpressionStatement", + "src": "6865:21:8" + } + ] + }, + "documentation": null, + "id": 2544, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2521, + "modifierName": { + "argumentTypes": null, + "id": 2520, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6713:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6713:6:8" + }, + { + "arguments": null, + "id": 2523, + "modifierName": { + "argumentTypes": null, + "id": 2522, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6728:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6728:6:8" + } + ], + "name": "setPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2519, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2518, + "name": "public_", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "6674:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2517, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6674:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6673:14:8" + }, + "returnParameters": { + "id": 2524, + "nodeType": "ParameterList", + "parameters": [], + "src": "6739:0:8" + }, + "scope": 4307, + "src": "6651:242:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2591, + "nodeType": "Block", + "src": "6970:347:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2555, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2552, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6988:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2553, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6988:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2554, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "7002:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6988:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7015:20:8", + "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": 2551, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6980:7:8", + "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": "6980:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2558, + "nodeType": "ExpressionStatement", + "src": "6980:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7054:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2560, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7055:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2562, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7067:18:8", + "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": 2559, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7046:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2563, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7046:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2564, + "nodeType": "ExpressionStatement", + "src": "7046:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2569, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2566, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7104:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2567, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7104:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2568, + "name": "MIN_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 232, + "src": "7122:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7104:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f544f4b454e53", + "id": 2570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7140:16:8", + "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": 2565, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7096:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7096:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2572, + "nodeType": "ExpressionStatement", + "src": "7096:61:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2573, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7168:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7181:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "7168:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2576, + "nodeType": "ExpressionStatement", + "src": "7168:17:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2579, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2577, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "7195:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2578, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7209:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "7195:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2580, + "nodeType": "ExpressionStatement", + "src": "7195:18:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2582, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 275, + "src": "7239:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2581, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "7224:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2583, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7224:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2584, + "nodeType": "ExpressionStatement", + "src": "7224:32:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2586, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "7281:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2587, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7281:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2588, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 275, + "src": "7293:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2585, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "7266:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7266:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2590, + "nodeType": "ExpressionStatement", + "src": "7266:44:8" + } + ] + }, + "documentation": null, + "id": 2592, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2547, + "modifierName": { + "argumentTypes": null, + "id": 2546, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6944:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6944:6:8" + }, + { + "arguments": null, + "id": 2549, + "modifierName": { + "argumentTypes": null, + "id": 2548, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6959:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6959:6:8" + } + ], + "name": "finalize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2545, + "nodeType": "ParameterList", + "parameters": [], + "src": "6916:2:8" + }, + "returnParameters": { + "id": 2550, + "nodeType": "ParameterList", + "parameters": [], + "src": "6970:0:8" + }, + "scope": 4307, + "src": "6899:418:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2658, + "nodeType": "Block", + "src": "7495:551:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2607, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2604, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "7513:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7513:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2606, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "7527:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "7513:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2608, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7540:20:8", + "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": 2603, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7505:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2609, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7505:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2610, + "nodeType": "ExpressionStatement", + "src": "7505:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7579:22:8", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2612, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "7580:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2614, + "indexExpression": { + "argumentTypes": null, + "id": 2613, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7589:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7580:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2615, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "7580:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f424f554e44", + "id": 2617, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7603:14:8", + "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": 2611, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7571:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7571:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2619, + "nodeType": "ExpressionStatement", + "src": "7571:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7636:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2621, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7637:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2623, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7649:18:8", + "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": 2620, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7628:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2624, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7628:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2625, + "nodeType": "ExpressionStatement", + "src": "7628:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2627, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7687:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2628, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7687:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2629, + "name": "MAX_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "7704:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7687:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f4b454e53", + "id": 2631, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7722:16:8", + "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": 2626, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7679:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2632, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7679:60:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2633, + "nodeType": "ExpressionStatement", + "src": "7679:60:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2634, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "7750:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2636, + "indexExpression": { + "argumentTypes": null, + "id": 2635, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7759:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "7750:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2638, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7796:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2639, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7821:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2640, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7821:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2641, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7857:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2642, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7933:1:8", + "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": 2637, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2080, + "src": "7768:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$2080_storage_ptr_$", + "typeString": "type(struct SPool.Record storage pointer)" + } + }, + "id": 2643, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "7768:202:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_memory", + "typeString": "struct SPool.Record memory" + } + }, + "src": "7750:220:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2645, + "nodeType": "ExpressionStatement", + "src": "7750:220:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2649, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7993:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 2646, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7980:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2648, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7980:12:8", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 2650, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7980:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2651, + "nodeType": "ExpressionStatement", + "src": "7980:19:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2653, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "8016:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2654, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2596, + "src": "8023:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2655, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2598, + "src": "8032:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2652, + "name": "rebind", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2831, + "src": "8009:6:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 2656, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8009:30:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2657, + "nodeType": "ExpressionStatement", + "src": "8009:30:8" + } + ] + }, + "documentation": null, + "id": 2659, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2601, + "modifierName": { + "argumentTypes": null, + "id": 2600, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "7405:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7405:6:8" + } + ], + "name": "bind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2599, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2594, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7338:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2593, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7338:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2596, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7353:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2595, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7353:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2598, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7367:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2597, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7367:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7337:42:8" + }, + "returnParameters": { + "id": 2602, + "nodeType": "ParameterList", + "parameters": [], + "src": "7495:0:8" + }, + "scope": 4307, + "src": "7324:722:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2830, + "nodeType": "Block", + "src": "8159:1496:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2676, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2673, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "8178:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8178:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2675, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "8192:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8178:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8205:20:8", + "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": 2672, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8170:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8170:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2679, + "nodeType": "ExpressionStatement", + "src": "8170:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2681, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8244:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2683, + "indexExpression": { + "argumentTypes": null, + "id": 2682, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8253:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8244:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2684, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "8244:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2685, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8267:15:8", + "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": 2680, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8236:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2686, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8236:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2687, + "nodeType": "ExpressionStatement", + "src": "8236:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8301:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2689, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "8302:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2691, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8314:18:8", + "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": 2688, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8293:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8293:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2693, + "nodeType": "ExpressionStatement", + "src": "8293:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2697, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2695, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8352:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2696, + "name": "MIN_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 253, + "src": "8362:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8352:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f574549474854", + "id": 2698, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8374:16:8", + "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": 2694, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8344:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8344:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2700, + "nodeType": "ExpressionStatement", + "src": "8344:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2704, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2702, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8409:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2703, + "name": "MAX_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "8419:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8409:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f574549474854", + "id": 2705, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8431:16:8", + "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": 2701, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8401:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8401:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2707, + "nodeType": "ExpressionStatement", + "src": "8401:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2709, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "8466:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2710, + "name": "MIN_BALANCE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 270, + "src": "8477:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8466:22:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f42414c414e4345", + "id": 2712, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8490:17:8", + "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": 2708, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8458:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2713, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8458:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2714, + "nodeType": "ExpressionStatement", + "src": "8458:50:8" + }, + { + "assignments": [ + 2716 + ], + "declarations": [ + { + "constant": false, + "id": 2716, + "name": "oldWeight", + "nodeType": "VariableDeclaration", + "scope": 2830, + "src": "8564:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2715, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8564:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2721, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2717, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8581:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2719, + "indexExpression": { + "argumentTypes": null, + "id": 2718, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8590:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8581:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2720, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "8581:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8564:39:8" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2722, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8617:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 2723, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8626:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8617:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2743, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8809:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2744, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8818:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8809:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 2757, + "nodeType": "IfStatement", + "src": "8805:107:8", + "trueBody": { + "id": 2756, + "nodeType": "Block", + "src": "8829:83:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2746, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8843:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2748, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8863:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2750, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8882:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2751, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8893:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2749, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8877:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2752, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8877:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2747, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8858:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8858:43:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8843:58:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2755, + "nodeType": "ExpressionStatement", + "src": "8843:58:8" + } + ] + } + }, + "id": 2758, + "nodeType": "IfStatement", + "src": "8613:299:8", + "trueBody": { + "id": 2742, + "nodeType": "Block", + "src": "8637:162:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2725, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8651:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2727, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8671:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2729, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8690:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2730, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8698:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2728, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8685:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8685:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2726, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "8666:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8666:43:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8651:58:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2734, + "nodeType": "ExpressionStatement", + "src": "8651:58:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2736, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8731:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2737, + "name": "MAX_TOTAL_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "8747:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8731:32:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f54414c5f574549474854", + "id": 2739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8765:22:8", + "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": 2735, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8723:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8723:65:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2741, + "nodeType": "ExpressionStatement", + "src": "8723:65:8" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 2764, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2759, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8929:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2761, + "indexExpression": { + "argumentTypes": null, + "id": 2760, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8938:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8929:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2762, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "8929:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2763, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8954:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8929:31:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2765, + "nodeType": "ExpressionStatement", + "src": "8929:31:8" + }, + { + "assignments": [ + 2767 + ], + "declarations": [ + { + "constant": false, + "id": 2767, + "name": "oldBalance", + "nodeType": "VariableDeclaration", + "scope": 2830, + "src": "9033:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2766, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9033:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2772, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2768, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9051:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2770, + "indexExpression": { + "argumentTypes": null, + "id": 2769, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9060:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9051:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2771, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9051:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9033:41:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2778, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2773, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9084:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2775, + "indexExpression": { + "argumentTypes": null, + "id": 2774, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9093:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9084:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2776, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9084:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2777, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9110:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9084:33:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2779, + "nodeType": "ExpressionStatement", + "src": "9084:33:8" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2780, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9131:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 2781, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9141:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9131:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2794, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9249:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2795, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9259:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9249:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 2828, + "nodeType": "IfStatement", + "src": "9245:404:8", + "trueBody": { + "id": 2827, + "nodeType": "Block", + "src": "9271:378:8", + "statements": [ + { + "assignments": [ + 2798 + ], + "declarations": [ + { + "constant": false, + "id": 2798, + "name": "tokenBalanceWithdrawn", + "nodeType": "VariableDeclaration", + "scope": 2827, + "src": "9362:26:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2797, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9362:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2803, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2800, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9396:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2801, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9408:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2799, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9391:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9391:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9362:54:8" + }, + { + "assignments": [ + 2805 + ], + "declarations": [ + { + "constant": false, + "id": 2805, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2827, + "src": "9430:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2804, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9430:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2810, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2807, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2798, + "src": "9455:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2808, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "9478:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2806, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "9450:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9450:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9430:57:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2812, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9517:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2813, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9524:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9524:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2816, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2798, + "src": "9541:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2817, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2805, + "src": "9564:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2815, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9536:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9536:41:8", + "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": 2811, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "9501:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9501:77:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2820, + "nodeType": "ExpressionStatement", + "src": "9501:77:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2822, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9608:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2823, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "9615:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2824, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2805, + "src": "9625:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2821, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "9592:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9592:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2826, + "nodeType": "ExpressionStatement", + "src": "9592:46:8" + } + ] + } + }, + "id": 2829, + "nodeType": "IfStatement", + "src": "9127:522:8", + "trueBody": { + "id": 2793, + "nodeType": "Block", + "src": "9153:86:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2784, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9183:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2785, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9190:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2786, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9190:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2788, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9207:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2789, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9216:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2787, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9202:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9202:25:8", + "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": 2783, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "9167:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9167:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2792, + "nodeType": "ExpressionStatement", + "src": "9167:61:8" + } + ] + } + } + ] + }, + "documentation": null, + "id": 2831, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2668, + "modifierName": { + "argumentTypes": null, + "id": 2667, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "8133:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8133:6:8" + }, + { + "arguments": null, + "id": 2670, + "modifierName": { + "argumentTypes": null, + "id": 2669, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "8148:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8148:6:8" + } + ], + "name": "rebind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2666, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2661, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8068:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2660, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8068:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2663, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8083:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2662, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8083:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2665, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8097:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2664, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8097:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8067:42:8" + }, + "returnParameters": { + "id": 2671, + "nodeType": "ParameterList", + "parameters": [], + "src": "8159:0:8" + }, + "scope": 4307, + "src": "8052:1603:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2949, + "nodeType": "Block", + "src": "9743:928:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2841, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9762:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9762:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2843, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "9776:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "9762:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2845, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9789:20:8", + "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": 2840, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9754:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9754:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2847, + "nodeType": "ExpressionStatement", + "src": "9754:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2849, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9828:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2851, + "indexExpression": { + "argumentTypes": null, + "id": 2850, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "9837:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9828:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2852, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "9828:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9851:15:8", + "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": 2848, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9820:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9820:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2855, + "nodeType": "ExpressionStatement", + "src": "9820:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "9885:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2857, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "9886:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2859, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9898:18:8", + "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": 2856, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9877:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9877:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2861, + "nodeType": "ExpressionStatement", + "src": "9877:40:8" + }, + { + "assignments": [ + 2863 + ], + "declarations": [ + { + "constant": false, + "id": 2863, + "name": "tokenBalance", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "9928:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2862, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9928:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2868, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2864, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9948:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2866, + "indexExpression": { + "argumentTypes": null, + "id": 2865, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "9957:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9948:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2867, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9948:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9928:43:8" + }, + { + "assignments": [ + 2870 + ], + "declarations": [ + { + "constant": false, + "id": 2870, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "9981:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2869, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9981:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2875, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2872, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2863, + "src": "10006:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2873, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "10020:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2871, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "10001:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2874, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10001:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9981:48:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2876, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "10040:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2878, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "10060:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2879, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10074:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2881, + "indexExpression": { + "argumentTypes": null, + "id": 2880, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10083:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10074:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2882, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "10074:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2877, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "10055:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10055:42:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10040:57:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2885, + "nodeType": "ExpressionStatement", + "src": "10040:57:8" + }, + { + "assignments": [ + 2887 + ], + "declarations": [ + { + "constant": false, + "id": 2887, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "10203:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2886, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10203:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2892, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2888, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10216:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2890, + "indexExpression": { + "argumentTypes": null, + "id": 2889, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10225:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10216:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2891, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 2075, + "src": "10216:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10203:34:8" + }, + { + "assignments": [ + 2894 + ], + "declarations": [ + { + "constant": false, + "id": 2894, + "name": "last", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "10247:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2893, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10247:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2899, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2895, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10259:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2896, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10259:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 2897, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10276:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "10259:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10247:30:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2900, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10287:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2902, + "indexExpression": { + "argumentTypes": null, + "id": 2901, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10295:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10287:14:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2903, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10304:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2905, + "indexExpression": { + "argumentTypes": null, + "id": 2904, + "name": "last", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2894, + "src": "10312:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10304:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10287:30:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2907, + "nodeType": "ExpressionStatement", + "src": "10287:30:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2908, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10327:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2912, + "indexExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2909, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10336:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2911, + "indexExpression": { + "argumentTypes": null, + "id": 2910, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10344:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10336:14:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10327:24:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2913, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 2075, + "src": "10327:30:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2914, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10360:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10327:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2916, + "nodeType": "ExpressionStatement", + "src": "10327:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2917, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10375:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2919, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "pop", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10375:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypop_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 2920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10375:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2921, + "nodeType": "ExpressionStatement", + "src": "10375:13:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2931, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2922, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10398:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2924, + "indexExpression": { + "argumentTypes": null, + "id": 2923, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10407:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10398:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2926, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10444:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2927, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10470:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2928, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10493:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2929, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10517:1:8", + "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": 2925, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2080, + "src": "10416:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$2080_storage_ptr_$", + "typeString": "type(struct SPool.Record storage pointer)" + } + }, + "id": 2930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "10416:113:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_memory", + "typeString": "struct SPool.Record memory" + } + }, + "src": "10398:131:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2932, + "nodeType": "ExpressionStatement", + "src": "10398:131:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2934, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10556:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2935, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "10563:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10563:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2938, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2863, + "src": "10580:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2939, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2870, + "src": "10594:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2937, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "10575:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2940, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10575:32:8", + "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": 2933, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "10540:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10540:68:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2942, + "nodeType": "ExpressionStatement", + "src": "10540:68:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2944, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10634:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2945, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "10641:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2946, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2870, + "src": "10651:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2943, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "10618:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10618:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2948, + "nodeType": "ExpressionStatement", + "src": "10618:46:8" + } + ] + }, + "documentation": null, + "id": 2950, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2836, + "modifierName": { + "argumentTypes": null, + "id": 2835, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "9717:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9717:6:8" + }, + { + "arguments": null, + "id": 2838, + "modifierName": { + "argumentTypes": null, + "id": 2837, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "9732:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9732:6:8" + } + ], + "name": "unbind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2834, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2833, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2950, + "src": "9677:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2832, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9677:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9676:15:8" + }, + "returnParameters": { + "id": 2839, + "nodeType": "ParameterList", + "parameters": [], + "src": "9743:0:8" + }, + "scope": 4307, + "src": "9661:1010:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2981, + "nodeType": "Block", + "src": "10833:138:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2960, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10851:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2962, + "indexExpression": { + "argumentTypes": null, + "id": 2961, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10860:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10851:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "10851:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10874:15:8", + "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": 2959, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "10843:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2965, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10843:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2966, + "nodeType": "ExpressionStatement", + "src": "10843:47:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2979, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2967, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10900:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2969, + "indexExpression": { + "argumentTypes": null, + "id": 2968, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10909:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10900:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2970, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "10900:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2976, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5675, + "src": "10958:4:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + ], + "id": 2975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10950:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10950:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2972, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10933:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2971, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "10926:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 2973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10926:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 2974, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 1386, + "src": "10926:23:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 2978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10926:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10900:64:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2980, + "nodeType": "ExpressionStatement", + "src": "10900:64:8" + } + ] + }, + "documentation": null, + "id": 2982, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2955, + "modifierName": { + "argumentTypes": null, + "id": 2954, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "10807:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10807:6:8" + }, + { + "arguments": null, + "id": 2957, + "modifierName": { + "argumentTypes": null, + "id": 2956, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "10822:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10822:6:8" + } + ], + "name": "gulp", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2953, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2952, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2982, + "src": "10767:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2951, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10767:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10766:15:8" + }, + "returnParameters": { + "id": 2958, + "nodeType": "ParameterList", + "parameters": [], + "src": "10833:0:8" + }, + "scope": 4307, + "src": "10753:218:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3033, + "nodeType": "Block", + "src": "11112:420:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2994, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11130:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2996, + "indexExpression": { + "argumentTypes": null, + "id": 2995, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2984, + "src": "11139:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11130:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2997, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11130:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11155:15:8", + "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": 2993, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11122:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11122:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3000, + "nodeType": "ExpressionStatement", + "src": "11122:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3002, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11189:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3004, + "indexExpression": { + "argumentTypes": null, + "id": 3003, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2986, + "src": "11198:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11189:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3005, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11189:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3006, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11215:15:8", + "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": 3001, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11181:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11181:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3008, + "nodeType": "ExpressionStatement", + "src": "11181:50:8" + }, + { + "assignments": [ + 3010 + ], + "declarations": [ + { + "constant": false, + "id": 3010, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3033, + "src": "11241:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3009, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11241:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3014, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3011, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11267:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3013, + "indexExpression": { + "argumentTypes": null, + "id": 3012, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2984, + "src": "11276:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11267:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11241:43:8" + }, + { + "assignments": [ + 3016 + ], + "declarations": [ + { + "constant": false, + "id": 3016, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3033, + "src": "11294:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3015, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11294:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3020, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3017, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11321:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3019, + "indexExpression": { + "argumentTypes": null, + "id": 3018, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2986, + "src": "11330:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11321:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11294:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3022, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3010, + "src": "11383:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3023, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11383:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3024, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3010, + "src": "11414:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3025, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11414:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3026, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3016, + "src": "11444:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3027, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11444:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3028, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3016, + "src": "11476:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3029, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11476:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3030, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "11507:8:8", + "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": 3021, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "11356:13:8", + "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": 3031, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11356:169:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2992, + "id": 3032, + "nodeType": "Return", + "src": "11349:176:8" + } + ] + }, + "documentation": null, + "id": 3034, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2989, + "modifierName": { + "argumentTypes": null, + "id": 2988, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "11064:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11064:10:8" + } + ], + "name": "getSpotPrice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2987, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2984, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "10999:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2983, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10999:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2986, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "11016:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2985, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11016:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10998:35:8" + }, + "returnParameters": { + "id": 2992, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2991, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "11092:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2990, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11092:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11091:16:8" + }, + "scope": 4307, + "src": "10977:555:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3085, + "nodeType": "Block", + "src": "11680:413:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3046, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11698:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3048, + "indexExpression": { + "argumentTypes": null, + "id": 3047, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3036, + "src": "11707:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11698:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3049, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11698:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3050, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11723:15:8", + "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": 3045, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11690:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11690:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3052, + "nodeType": "ExpressionStatement", + "src": "11690:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3054, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11757:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3056, + "indexExpression": { + "argumentTypes": null, + "id": 3055, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3038, + "src": "11766:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11757:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11757:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3058, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11783:15:8", + "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": 3053, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11749:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3059, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11749:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3060, + "nodeType": "ExpressionStatement", + "src": "11749:50:8" + }, + { + "assignments": [ + 3062 + ], + "declarations": [ + { + "constant": false, + "id": 3062, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3085, + "src": "11809:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3061, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11809:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3066, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3063, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11835:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3065, + "indexExpression": { + "argumentTypes": null, + "id": 3064, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3036, + "src": "11844:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11835:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11809:43:8" + }, + { + "assignments": [ + 3068 + ], + "declarations": [ + { + "constant": false, + "id": 3068, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3085, + "src": "11862:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3067, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11862:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3072, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3069, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11889:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3071, + "indexExpression": { + "argumentTypes": null, + "id": 3070, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3038, + "src": "11898:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11889:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11862:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3074, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3062, + "src": "11951:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3075, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11951:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3076, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3062, + "src": "11982:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3077, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11982:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3078, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3068, + "src": "12012:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3079, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12012:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3080, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3068, + "src": "12044:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3081, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "12044:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 3082, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12075:1:8", + "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": 3073, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "11924:13:8", + "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": 3083, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11924:162:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3044, + "id": 3084, + "nodeType": "Return", + "src": "11917:169:8" + } + ] + }, + "documentation": null, + "id": 3086, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3041, + "modifierName": { + "argumentTypes": null, + "id": 3040, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "11632:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11632:10:8" + } + ], + "name": "getSpotPriceSansFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3039, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3036, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11567:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3035, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11567:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3038, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11584:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3037, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11584:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11566:35:8" + }, + "returnParameters": { + "id": 3044, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3043, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11660:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3042, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11660:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11659:16:8" + }, + "scope": 4307, + "src": "11538:555:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3208, + "nodeType": "Block", + "src": "12218:806:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3099, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "12236:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12248:19:8", + "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": 3098, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12228:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12228:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3102, + "nodeType": "ExpressionStatement", + "src": "12228:40:8" + }, + { + "assignments": [ + 3104 + ], + "declarations": [ + { + "constant": false, + "id": 3104, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 3208, + "src": "12279:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3103, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12279:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3107, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 3105, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1695, + "src": "12296:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 3106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12296:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12279:30:8" + }, + { + "assignments": [ + 3109 + ], + "declarations": [ + { + "constant": false, + "id": 3109, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 3208, + "src": "12319:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3108, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12319:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3114, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3111, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "12337:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3112, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3104, + "src": "12352:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3110, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "12332:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12332:30:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12319:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3116, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3109, + "src": "12380:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12389:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12380:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3119, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12392:17:8", + "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": 3115, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12372:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3121, + "nodeType": "ExpressionStatement", + "src": "12372:38:8" + }, + { + "body": { + "id": 3196, + "nodeType": "Block", + "src": "12463:465:8", + "statements": [ + { + "assignments": [ + 3134 + ], + "declarations": [ + { + "constant": false, + "id": 3134, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12477:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3133, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12477:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3138, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3135, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "12489:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3137, + "indexExpression": { + "argumentTypes": null, + "id": 3136, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12497:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12489:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12477:22:8" + }, + { + "assignments": [ + 3140 + ], + "declarations": [ + { + "constant": false, + "id": 3140, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12513:8:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3139, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12513:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3145, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3141, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12524:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3143, + "indexExpression": { + "argumentTypes": null, + "id": 3142, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12533:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12524:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3144, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12524:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12513:30:8" + }, + { + "assignments": [ + 3147 + ], + "declarations": [ + { + "constant": false, + "id": 3147, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12557:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3146, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12557:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3152, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3149, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3109, + "src": "12583:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3150, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3140, + "src": "12590:3:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3148, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "12578:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12578:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12557:37:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3154, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12616:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12633:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12616:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12636:17:8", + "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": 3153, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12608:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12608:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3159, + "nodeType": "ExpressionStatement", + "src": "12608:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3161, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12676:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3162, + "name": "maxAmountsIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3091, + "src": "12693:12:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 3164, + "indexExpression": { + "argumentTypes": null, + "id": 3163, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12706:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12693:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12676:32:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12710:14:8", + "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": 3160, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12668:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12668:57:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3168, + "nodeType": "ExpressionStatement", + "src": "12668:57:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3169, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12739:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3171, + "indexExpression": { + "argumentTypes": null, + "id": 3170, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12748:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12739:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3172, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12739:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3174, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12766:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3176, + "indexExpression": { + "argumentTypes": null, + "id": 3175, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12775:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12766:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3177, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12766:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3178, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12787:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3173, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "12761:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12761:40:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12739:62:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3181, + "nodeType": "ExpressionStatement", + "src": "12739:62:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3183, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12829:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3184, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12829:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3185, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12841:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3186, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12844:13:8", + "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": 3182, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "12820:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3187, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12820:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3188, + "nodeType": "EmitStatement", + "src": "12815:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3190, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12888:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3191, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12891:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12891:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3193, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12903:13:8", + "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": 3189, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "12872:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12872:45:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3195, + "nodeType": "ExpressionStatement", + "src": "12872:45:8" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3126, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12438:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3127, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "12442:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3128, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12442:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12438:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 3197, + "initializationExpression": { + "assignments": [ + 3123 + ], + "declarations": [ + { + "constant": false, + "id": 3123, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 3197, + "src": "12426:6:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3122, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12426:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3125, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 3124, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12435:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12426:10:8" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 3131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12458:3:8", + "subExpression": { + "argumentTypes": null, + "id": 3130, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12458:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3132, + "nodeType": "ExpressionStatement", + "src": "12458:3:8" + }, + "nodeType": "ForStatement", + "src": "12421:507:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3199, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "12952:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3198, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "12937:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12937:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3201, + "nodeType": "ExpressionStatement", + "src": "12937:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12991:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12991:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3205, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "13003:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3202, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "12976:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12976:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3207, + "nodeType": "ExpressionStatement", + "src": "12976:41:8" + } + ] + }, + "documentation": null, + "id": 3209, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3094, + "modifierName": { + "argumentTypes": null, + "id": 3093, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "12192:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12192:6:8" + }, + { + "arguments": null, + "id": 3096, + "modifierName": { + "argumentTypes": null, + "id": 3095, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "12207:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12207:6:8" + } + ], + "name": "joinPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3088, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3209, + "src": "12117:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3087, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12117:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3091, + "name": "maxAmountsIn", + "nodeType": "VariableDeclaration", + "scope": 3209, + "src": "12137:28:8", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 3089, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12137:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3090, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12137:6:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12116:50:8" + }, + "returnParameters": { + "id": 3097, + "nodeType": "ParameterList", + "parameters": [], + "src": "12218:0:8" + }, + "scope": 4307, + "src": "12099:925:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3350, + "nodeType": "Block", + "src": "13149:975:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3222, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "13167:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13179:19:8", + "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": 3221, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13159:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3224, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13159:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3225, + "nodeType": "ExpressionStatement", + "src": "13159:40:8" + }, + { + "assignments": [ + 3227 + ], + "declarations": [ + { + "constant": false, + "id": 3227, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13210:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3226, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13210:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3230, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 3228, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1695, + "src": "13227:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 3229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13227:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13210:30:8" + }, + { + "assignments": [ + 3232 + ], + "declarations": [ + { + "constant": false, + "id": 3232, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13250:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3231, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13250:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3237, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3234, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13270:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3235, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "13284:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3233, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "13265:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3236, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13265:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13250:43:8" + }, + { + "assignments": [ + 3239 + ], + "declarations": [ + { + "constant": false, + "id": 3239, + "name": "pAiAfterExitFee", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13303:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3238, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13303:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3244, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3241, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13331:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3242, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3232, + "src": "13345:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3240, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "13326:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13326:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13303:50:8" + }, + { + "assignments": [ + 3246 + ], + "declarations": [ + { + "constant": false, + "id": 3246, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13363:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3245, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13363:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3251, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3248, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3239, + "src": "13381:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3249, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3227, + "src": "13398:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3247, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "13376:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13376:32:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13363:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3253, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3246, + "src": "13426:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13435:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13426:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13438:17:8", + "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": 3252, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13418:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13418:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3258, + "nodeType": "ExpressionStatement", + "src": "13418:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3260, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "13482:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13482:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3262, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13494:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3259, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "13467:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13467:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3264, + "nodeType": "ExpressionStatement", + "src": "13467:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3266, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "13532:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3267, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3232, + "src": "13542:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3265, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "13517:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13517:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3269, + "nodeType": "ExpressionStatement", + "src": "13517:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3271, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3239, + "src": "13575:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3270, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "13560:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13560:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3273, + "nodeType": "ExpressionStatement", + "src": "13560:31:8" + }, + { + "body": { + "id": 3348, + "nodeType": "Block", + "src": "13644:473:8", + "statements": [ + { + "assignments": [ + 3286 + ], + "declarations": [ + { + "constant": false, + "id": 3286, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13658:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3285, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13658:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3290, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3287, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "13670:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3289, + "indexExpression": { + "argumentTypes": null, + "id": 3288, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13678:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13670:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13658:22:8" + }, + { + "assignments": [ + 3292 + ], + "declarations": [ + { + "constant": false, + "id": 3292, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13694:8:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3291, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13694:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3297, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3293, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13705:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3295, + "indexExpression": { + "argumentTypes": null, + "id": 3294, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13714:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13705:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3296, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13705:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13694:30:8" + }, + { + "assignments": [ + 3299 + ], + "declarations": [ + { + "constant": false, + "id": 3299, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13738:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3298, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13738:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3304, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3301, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3246, + "src": "13765:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3302, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3292, + "src": "13772:3:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3300, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "13760:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13760:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13738:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3306, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13798:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3307, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13816:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13798:19:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13819:17:8", + "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": 3305, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13790:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13790:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3311, + "nodeType": "ExpressionStatement", + "src": "13790:47:8" + }, + { + "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": 3313, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13859:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3314, + "name": "minAmountsOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3214, + "src": "13877:13:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 3316, + "indexExpression": { + "argumentTypes": null, + "id": 3315, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13891:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13877:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13859:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3318, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13895:15:8", + "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": 3312, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13851:7:8", + "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": "13851:60:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3320, + "nodeType": "ExpressionStatement", + "src": "13851:60:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3321, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13925:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3323, + "indexExpression": { + "argumentTypes": null, + "id": 3322, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13934:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13925:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3324, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13925:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3326, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13952:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3328, + "indexExpression": { + "argumentTypes": null, + "id": 3327, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13961:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13952:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3329, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13952:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3330, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13973:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3325, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "13947:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13947:41:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13925:63:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3333, + "nodeType": "ExpressionStatement", + "src": "13925:63:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3335, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "14016:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14016:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3337, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "14028:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3338, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "14031:14:8", + "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": 3334, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "14007:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14007:39:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3340, + "nodeType": "EmitStatement", + "src": "14002:44:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3342, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "14076:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3343, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "14079:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14079:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3345, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "14091:14:8", + "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": 3341, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "14060:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14060:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3347, + "nodeType": "ExpressionStatement", + "src": "14060:46:8" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3278, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13619:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3279, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "13623:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3280, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13623:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13619:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 3349, + "initializationExpression": { + "assignments": [ + 3275 + ], + "declarations": [ + { + "constant": false, + "id": 3275, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 3349, + "src": "13607:6:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3274, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13607:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3277, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 3276, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13616:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13607:10:8" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 3283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "13639:3:8", + "subExpression": { + "argumentTypes": null, + "id": 3282, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13639:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3284, + "nodeType": "ExpressionStatement", + "src": "13639:3:8" + }, + "nodeType": "ForStatement", + "src": "13602:515:8" + } + ] + }, + "documentation": null, + "id": 3351, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3217, + "modifierName": { + "argumentTypes": null, + "id": 3216, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "13123:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "13123:6:8" + }, + { + "arguments": null, + "id": 3219, + "modifierName": { + "argumentTypes": null, + "id": 3218, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "13138:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "13138:6:8" + } + ], + "name": "exitPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3215, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3211, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3351, + "src": "13048:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3210, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13048:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3214, + "name": "minAmountsOut", + "nodeType": "VariableDeclaration", + "scope": 3351, + "src": "13067:29:8", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 3212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13067:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3213, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13067:6:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13047:50:8" + }, + "returnParameters": { + "id": 3220, + "nodeType": "ParameterList", + "parameters": [], + "src": "13149:0:8" + }, + "scope": 4307, + "src": "13030:1094:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3548, + "nodeType": "Block", + "src": "14403:1921:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3373, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14422:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3375, + "indexExpression": { + "argumentTypes": null, + "id": 3374, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "14431:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14422:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3376, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "14422:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14447:15:8", + "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": 3372, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14414:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14414:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3379, + "nodeType": "ExpressionStatement", + "src": "14414:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3381, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14481:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3383, + "indexExpression": { + "argumentTypes": null, + "id": 3382, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "14490:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14481:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3384, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "14481:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3385, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14507:15:8", + "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": 3380, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14473:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14473:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3387, + "nodeType": "ExpressionStatement", + "src": "14473:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3389, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "14541:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 3390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14554:21:8", + "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": 3388, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14533:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14533:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3392, + "nodeType": "ExpressionStatement", + "src": "14533:43:8" + }, + { + "assignments": [ + 3394 + ], + "declarations": [ + { + "constant": false, + "id": 3394, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14587:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3393, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "14587:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3400, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3395, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14613:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3399, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3397, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "14630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3396, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14622:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14622:16:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14613:26:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14587:52:8" + }, + { + "assignments": [ + 3402 + ], + "declarations": [ + { + "constant": false, + "id": 3402, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14649:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3401, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "14649:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3408, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3403, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14676:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3407, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3405, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "14693:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3404, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14685:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14685:17:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14676:27:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14649:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3410, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "14735:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3412, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14757:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3413, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14757:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3414, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "14775:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3411, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "14752:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14752:36:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14735:53:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3417, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14803:18:8", + "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": 3409, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14714:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14714:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3419, + "nodeType": "ExpressionStatement", + "src": "14714:117:8" + }, + { + "assignments": [ + 3421 + ], + "declarations": [ + { + "constant": false, + "id": 3421, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14842:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3420, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14842:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3433, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3423, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14892:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14892:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3425, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14922:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3426, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "14922:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3427, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "14951:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3428, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14951:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3429, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "14982:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "14982:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3431, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15012:8:8", + "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": 3422, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "14865:13:8", + "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": 3432, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14865:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14842:188:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3435, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15048:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3436, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3361, + "src": "15067:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15048:27:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 3438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15077:21:8", + "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": 3434, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15040:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15040:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3440, + "nodeType": "ExpressionStatement", + "src": "15040:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3441, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15110:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3443, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15155:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3444, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15155:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3445, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15185:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15185:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3447, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15214:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3448, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15214:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3449, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15245:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3450, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15245:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3451, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15275:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3452, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15302:8:8", + "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": 3442, + "name": "calcOutGivenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "15127:14:8", + "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": 3453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15127:193:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15110:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3455, + "nodeType": "ExpressionStatement", + "src": "15110:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3457, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15338:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3458, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3359, + "src": "15356:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15338:30:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3460, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15370:15:8", + "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": 3456, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15330:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3461, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15330:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3462, + "nodeType": "ExpressionStatement", + "src": "15330:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3463, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15397:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3465, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15397:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3467, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15421:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3468, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15421:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3469, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15439:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3466, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "15416:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3470, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15416:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15397:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3472, + "nodeType": "ExpressionStatement", + "src": "15397:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3473, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15463:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3475, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15463:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3477, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15488:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3478, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15488:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3479, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15507:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3476, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "15483:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15483:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15463:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3482, + "nodeType": "ExpressionStatement", + "src": "15463:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3495, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3483, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15533:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3485, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15577:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3486, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15577:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3487, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15607:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3488, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15607:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3489, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15636:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3490, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15636:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3491, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15667:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3492, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15667:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3493, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15697:8:8", + "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": 3484, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "15550:13:8", + "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": 3494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15550:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15533:182:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3496, + "nodeType": "ExpressionStatement", + "src": "15533:182:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3500, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3498, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15733:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3499, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15751:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15733:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15768:17:8", + "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": 3497, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15725:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15725:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3503, + "nodeType": "ExpressionStatement", + "src": "15725:61:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3505, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15809:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3506, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3361, + "src": "15827:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15809:26:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 3508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15837:17:8", + "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": 3504, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15801:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15801:54:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3510, + "nodeType": "ExpressionStatement", + "src": "15801:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3517, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3512, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15886:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3514, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15910:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3515, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15925:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3513, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "15905:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15905:35:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15886:54:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3518, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15955:17:8", + "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": 3511, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15865:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3519, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15865:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3520, + "nodeType": "ExpressionStatement", + "src": "15865:117:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3522, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16020:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3523, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16020:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3524, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "16045:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3525, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "16067:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3526, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "16090:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3527, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16118:14:8", + "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": 3521, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "15998:8:8", + "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": 3528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15998:144:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3529, + "nodeType": "EmitStatement", + "src": "15993:149:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3531, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "16169:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3532, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16178:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16178:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3534, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "16190:13:8", + "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": 3530, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "16153:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16153:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3536, + "nodeType": "ExpressionStatement", + "src": "16153:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3538, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "16230:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3539, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16240:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3540, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16240:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3541, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16252:14:8", + "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": 3537, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "16214:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3542, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16214:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3543, + "nodeType": "ExpressionStatement", + "src": "16214:53:8" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 3544, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16286:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3545, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "16302:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 3546, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "16285:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 3371, + "id": 3547, + "nodeType": "Return", + "src": "16278:39:8" + } + ] + }, + "documentation": null, + "id": 3549, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3364, + "modifierName": { + "argumentTypes": null, + "id": 3363, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "14318:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14318:6:8" + }, + { + "arguments": null, + "id": 3366, + "modifierName": { + "argumentTypes": null, + "id": 3365, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "14333:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14333:6:8" + } + ], + "name": "swapExactAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3362, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3353, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14167:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3352, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14167:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3355, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14192:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3354, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14192:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3357, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14220:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3356, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14220:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3359, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14246:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3358, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14246:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3361, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14273:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3360, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14273:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14157:135:8" + }, + "returnParameters": { + "id": 3371, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3368, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14357:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3367, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14357:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3370, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14378:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3369, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14378:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14356:42:8" + }, + "scope": 4307, + "src": "14131:2193:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3746, + "nodeType": "Block", + "src": "16603:1924:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3571, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16621:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3573, + "indexExpression": { + "argumentTypes": null, + "id": 3572, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "16630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16621:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3574, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "16621:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3575, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16646:15:8", + "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": 3570, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16613:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3576, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16613:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3577, + "nodeType": "ExpressionStatement", + "src": "16613:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3579, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16680:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3581, + "indexExpression": { + "argumentTypes": null, + "id": 3580, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "16689:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16680:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3582, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "16680:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16706:15:8", + "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": 3578, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16672:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16672:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3585, + "nodeType": "ExpressionStatement", + "src": "16672:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3587, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "16740:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 3588, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16753:21:8", + "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": 3586, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16732:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16732:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3590, + "nodeType": "ExpressionStatement", + "src": "16732:43:8" + }, + { + "assignments": [ + 3592 + ], + "declarations": [ + { + "constant": false, + "id": 3592, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "16786:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3591, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "16786:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3598, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3593, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16812:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3597, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3595, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "16829:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3594, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16821:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16821:16:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16812:26:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16786:52:8" + }, + { + "assignments": [ + 3600 + ], + "declarations": [ + { + "constant": false, + "id": 3600, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "16848:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3599, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "16848:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3606, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3601, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16875:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3605, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3603, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "16892:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3602, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16884:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3604, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16884:17:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16875:27:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16848:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3614, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3608, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "16934:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3610, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "16957:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3611, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "16957:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3612, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "16976:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3609, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "16952:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3613, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16952:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16934:56:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3615, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17005:19:8", + "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": 3607, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16913:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16913:121:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3617, + "nodeType": "ExpressionStatement", + "src": "16913:121:8" + }, + { + "assignments": [ + 3619 + ], + "declarations": [ + { + "constant": false, + "id": 3619, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "17045:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3618, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17045:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3631, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3621, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17095:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3622, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17095:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3623, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17125:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3624, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17125:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3625, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17154:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3626, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17154:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3627, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17185:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3628, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17185:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3629, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17215:8:8", + "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": 3620, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "17068:13:8", + "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": 3630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17068:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17045:188:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3633, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "17260:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3634, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3559, + "src": "17279:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17260:27:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 3636, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17289:21:8", + "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": 3632, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17252:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17252:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3638, + "nodeType": "ExpressionStatement", + "src": "17252:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3652, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3639, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17322:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3641, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17366:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3642, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17366:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3643, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17396:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3644, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17396:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3645, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17425:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3646, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17425:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3647, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17456:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3648, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17456:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3649, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17486:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3650, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17514:8:8", + "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": 3640, + "name": "calcInGivenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "17338:14:8", + "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": 3651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17338:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17322:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3653, + "nodeType": "ExpressionStatement", + "src": "17322:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3655, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17550:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3656, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3553, + "src": "17567:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17550:28:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3658, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17580:14:8", + "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": 3654, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17542:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3659, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17542:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3660, + "nodeType": "ExpressionStatement", + "src": "17542:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3669, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3661, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17606:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3663, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17606:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3665, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17630:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3666, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17630:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3667, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17648:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3664, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "17625:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17625:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17606:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3670, + "nodeType": "ExpressionStatement", + "src": "17606:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3671, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17672:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3673, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17672:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3675, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17697:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3676, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17697:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3677, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17716:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3674, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "17692:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17692:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17672:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3680, + "nodeType": "ExpressionStatement", + "src": "17672:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3681, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "17742:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3683, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17786:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3684, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17786:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3685, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17816:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17816:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3687, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17845:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3688, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17845:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3689, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17876:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3690, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17876:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3691, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17906:8:8", + "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": 3682, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "17759:13:8", + "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": 3692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17759:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17742:182:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3694, + "nodeType": "ExpressionStatement", + "src": "17742:182:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3698, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3696, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "17942:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3697, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "17960:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17942:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3699, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17977:17:8", + "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": 3695, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17934:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17934:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3701, + "nodeType": "ExpressionStatement", + "src": "17934:61:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3705, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3703, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "18013:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3704, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3559, + "src": "18031:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18013:26:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 3706, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18041:17:8", + "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": 3702, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18005:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18005:54:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3708, + "nodeType": "ExpressionStatement", + "src": "18005:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3715, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3710, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "18090:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3712, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18114:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3713, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18129:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3711, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "18109:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3714, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18109:35:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18090:54:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3716, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18159:17:8", + "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": 3709, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18069:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18069:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3718, + "nodeType": "ExpressionStatement", + "src": "18069:117:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3720, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18224:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18224:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3722, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "18249:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3723, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "18271:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3724, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18294:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3725, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18322:14:8", + "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": 3719, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "18202:8:8", + "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": 3726, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18202:144:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3727, + "nodeType": "EmitStatement", + "src": "18197:149:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3729, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "18373:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3730, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18382:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18382:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3732, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18394:13:8", + "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": 3728, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "18357:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18357:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3734, + "nodeType": "ExpressionStatement", + "src": "18357:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3736, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "18434:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3737, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18444:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18444:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3739, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18456:14:8", + "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": 3735, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "18418:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18418:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3741, + "nodeType": "ExpressionStatement", + "src": "18418:53:8" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 3742, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18490:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3743, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "18505:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 3744, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "18489:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 3569, + "id": 3745, + "nodeType": "Return", + "src": "18482:38:8" + } + ] + }, + "documentation": null, + "id": 3747, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3562, + "modifierName": { + "argumentTypes": null, + "id": 3561, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "16518:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "16518:6:8" + }, + { + "arguments": null, + "id": 3564, + "modifierName": { + "argumentTypes": null, + "id": 3563, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "16533:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "16533:6:8" + } + ], + "name": "swapExactAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3560, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3551, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16367:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3550, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16367:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3553, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16392:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3552, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16392:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3555, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16418:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3554, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16418:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3557, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16444:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3556, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16444:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3559, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16473:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3558, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16473:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "16357:135:8" + }, + "returnParameters": { + "id": 3569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3566, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16558:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3565, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16558:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3568, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16578:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16578:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "16557:41:8" + }, + "scope": 4307, + "src": "16330:2197:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3850, + "nodeType": "Block", + "src": "18747:915:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3763, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "18773:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3764, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18785:19:8", + "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": 3762, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18765:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18765:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3766, + "nodeType": "ExpressionStatement", + "src": "18765:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3768, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "18823:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3770, + "indexExpression": { + "argumentTypes": null, + "id": 3769, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "18832:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18823:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3771, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "18823:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3772, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18848:15:8", + "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": 3767, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18815:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18815:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3774, + "nodeType": "ExpressionStatement", + "src": "18815:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3776, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "18895:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3778, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "18917:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3780, + "indexExpression": { + "argumentTypes": null, + "id": 3779, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "18926:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18917:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3781, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "18917:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3782, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "18944:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3777, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "18912:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3783, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18912:45:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18895:62:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3785, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18972:18:8", + "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": 3775, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18874:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3786, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18874:126:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3787, + "nodeType": "ExpressionStatement", + "src": "18874:126:8" + }, + { + "assignments": [ + 3789 + ], + "declarations": [ + { + "constant": false, + "id": 3789, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3850, + "src": "19011:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3788, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "19011:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3793, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3790, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "19037:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3792, + "indexExpression": { + "argumentTypes": null, + "id": 3791, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19046:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19037:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19011:43:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3794, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19065:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3796, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19119:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3797, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19119:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3798, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19149:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3799, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "19149:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3800, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "19178:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3801, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "19204:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3802, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19230:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3803, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "19257:8:8", + "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": 3795, + "name": "calcPoolOutGivenSingleIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 597, + "src": "19081:24:8", + "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": 3804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19081:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19065:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3806, + "nodeType": "ExpressionStatement", + "src": "19065:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3808, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19294:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3809, + "name": "minPoolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3753, + "src": "19311:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19294:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3811, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19329:15:8", + "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": 3807, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19286:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3812, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19286:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3813, + "nodeType": "ExpressionStatement", + "src": "19286:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3814, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19356:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3816, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19356:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3818, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19380:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3819, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19380:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3820, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19398:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3817, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "19375:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19375:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19356:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3823, + "nodeType": "ExpressionStatement", + "src": "19356:56:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3825, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19437:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3826, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19437:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3827, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19449:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3828, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19458:13:8", + "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": 3824, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "19428:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19428:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3830, + "nodeType": "EmitStatement", + "src": "19423:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3832, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19498:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3831, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "19483:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19483:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3834, + "nodeType": "ExpressionStatement", + "src": "19483:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3836, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19537:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19537:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3838, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19549:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3835, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "19522:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19522:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3840, + "nodeType": "ExpressionStatement", + "src": "19522:41:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3842, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19589:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3843, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19598:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19598:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3845, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19610:13:8", + "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": 3841, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "19573:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19573:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3847, + "nodeType": "ExpressionStatement", + "src": "19573:51:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3848, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19642:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3761, + "id": 3849, + "nodeType": "Return", + "src": "19635:20:8" + } + ] + }, + "documentation": null, + "id": 3851, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3756, + "modifierName": { + "argumentTypes": null, + "id": 3755, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "18683:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18683:6:8" + }, + { + "arguments": null, + "id": 3758, + "modifierName": { + "argumentTypes": null, + "id": 3757, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "18698:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18698:6:8" + } + ], + "name": "joinswapExternAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3754, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3749, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18575:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3748, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18575:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3751, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18601:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3750, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18601:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3753, + "name": "minPoolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18630:21:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3752, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18630:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18565:92:8" + }, + "returnParameters": { + "id": 3761, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3760, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18722:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3759, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18722:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18721:20:8" + }, + "scope": 4307, + "src": "18534:1128:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3961, + "nodeType": "Block", + "src": "19874:966:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3867, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "19892:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3868, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19904:19:8", + "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": 3866, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19884:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3869, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19884:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3870, + "nodeType": "ExpressionStatement", + "src": "19884:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3872, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "19942:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3874, + "indexExpression": { + "argumentTypes": null, + "id": 3873, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "19951:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19942:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3875, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "19942:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3876, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19967:15:8", + "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": 3871, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19934:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19934:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3878, + "nodeType": "ExpressionStatement", + "src": "19934:49:8" + }, + { + "assignments": [ + 3880 + ], + "declarations": [ + { + "constant": false, + "id": 3880, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3961, + "src": "19994:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3879, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "19994:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3884, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3881, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "20020:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3883, + "indexExpression": { + "argumentTypes": null, + "id": 3882, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20029:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20020:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19994:43:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3896, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3885, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20048:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3887, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20102:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3888, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20102:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3889, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20132:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3890, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "20132:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3891, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "20161:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3892, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "20187:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3893, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20213:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3894, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "20240:8:8", + "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": 3886, + "name": "calcSingleInGivenPoolOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 686, + "src": "20064:24:8", + "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": 3895, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20064:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20048:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3897, + "nodeType": "ExpressionStatement", + "src": "20048:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3899, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20277:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3900, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20294:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "20277:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3902, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20297:17:8", + "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": 3898, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20269:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20269:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3904, + "nodeType": "ExpressionStatement", + "src": "20269:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3908, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3906, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20333:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3907, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3857, + "src": "20350:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20333:28:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20363:14:8", + "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": 3905, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20325:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20325:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3911, + "nodeType": "ExpressionStatement", + "src": "20325:53:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3913, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20418:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3915, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "20440:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3917, + "indexExpression": { + "argumentTypes": null, + "id": 3916, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20449:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20440:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3918, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20440:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3919, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "20467:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3914, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "20435:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20435:45:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20418:62:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3922, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20495:18:8", + "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": 3912, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20397:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3923, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20397:126:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3924, + "nodeType": "ExpressionStatement", + "src": "20397:126:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3933, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3925, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20534:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3927, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20534:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3929, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20558:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3930, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20558:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3931, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20576:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3928, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "20553:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20553:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20534:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3934, + "nodeType": "ExpressionStatement", + "src": "20534:56:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3936, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20615:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20615:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3938, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20627:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3939, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20636:13:8", + "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": 3935, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "20606:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3940, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20606:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3941, + "nodeType": "EmitStatement", + "src": "20601:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3943, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20676:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3942, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "20661:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20661:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3945, + "nodeType": "ExpressionStatement", + "src": "20661:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3947, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20715:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20715:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3949, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20727:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3946, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "20700:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20700:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3951, + "nodeType": "ExpressionStatement", + "src": "20700:41:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3953, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20767:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3954, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20776:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20776:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3956, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20788:13:8", + "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": 3952, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "20751:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20751:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3958, + "nodeType": "ExpressionStatement", + "src": "20751:51:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3959, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20820:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3865, + "id": 3960, + "nodeType": "Return", + "src": "20813:20:8" + } + ] + }, + "documentation": null, + "id": 3962, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3860, + "modifierName": { + "argumentTypes": null, + "id": 3859, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "19811:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19811:6:8" + }, + { + "arguments": null, + "id": 3862, + "modifierName": { + "argumentTypes": null, + "id": 3861, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "19826:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19826:6:8" + } + ], + "name": "joinswapPoolAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3858, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3853, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19708:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3852, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "19708:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3855, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19734:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3854, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19734:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3857, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19763:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3856, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19763:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19698:87:8" + }, + "returnParameters": { + "id": 3865, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3864, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19850:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3863, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19850:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19849:20:8" + }, + "scope": 4307, + "src": "19668:1172:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4080, + "nodeType": "Block", + "src": "21053:1040:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3978, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "21071:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3979, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21083:19:8", + "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": 3977, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21063:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21063:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3981, + "nodeType": "ExpressionStatement", + "src": "21063:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3983, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21121:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3985, + "indexExpression": { + "argumentTypes": null, + "id": 3984, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21130:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21121:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3986, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "21121:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3987, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21147:15:8", + "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": 3982, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21113:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21113:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3989, + "nodeType": "ExpressionStatement", + "src": "21113:50:8" + }, + { + "assignments": [ + 3991 + ], + "declarations": [ + { + "constant": false, + "id": 3991, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 4080, + "src": "21174:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3990, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "21174:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3995, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3992, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21201:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3994, + "indexExpression": { + "argumentTypes": null, + "id": 3993, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21210:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21201:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21174:45:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3996, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21230:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3998, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21285:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3999, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21285:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4000, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21316:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4001, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "21316:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4002, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "21346:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4003, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "21372:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4004, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21398:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4005, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "21424:8:8", + "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": 3997, + "name": "calcSingleOutGivenPoolIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 781, + "src": "21247:24:8", + "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": 4006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21247:195:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21230:212:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4008, + "nodeType": "ExpressionStatement", + "src": "21230:212:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4010, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21461:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 4011, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3968, + "src": "21479:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21461:30:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 4013, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21493:15:8", + "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": 4009, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21453:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21453:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4015, + "nodeType": "ExpressionStatement", + "src": "21453:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4017, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21549:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4019, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21572:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4021, + "indexExpression": { + "argumentTypes": null, + "id": 4020, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21581:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21572:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4022, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21572:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4023, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "21600:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4018, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "21567:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21567:47:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21549:65:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 4026, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21629:19:8", + "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": 4016, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21528:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4027, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21528:130:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4028, + "nodeType": "ExpressionStatement", + "src": "21528:130:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4037, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4029, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21669:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4031, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21669:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4033, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21694:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4034, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21694:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4035, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21713:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4032, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "21689:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21689:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21669:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4038, + "nodeType": "ExpressionStatement", + "src": "21669:59:8" + }, + { + "assignments": [ + 4040 + ], + "declarations": [ + { + "constant": false, + "id": 4040, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 4080, + "src": "21739:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4039, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21739:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4045, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4042, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21759:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4043, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "21773:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4041, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "21754:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21754:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21739:43:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4047, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "21807:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21807:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4049, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21819:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4050, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21829:14:8", + "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": 4046, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "21798:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21798:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4052, + "nodeType": "EmitStatement", + "src": "21793:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4054, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "21870:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21870:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4056, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21882:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4053, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "21855:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21855:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4058, + "nodeType": "ExpressionStatement", + "src": "21855:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4061, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21925:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4062, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4040, + "src": "21939:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4060, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "21920:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21920:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4059, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "21905:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21905:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4065, + "nodeType": "ExpressionStatement", + "src": "21905:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4067, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "21973:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4068, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4040, + "src": "21983:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4066, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "21958:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4069, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21958:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4070, + "nodeType": "ExpressionStatement", + "src": "21958:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4072, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "22017:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4073, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "22027:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4074, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22027:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4075, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "22039:14:8", + "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": 4071, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "22001:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22001:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4077, + "nodeType": "ExpressionStatement", + "src": "22001:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4078, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "22072:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3976, + "id": 4079, + "nodeType": "Return", + "src": "22065:21:8" + } + ] + }, + "documentation": null, + "id": 4081, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3971, + "modifierName": { + "argumentTypes": null, + "id": 3970, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "20989:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "20989:6:8" + }, + { + "arguments": null, + "id": 3973, + "modifierName": { + "argumentTypes": null, + "id": 3972, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "21004:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21004:6:8" + } + ], + "name": "exitswapPoolAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3969, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3964, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20885:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3963, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20885:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3966, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20912:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3965, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20912:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3968, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20940:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3967, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20940:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "20875:88:8" + }, + "returnParameters": { + "id": 3976, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3975, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "21028:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3974, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21028:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "21027:21:8" + }, + "scope": 4307, + "src": "20846:1247:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4206, + "nodeType": "Block", + "src": "22312:1092:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4097, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "22330:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 4098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22342:19:8", + "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": 4096, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22322:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22322:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4100, + "nodeType": "ExpressionStatement", + "src": "22322:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4102, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22380:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4104, + "indexExpression": { + "argumentTypes": null, + "id": 4103, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22389:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22380:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4105, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "22380:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 4106, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22406:15:8", + "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": 4101, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4107, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22372:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4108, + "nodeType": "ExpressionStatement", + "src": "22372:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4110, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "22453:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4112, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22476:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4114, + "indexExpression": { + "argumentTypes": null, + "id": 4113, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22485:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22476:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4115, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22476:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4116, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "22504:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4111, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "22471:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22471:47:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22453:65:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 4119, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22533:19:8", + "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": 4109, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22432:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22432:130:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4121, + "nodeType": "ExpressionStatement", + "src": "22432:130:8" + }, + { + "assignments": [ + 4123 + ], + "declarations": [ + { + "constant": false, + "id": 4123, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 4206, + "src": "22573:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 4122, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "22573:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4127, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4124, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22600:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4126, + "indexExpression": { + "argumentTypes": null, + "id": 4125, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22609:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22600:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22573:45:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 4128, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22629:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4130, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22682:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4131, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22682:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4132, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22713:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4133, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "22713:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4134, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "22743:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4135, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "22769:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4136, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "22795:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4137, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "22823:8:8", + "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": 4129, + "name": "calcPoolInGivenSingleOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 877, + "src": "22644:24:8", + "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": 4138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22644:197:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22629:212:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4140, + "nodeType": "ExpressionStatement", + "src": "22629:212:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4142, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22860:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 4143, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22876:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "22860:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 4145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22879:17:8", + "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": 4141, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22852:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22852:45:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4147, + "nodeType": "ExpressionStatement", + "src": "22852:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4149, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22915:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 4150, + "name": "maxPoolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4087, + "src": "22931:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22915:31:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 4152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22948:14:8", + "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": 4148, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22907:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22907:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4154, + "nodeType": "ExpressionStatement", + "src": "22907:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4155, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22974:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4157, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22974:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4159, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22999:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4160, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22999:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4161, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23018:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4158, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "22994:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22994:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22974:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4164, + "nodeType": "ExpressionStatement", + "src": "22974:59:8" + }, + { + "assignments": [ + 4166 + ], + "declarations": [ + { + "constant": false, + "id": 4166, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 4206, + "src": "23044:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4165, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23044:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4171, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4168, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23064:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4169, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "23078:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4167, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "23059:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23059:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23044:43:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4173, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23112:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23112:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4175, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "23124:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4176, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23134:14:8", + "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": 4172, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "23103:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23103:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4178, + "nodeType": "EmitStatement", + "src": "23098:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4180, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23175:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23175:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4182, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23187:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4179, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "23160:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23160:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4184, + "nodeType": "ExpressionStatement", + "src": "23160:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4187, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23230:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4188, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4166, + "src": "23244:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4186, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "23225:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23225:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4185, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "23210:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23210:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4191, + "nodeType": "ExpressionStatement", + "src": "23210:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4193, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "23278:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4194, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4166, + "src": "23288:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4192, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "23263:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4195, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23263:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4196, + "nodeType": "ExpressionStatement", + "src": "23263:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4198, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "23322:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4199, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23332:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23332:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4201, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23344:14:8", + "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": 4197, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "23306:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23306:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4203, + "nodeType": "ExpressionStatement", + "src": "23306:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4204, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23385:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4095, + "id": 4205, + "nodeType": "Return", + "src": "23378:19:8" + } + ] + }, + "documentation": null, + "id": 4207, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 4090, + "modifierName": { + "argumentTypes": null, + "id": 4089, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "22250:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "22250:6:8" + }, + { + "arguments": null, + "id": 4092, + "modifierName": { + "argumentTypes": null, + "id": 4091, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "22265:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "22265:6:8" + } + ], + "name": "exitswapExternAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4088, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4083, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22141:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4082, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22141:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4085, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22168:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4084, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22168:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4087, + "name": "maxPoolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22198:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4086, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22198:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22131:93:8" + }, + "returnParameters": { + "id": 4095, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4094, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22289:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4093, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22289:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22288:19:8" + }, + "scope": 4307, + "src": "22099:1305:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4234, + "nodeType": "Block", + "src": "23658:126:8", + "statements": [ + { + "assignments": [ + 4217 + ], + "declarations": [ + { + "constant": false, + "id": 4217, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 4234, + "src": "23668:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4216, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "23668:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4228, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4222, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4211, + "src": "23707:4:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4224, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5675, + "src": "23721:4:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + ], + "id": 4223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23713:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 4225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23713:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4226, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4213, + "src": "23728:6:8", + "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": 4219, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4209, + "src": "23687:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4218, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "23680:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 4220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23680:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 4221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 1424, + "src": "23680:26:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 4227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23680:55:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23668:67:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4230, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4217, + "src": "23753:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 4231, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23759:17:8", + "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": 4229, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "23745:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23745:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4233, + "nodeType": "ExpressionStatement", + "src": "23745:32:8" + } + ] + }, + "documentation": null, + "id": 4235, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4214, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4209, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23595:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4208, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23595:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4211, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23610:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4210, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23610:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4213, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23624:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23624:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23594:42:8" + }, + "returnParameters": { + "id": 4215, + "nodeType": "ParameterList", + "parameters": [], + "src": "23658:0:8" + }, + "scope": 4307, + "src": "23570:214:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4259, + "nodeType": "Block", + "src": "23876:105:8", + "statements": [ + { + "assignments": [ + 4245 + ], + "declarations": [ + { + "constant": false, + "id": 4245, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 4259, + "src": "23886:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4244, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "23886:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4253, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4250, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4239, + "src": "23921:2:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4251, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4241, + "src": "23925:6:8", + "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": 4247, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4237, + "src": "23905:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4246, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "23898:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 4248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23898:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 4249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 1413, + "src": "23898:22:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 4252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23898:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23886:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4255, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4245, + "src": "23950:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 4256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23956:17:8", + "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": 4254, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "23942:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23942:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4258, + "nodeType": "ExpressionStatement", + "src": "23942:32:8" + } + ] + }, + "documentation": null, + "id": 4260, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4242, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4237, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23815:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4236, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23815:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4239, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23830:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4238, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23830:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4241, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23842:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4240, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23842:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23814:40:8" + }, + "returnParameters": { + "id": 4243, + "nodeType": "ParameterList", + "parameters": [], + "src": "23876:0:8" + }, + "scope": 4307, + "src": "23790:191:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4272, + "nodeType": "Block", + "src": "24059:36:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4268, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4262, + "src": "24075:4:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4269, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4264, + "src": "24081:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4267, + "name": "_pull", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1621, + "src": "24069:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24069:19:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4271, + "nodeType": "ExpressionStatement", + "src": "24069:19:8" + } + ] + }, + "documentation": null, + "id": 4273, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4265, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4262, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 4273, + "src": "24011:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4261, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24011:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4264, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4273, + "src": "24025:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4263, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24025:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24010:27:8" + }, + "returnParameters": { + "id": 4266, + "nodeType": "ParameterList", + "parameters": [], + "src": "24059:0:8" + }, + "scope": 4307, + "src": "23987:108:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4285, + "nodeType": "Block", + "src": "24171:34:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4281, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4275, + "src": "24187:2:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4282, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4277, + "src": "24191:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4280, + "name": "_push", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1605, + "src": "24181:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24181:17:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4284, + "nodeType": "ExpressionStatement", + "src": "24181:17:8" + } + ] + }, + "documentation": null, + "id": 4286, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4275, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 4286, + "src": "24125:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4274, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24125:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4277, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4286, + "src": "24137:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4276, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24137:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24124:25:8" + }, + "returnParameters": { + "id": 4279, + "nodeType": "ParameterList", + "parameters": [], + "src": "24171:0:8" + }, + "scope": 4307, + "src": "24101:104:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4295, + "nodeType": "Block", + "src": "24269:30:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4292, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4288, + "src": "24285:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4291, + "name": "_mint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1493, + "src": "24279:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24279:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4294, + "nodeType": "ExpressionStatement", + "src": "24279:13:8" + } + ] + }, + "documentation": null, + "id": 4296, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_mintPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4289, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4288, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4296, + "src": "24235:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4287, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24235:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24234:13:8" + }, + "returnParameters": { + "id": 4290, + "nodeType": "ParameterList", + "parameters": [], + "src": "24269:0:8" + }, + "scope": 4307, + "src": "24211:88:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4305, + "nodeType": "Block", + "src": "24363:30:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4302, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4298, + "src": "24379:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4301, + "name": "_burn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1542, + "src": "24373:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24373:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4304, + "nodeType": "ExpressionStatement", + "src": "24373:13:8" + } + ] + }, + "documentation": null, + "id": 4306, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_burnPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4299, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4298, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4306, + "src": "24329:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4297, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24329:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24328:13:8" + }, + "returnParameters": { + "id": 4300, + "nodeType": "ParameterList", + "parameters": [], + "src": "24363:0:8" + }, + "scope": 4307, + "src": "24305:88:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + } + ], + "scope": 4308, + "src": "855:23541:8" + } + ], + "src": "0:24397:8" + }, + "legacyAST": { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/SPool.sol", + "exportedSymbols": { + "SPool": [ + 4307 + ] + }, + "id": 4308, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 2063, + "literals": [ + "solidity", + "^", + "0.5", + ".7" + ], + "nodeType": "PragmaDirective", + "src": "0:23:8" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BToken.sol", + "file": "./BToken.sol", + "id": 2064, + "nodeType": "ImportDirective", + "scope": 4308, + "sourceUnit": 1929, + "src": "186:22:8", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/Users/ahmedali/Desktop/work/Ocean/ocean-contracts/contracts/balancer/BMath.sol", + "file": "./BMath.sol", + "id": 2065, + "nodeType": "ImportDirective", + "scope": 4308, + "sourceUnit": 879, + "src": "209:21:8", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2066, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 219, + "src": "873:7:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$219", + "typeString": "contract BBronze" + } + }, + "id": 2067, + "nodeType": "InheritanceSpecifier", + "src": "873:7:8" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2068, + "name": "BToken", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1928, + "src": "882:6:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BToken_$1928", + "typeString": "contract BToken" + } + }, + "id": 2069, + "nodeType": "InheritanceSpecifier", + "src": "882:6:8" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 2070, + "name": "BMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 878, + "src": "890:5:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BMath_$878", + "typeString": "contract BMath" + } + }, + "id": 2071, + "nodeType": "InheritanceSpecifier", + "src": "890:5:8" + } + ], + "contractDependencies": [ + 206, + 219, + 307, + 878, + 1355, + 1425, + 1622, + 1928 + ], + "contractKind": "contract", + "documentation": "@title SPool\n \n@dev Used by the (Ocean version) SFactory contract as a bytecode reference to \n deploy new SPools.\n* This contract is is nearly identical to the BPool.sol contract at [1]\n The only difference is the \"Proxy contract functionality\" section \n given below. We'd inherit from BPool if we could, for simplicity.\n But we can't, because the proxy section needs to access private\n variables declared in BPool, and Solidity disallows this. Therefore\n the best we can do for now is clearly demarcate the proxy section. \n* [1] https://github.com/balancer-labs/balancer-core/contracts/.", + "fullyImplemented": true, + "id": 4307, + "linearizedBaseContracts": [ + 4307, + 878, + 1928, + 1425, + 1622, + 1355, + 307, + 219, + 206 + ], + "name": "SPool", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "SPool.Record", + "id": 2080, + "members": [ + { + "constant": false, + "id": 2073, + "name": "bound", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "927:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2072, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "927:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2075, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "975:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2074, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "975:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2077, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "1008:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2076, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1008:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2079, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2080, + "src": "1053:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2078, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1053:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Record", + "nodeType": "StructDefinition", + "scope": 4307, + "src": "903:169:8", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 2092, + "name": "LOG_SWAP", + "nodeType": "EventDefinition", + "parameters": { + "id": 2091, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2082, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1102:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2081, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1102:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2084, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1134:23:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2083, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1134:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2086, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1167:24:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2085, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1167:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2088, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1201:29:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2087, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1201:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2090, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2092, + "src": "1240:30:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2089, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1240:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1092:184:8" + }, + "src": "1078:199:8" + }, + { + "anonymous": false, + "documentation": null, + "id": 2100, + "name": "LOG_JOIN", + "nodeType": "EventDefinition", + "parameters": { + "id": 2099, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2094, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1307:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2093, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1307:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2096, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1339:23:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2095, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1339:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2098, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2100, + "src": "1372:29:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2097, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1297:110:8" + }, + "src": "1283:125:8" + }, + { + "anonymous": false, + "documentation": null, + "id": 2108, + "name": "LOG_EXIT", + "nodeType": "EventDefinition", + "parameters": { + "id": 2107, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2102, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1438:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2101, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1438:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2104, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1470:24:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2103, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1470:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2106, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2108, + "src": "1504:30:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2105, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1504:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1428:112:8" + }, + "src": "1414:127:8" + }, + { + "anonymous": true, + "documentation": null, + "id": 2116, + "name": "LOG_CALL", + "nodeType": "EventDefinition", + "parameters": { + "id": 2115, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2110, + "indexed": true, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1571:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 2109, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "1571:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2112, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1600:22:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2111, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1600:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2114, + "indexed": false, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "1632:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 2113, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1632:5:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1561:97:8" + }, + "src": "1547:122:8" + }, + { + "body": { + "id": 2128, + "nodeType": "Block", + "src": "1693:72:8", + "statements": [ + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2119, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1717:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sig", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1717:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2121, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1726:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2122, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1726:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2123, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "1738:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "data", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1738:8:8", + "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": 2118, + "name": "LOG_CALL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2116, + "src": "1708:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes4,address,bytes memory)" + } + }, + "id": 2125, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1708:39:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2126, + "nodeType": "EmitStatement", + "src": "1703:44:8" + }, + { + "id": 2127, + "nodeType": "PlaceholderStatement", + "src": "1757:1:8" + } + ] + }, + "documentation": null, + "id": 2129, + "name": "_logs_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2117, + "nodeType": "ParameterList", + "parameters": [], + "src": "1690:2:8" + }, + "src": "1675:90:8", + "visibility": "internal" + }, + { + "body": { + "id": 2146, + "nodeType": "Block", + "src": "1789:141:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2133, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1820:7:8", + "subExpression": { + "argumentTypes": null, + "id": 2132, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1821:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 2134, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1842:13:8", + "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": 2131, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1799:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2135, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1799:66:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2136, + "nodeType": "ExpressionStatement", + "src": "1799:66:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2137, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1875:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2138, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1884:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1875:13:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2140, + "nodeType": "ExpressionStatement", + "src": "1875:13:8" + }, + { + "id": 2141, + "nodeType": "PlaceholderStatement", + "src": "1898:1:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2142, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1909:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2143, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1918:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1909:14:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2145, + "nodeType": "ExpressionStatement", + "src": "1909:14:8" + } + ] + }, + "documentation": null, + "id": 2147, + "name": "_lock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2130, + "nodeType": "ParameterList", + "parameters": [], + "src": "1786:2:8" + }, + "src": "1771:159:8", + "visibility": "internal" + }, + { + "body": { + "id": 2156, + "nodeType": "Block", + "src": "1958:59:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1976:7:8", + "subExpression": { + "argumentTypes": null, + "id": 2150, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2159, + "src": "1977:6:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 2152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1985:13:8", + "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": 2149, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "1968:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1968:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2154, + "nodeType": "ExpressionStatement", + "src": "1968:31:8" + }, + { + "id": 2155, + "nodeType": "PlaceholderStatement", + "src": "2009:1:8" + } + ] + }, + "documentation": null, + "id": 2157, + "name": "_viewlock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2148, + "nodeType": "ParameterList", + "parameters": [], + "src": "1955:2:8" + }, + "src": "1936:81:8", + "visibility": "internal" + }, + { + "constant": false, + "id": 2159, + "name": "_mutex", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2027:19:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2158, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2027:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2161, + "name": "_factory", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2053:24:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2160, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2053:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2163, + "name": "_controller", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2131:27:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2162, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2131:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2165, + "name": "_publicSwap", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2184:24:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2164, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2184:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2167, + "name": "_swapFee", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2368:21:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2166, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2368:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2169, + "name": "_finalized", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2395:23:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2168, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2395:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2172, + "name": "_tokens", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2425:25:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2170, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2425:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2171, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2425:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2176, + "name": "_records", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2456:42:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record)" + }, + "typeName": { + "id": 2175, + "keyType": { + "id": 2173, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2464:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2456:24:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record)" + }, + "valueType": { + "contractScope": null, + "id": 2174, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "2473:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2178, + "name": "_totalWeight", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2504:25:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2177, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2504:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 2181, + "name": "initialized", + "nodeType": "VariableDeclaration", + "scope": 4307, + "src": "2656:32:8", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2179, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2656:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2180, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2683:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "visibility": "private" + }, + { + "body": { + "id": 2190, + "nodeType": "Block", + "src": "2725:111:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "2756:12:8", + "subExpression": { + "argumentTypes": null, + "id": 2184, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "2757:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f414c52454144595f494e495449414c495a4544", + "id": 2186, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2783:25:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1fb8797b66eca6c15df697c66cc4b5186be8e5c9588f384f789ecfab2607b249", + "typeString": "literal_string \"ERR_ALREADY_INITIALIZED\"" + }, + "value": "ERR_ALREADY_INITIALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1fb8797b66eca6c15df697c66cc4b5186be8e5c9588f384f789ecfab2607b249", + "typeString": "literal_string \"ERR_ALREADY_INITIALIZED\"" + } + ], + "id": 2183, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "2735:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2187, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2735:83:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2188, + "nodeType": "ExpressionStatement", + "src": "2735:83:8" + }, + { + "id": 2189, + "nodeType": "PlaceholderStatement", + "src": "2828:1:8" + } + ] + }, + "documentation": null, + "id": 2191, + "name": "onlyNotInitialized", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 2182, + "nodeType": "ParameterList", + "parameters": [], + "src": "2722:2:8" + }, + "src": "2695:141:8", + "visibility": "internal" + }, + { + "body": { + "id": 2198, + "nodeType": "Block", + "src": "2892:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2196, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "2909:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2195, + "id": 2197, + "nodeType": "Return", + "src": "2902:18:8" + } + ] + }, + "documentation": null, + "id": 2199, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isInitialized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2192, + "nodeType": "ParameterList", + "parameters": [], + "src": "2863:2:8" + }, + "returnParameters": { + "id": 2195, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2194, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "2886:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2193, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2886:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2885:6:8" + }, + "scope": 4307, + "src": "2841:86:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2212, + "nodeType": "Block", + "src": "3001:75:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "3023:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3023:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2205, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "3035:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3035:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2207, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "3047:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2208, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3056:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2209, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3063:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2202, + "name": "_initialize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2281, + "src": "3011:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) returns (bool)" + } + }, + "id": 2210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3011:58:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2211, + "nodeType": "ExpressionStatement", + "src": "3011:58:8" + } + ] + }, + "documentation": null, + "id": 2213, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2200, + "nodeType": "ParameterList", + "parameters": [], + "src": "2991:2:8" + }, + "returnParameters": { + "id": 2201, + "nodeType": "ParameterList", + "parameters": [], + "src": "3001:0:8" + }, + "scope": 4307, + "src": "2980:96:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2238, + "nodeType": "Block", + "src": "3467:88:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2231, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2215, + "src": "3496:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2232, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2217, + "src": "3508:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2233, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2219, + "src": "3517:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2234, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2221, + "src": "3526:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 2235, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2223, + "src": "3538:9:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 2230, + "name": "_initialize", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2281, + "src": "3484:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", + "typeString": "function (address,address,uint256,bool,bool) returns (bool)" + } + }, + "id": 2236, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3484:64:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2229, + "id": 2237, + "nodeType": "Return", + "src": "3477:71:8" + } + ] + }, + "documentation": null, + "id": 2239, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2226, + "modifierName": { + "argumentTypes": null, + "id": 2225, + "name": "onlyNotInitialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2191, + "src": "3422:18:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3422:18:8" + } + ], + "name": "initialize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2215, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3276:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2214, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3276:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2217, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3305:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2216, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3305:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2219, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3331:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2218, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3331:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2221, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3353:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2220, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3353:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2223, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3378:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2222, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3378:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3266:132:8" + }, + "returnParameters": { + "id": 2229, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2228, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2239, + "src": "3457:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2227, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3457:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3456:6:8" + }, + "scope": 4307, + "src": "3247:308:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2280, + "nodeType": "Block", + "src": "3817:221:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2254, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "3827:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2255, + "name": "controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2241, + "src": "3841:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3827:24:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2257, + "nodeType": "ExpressionStatement", + "src": "3827:24:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2258, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "3861:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2259, + "name": "factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2243, + "src": "3872:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3861:18:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2261, + "nodeType": "ExpressionStatement", + "src": "3861:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2262, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "3889:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2263, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2245, + "src": "3900:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3889:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2265, + "nodeType": "ExpressionStatement", + "src": "3889:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2266, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "3917:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2267, + "name": "publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2247, + "src": "3931:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3917:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2269, + "nodeType": "ExpressionStatement", + "src": "3917:24:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2270, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "3951:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2271, + "name": "finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2249, + "src": "3964:9:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3951:22:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2273, + "nodeType": "ExpressionStatement", + "src": "3951:22:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2276, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2274, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "3985:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2275, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3999:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3985:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2277, + "nodeType": "ExpressionStatement", + "src": "3985:18:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2278, + "name": "initialized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2181, + "src": "4020:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2253, + "id": 2279, + "nodeType": "Return", + "src": "4013:18:8" + } + ] + }, + "documentation": null, + "id": 2281, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_initialize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2250, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2241, + "name": "controller", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3651:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2240, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3651:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2243, + "name": "factory", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3680:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2242, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3680:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2245, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3706:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2244, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3706:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2247, + "name": "publicSwap", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3728:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2246, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3728:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2249, + "name": "finalized", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3754:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2248, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3754:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3641:133:8" + }, + "returnParameters": { + "id": 2253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2252, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2281, + "src": "3807:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2251, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3807:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3806:6:8" + }, + "scope": 4307, + "src": "3621:417:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 2288, + "nodeType": "Block", + "src": "4240:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2286, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "4257:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2285, + "id": 2287, + "nodeType": "Return", + "src": "4250:18:8" + } + ] + }, + "documentation": null, + "id": 2289, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2282, + "nodeType": "ParameterList", + "parameters": [], + "src": "4188:2:8" + }, + "returnParameters": { + "id": 2285, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2284, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2289, + "src": "4230:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2283, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4230:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4229:6:8" + }, + "scope": 4307, + "src": "4167:108:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2296, + "nodeType": "Block", + "src": "4353:34:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2294, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "4370:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2293, + "id": 2295, + "nodeType": "Return", + "src": "4363:17:8" + } + ] + }, + "documentation": null, + "id": 2297, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isFinalized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2290, + "nodeType": "ParameterList", + "parameters": [], + "src": "4301:2:8" + }, + "returnParameters": { + "id": 2293, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2292, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2297, + "src": "4343:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2291, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4343:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4342:6:8" + }, + "scope": 4307, + "src": "4281:106:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2309, + "nodeType": "Block", + "src": "4470:41:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2304, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "4487:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2306, + "indexExpression": { + "argumentTypes": null, + "id": 2305, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2299, + "src": "4496:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4487:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2307, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "4487:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 2303, + "id": 2308, + "nodeType": "Return", + "src": "4480:24:8" + } + ] + }, + "documentation": null, + "id": 2310, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBound", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2300, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2299, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2310, + "src": "4410:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2298, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4410:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4409:11:8" + }, + "returnParameters": { + "id": 2303, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2302, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2310, + "src": "4460:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2301, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4460:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4459:6:8" + }, + "scope": 4307, + "src": "4393:118:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2318, + "nodeType": "Block", + "src": "4591:38:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2315, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4608:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2316, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4608:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2314, + "id": 2317, + "nodeType": "Return", + "src": "4601:21:8" + } + ] + }, + "documentation": null, + "id": 2319, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNumTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2311, + "nodeType": "ParameterList", + "parameters": [], + "src": "4538:2:8" + }, + "returnParameters": { + "id": 2314, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2313, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2319, + "src": "4580:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2312, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4580:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4579:6:8" + }, + "scope": 4307, + "src": "4517:112:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2329, + "nodeType": "Block", + "src": "4742:31:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2327, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4759:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 2326, + "id": 2328, + "nodeType": "Return", + "src": "4752:14:8" + } + ] + }, + "documentation": null, + "id": 2330, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2322, + "modifierName": { + "argumentTypes": null, + "id": 2321, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "4685:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4685:10:8" + } + ], + "name": "getCurrentTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2320, + "nodeType": "ParameterList", + "parameters": [], + "src": "4660:2:8" + }, + "returnParameters": { + "id": 2326, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2325, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 2330, + "src": "4713:23:8", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2323, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4713:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2324, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4713:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4712:25:8" + }, + "scope": 4307, + "src": "4635:138:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2345, + "nodeType": "Block", + "src": "4892:81:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2339, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "4910:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2340, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4922:19:8", + "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": 2338, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "4902:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4902:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2342, + "nodeType": "ExpressionStatement", + "src": "4902:40:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2343, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "4959:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 2337, + "id": 2344, + "nodeType": "Return", + "src": "4952:14:8" + } + ] + }, + "documentation": null, + "id": 2346, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2333, + "modifierName": { + "argumentTypes": null, + "id": 2332, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "4835:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4835:10:8" + } + ], + "name": "getFinalTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2331, + "nodeType": "ParameterList", + "parameters": [], + "src": "4802:2:8" + }, + "returnParameters": { + "id": 2337, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2336, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 2346, + "src": "4863:23:8", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 2334, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4863:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2335, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4863:9:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4862:25:8" + }, + "scope": 4307, + "src": "4779:194:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2368, + "nodeType": "Block", + "src": "5093:104:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2356, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5112:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2358, + "indexExpression": { + "argumentTypes": null, + "id": 2357, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2348, + "src": "5121:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5112:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2359, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5112:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2360, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5135:15:8", + "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": 2355, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5104:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5104:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2362, + "nodeType": "ExpressionStatement", + "src": "5104:47:8" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2363, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5168:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2365, + "indexExpression": { + "argumentTypes": null, + "id": 2364, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2348, + "src": "5177:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5168:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2366, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "5168:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2354, + "id": 2367, + "nodeType": "Return", + "src": "5161:29:8" + } + ] + }, + "documentation": null, + "id": 2369, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2351, + "modifierName": { + "argumentTypes": null, + "id": 2350, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5055:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5055:10:8" + } + ], + "name": "getDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2349, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2348, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2369, + "src": "5010:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2347, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5010:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5009:15:8" + }, + "returnParameters": { + "id": 2354, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2353, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2369, + "src": "5083:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2352, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5083:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5082:6:8" + }, + "scope": 4307, + "src": "4979:218:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2378, + "nodeType": "Block", + "src": "5309:36:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2376, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "5326:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2375, + "id": 2377, + "nodeType": "Return", + "src": "5319:19:8" + } + ] + }, + "documentation": null, + "id": 2379, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2372, + "modifierName": { + "argumentTypes": null, + "id": 2371, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5271:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5271:10:8" + } + ], + "name": "getTotalDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2370, + "nodeType": "ParameterList", + "parameters": [], + "src": "5238:2:8" + }, + "returnParameters": { + "id": 2375, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2374, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2379, + "src": "5299:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2373, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5299:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5298:6:8" + }, + "scope": 4307, + "src": "5203:142:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2408, + "nodeType": "Block", + "src": "5463:154:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2389, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5482:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2391, + "indexExpression": { + "argumentTypes": null, + "id": 2390, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2381, + "src": "5491:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5482:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2392, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5482:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2393, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5505:15:8", + "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": 2388, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5474:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5474:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2395, + "nodeType": "ExpressionStatement", + "src": "5474:47:8" + }, + { + "assignments": [ + 2397 + ], + "declarations": [ + { + "constant": false, + "id": 2397, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2408, + "src": "5531:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2396, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5531:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2402, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2398, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5545:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2400, + "indexExpression": { + "argumentTypes": null, + "id": 2399, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2381, + "src": "5554:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5545:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2401, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "5545:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "5531:36:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2404, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2397, + "src": "5589:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2405, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "5597:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2403, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "5584:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5584:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2387, + "id": 2407, + "nodeType": "Return", + "src": "5577:33:8" + } + ] + }, + "documentation": null, + "id": 2409, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2384, + "modifierName": { + "argumentTypes": null, + "id": 2383, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5425:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5425:10:8" + } + ], + "name": "getNormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2382, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2381, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2409, + "src": "5380:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2380, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5380:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5379:15:8" + }, + "returnParameters": { + "id": 2387, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2386, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2409, + "src": "5453:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2385, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5453:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5452:6:8" + }, + "scope": 4307, + "src": "5351:266:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2431, + "nodeType": "Block", + "src": "5726:105:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2419, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5745:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2421, + "indexExpression": { + "argumentTypes": null, + "id": 2420, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2411, + "src": "5754:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5745:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "5745:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2423, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5768:15:8", + "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": 2418, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "5737:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2424, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5737:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2425, + "nodeType": "ExpressionStatement", + "src": "5737:47:8" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2426, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "5801:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2428, + "indexExpression": { + "argumentTypes": null, + "id": 2427, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2411, + "src": "5810:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5801:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2429, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "5801:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2417, + "id": 2430, + "nodeType": "Return", + "src": "5794:30:8" + } + ] + }, + "documentation": null, + "id": 2432, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2414, + "modifierName": { + "argumentTypes": null, + "id": 2413, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5688:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5688:10:8" + } + ], + "name": "getBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2412, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2411, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2432, + "src": "5643:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2410, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5643:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5642:15:8" + }, + "returnParameters": { + "id": 2417, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2416, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2432, + "src": "5716:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2415, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5716:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5715:6:8" + }, + "scope": 4307, + "src": "5623:208:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2441, + "nodeType": "Block", + "src": "5927:32:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2439, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "5944:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2438, + "id": 2440, + "nodeType": "Return", + "src": "5937:15:8" + } + ] + }, + "documentation": null, + "id": 2442, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2435, + "modifierName": { + "argumentTypes": null, + "id": 2434, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "5889:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5889:10:8" + } + ], + "name": "getSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2433, + "nodeType": "ParameterList", + "parameters": [], + "src": "5856:2:8" + }, + "returnParameters": { + "id": 2438, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2437, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2442, + "src": "5917:4:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2436, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5917:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5916:6:8" + }, + "scope": 4307, + "src": "5837:122:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2451, + "nodeType": "Block", + "src": "6061:35:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2449, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6078:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 2448, + "id": 2450, + "nodeType": "Return", + "src": "6071:18:8" + } + ] + }, + "documentation": null, + "id": 2452, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2445, + "modifierName": { + "argumentTypes": null, + "id": 2444, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "6020:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6020:10:8" + } + ], + "name": "getController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2443, + "nodeType": "ParameterList", + "parameters": [], + "src": "5987:2:8" + }, + "returnParameters": { + "id": 2448, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2447, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 2452, + "src": "6048:7:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2446, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6048:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6047:9:8" + }, + "scope": 4307, + "src": "5965:131:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2493, + "nodeType": "Block", + "src": "6187:256:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2463, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6206:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2462, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "6207:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6219:18:8", + "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": 2461, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6198:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2465, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6198:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2466, + "nodeType": "ExpressionStatement", + "src": "6198:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2468, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6256:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6256:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2470, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6270:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6256:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2472, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6283:20:8", + "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": 2467, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6248:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2473, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6248:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2474, + "nodeType": "ExpressionStatement", + "src": "6248:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2476, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6322:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2477, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 242, + "src": "6333:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6322:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f464545", + "id": 2479, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6342:13:8", + "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": 2475, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6314:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6314:42:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2481, + "nodeType": "ExpressionStatement", + "src": "6314:42:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2483, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6374:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2484, + "name": "MAX_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 247, + "src": "6385:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6374:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f464545", + "id": 2486, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6394:13:8", + "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": 2482, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6366:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2487, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6366:42:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2488, + "nodeType": "ExpressionStatement", + "src": "6366:42:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2491, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2489, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "6418:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2490, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2454, + "src": "6429:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6418:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2492, + "nodeType": "ExpressionStatement", + "src": "6418:18:8" + } + ] + }, + "documentation": null, + "id": 2494, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2457, + "modifierName": { + "argumentTypes": null, + "id": 2456, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6161:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6161:6:8" + }, + { + "arguments": null, + "id": 2459, + "modifierName": { + "argumentTypes": null, + "id": 2458, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6176:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6176:6:8" + } + ], + "name": "setSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2455, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2454, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 2494, + "src": "6122:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2453, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6122:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6121:14:8" + }, + "returnParameters": { + "id": 2460, + "nodeType": "ParameterList", + "parameters": [], + "src": "6187:0:8" + }, + "scope": 4307, + "src": "6102:341:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2515, + "nodeType": "Block", + "src": "6540:104:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2504, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6558:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6558:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2506, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6572:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6558:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6585:20:8", + "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": 2503, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6550:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6550:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2510, + "nodeType": "ExpressionStatement", + "src": "6550:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2513, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2511, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6616:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2512, + "name": "manager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2496, + "src": "6630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6616:21:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2514, + "nodeType": "ExpressionStatement", + "src": "6616:21:8" + } + ] + }, + "documentation": null, + "id": 2516, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2499, + "modifierName": { + "argumentTypes": null, + "id": 2498, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6514:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6514:6:8" + }, + { + "arguments": null, + "id": 2501, + "modifierName": { + "argumentTypes": null, + "id": 2500, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6529:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6529:6:8" + } + ], + "name": "setController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2497, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2496, + "name": "manager", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "6472:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2495, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6472:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6471:17:8" + }, + "returnParameters": { + "id": 2502, + "nodeType": "ParameterList", + "parameters": [], + "src": "6540:0:8" + }, + "scope": 4307, + "src": "6449:195:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2543, + "nodeType": "Block", + "src": "6739:154:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6757:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2526, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "6758:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2528, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6770:18:8", + "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": 2525, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6749:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2529, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6749:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2530, + "nodeType": "ExpressionStatement", + "src": "6749:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2532, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6807:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6807:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2534, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "6821:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6807:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6834:20:8", + "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": 2531, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6799:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6799:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2538, + "nodeType": "ExpressionStatement", + "src": "6799:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2539, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "6865:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2540, + "name": "public_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2518, + "src": "6879:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "6865:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2542, + "nodeType": "ExpressionStatement", + "src": "6865:21:8" + } + ] + }, + "documentation": null, + "id": 2544, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2521, + "modifierName": { + "argumentTypes": null, + "id": 2520, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6713:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6713:6:8" + }, + { + "arguments": null, + "id": 2523, + "modifierName": { + "argumentTypes": null, + "id": 2522, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6728:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6728:6:8" + } + ], + "name": "setPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2519, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2518, + "name": "public_", + "nodeType": "VariableDeclaration", + "scope": 2544, + "src": "6674:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 2517, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "6674:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6673:14:8" + }, + "returnParameters": { + "id": 2524, + "nodeType": "ParameterList", + "parameters": [], + "src": "6739:0:8" + }, + "scope": 4307, + "src": "6651:242:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2591, + "nodeType": "Block", + "src": "6970:347:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2555, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2552, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "6988:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2553, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6988:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2554, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "7002:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6988:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7015:20:8", + "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": 2551, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "6980:7:8", + "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": "6980:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2558, + "nodeType": "ExpressionStatement", + "src": "6980:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2561, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7054:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2560, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7055:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2562, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7067:18:8", + "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": 2559, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7046:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2563, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7046:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2564, + "nodeType": "ExpressionStatement", + "src": "7046:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2569, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2566, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7104:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2567, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7104:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2568, + "name": "MIN_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 232, + "src": "7122:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7104:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f544f4b454e53", + "id": 2570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7140:16:8", + "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": 2565, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7096:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7096:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2572, + "nodeType": "ExpressionStatement", + "src": "7096:61:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2575, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2573, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7168:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7181:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "7168:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2576, + "nodeType": "ExpressionStatement", + "src": "7168:17:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2579, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2577, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "7195:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2578, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7209:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "7195:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2580, + "nodeType": "ExpressionStatement", + "src": "7195:18:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2582, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 275, + "src": "7239:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2581, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "7224:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2583, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7224:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2584, + "nodeType": "ExpressionStatement", + "src": "7224:32:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2586, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "7281:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2587, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7281:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2588, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 275, + "src": "7293:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2585, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "7266:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7266:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2590, + "nodeType": "ExpressionStatement", + "src": "7266:44:8" + } + ] + }, + "documentation": null, + "id": 2592, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2547, + "modifierName": { + "argumentTypes": null, + "id": 2546, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "6944:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6944:6:8" + }, + { + "arguments": null, + "id": 2549, + "modifierName": { + "argumentTypes": null, + "id": 2548, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "6959:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6959:6:8" + } + ], + "name": "finalize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2545, + "nodeType": "ParameterList", + "parameters": [], + "src": "6916:2:8" + }, + "returnParameters": { + "id": 2550, + "nodeType": "ParameterList", + "parameters": [], + "src": "6970:0:8" + }, + "scope": 4307, + "src": "6899:418:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2658, + "nodeType": "Block", + "src": "7495:551:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2607, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2604, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "7513:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7513:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2606, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "7527:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "7513:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2608, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7540:20:8", + "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": 2603, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7505:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2609, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7505:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2610, + "nodeType": "ExpressionStatement", + "src": "7505:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7579:22:8", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2612, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "7580:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2614, + "indexExpression": { + "argumentTypes": null, + "id": 2613, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7589:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7580:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2615, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "7580:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f424f554e44", + "id": 2617, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7603:14:8", + "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": 2611, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7571:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2618, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7571:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2619, + "nodeType": "ExpressionStatement", + "src": "7571:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2622, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "7636:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2621, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "7637:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2623, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7649:18:8", + "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": 2620, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7628:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2624, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7628:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2625, + "nodeType": "ExpressionStatement", + "src": "7628:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2627, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7687:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2628, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7687:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2629, + "name": "MAX_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "7704:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7687:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f4b454e53", + "id": 2631, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7722:16:8", + "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": 2626, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "7679:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2632, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7679:60:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2633, + "nodeType": "ExpressionStatement", + "src": "7679:60:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2634, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "7750:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2636, + "indexExpression": { + "argumentTypes": null, + "id": 2635, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7759:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "7750:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "74727565", + "id": 2638, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7796:4:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2639, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7821:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2640, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7821:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2641, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7857:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2642, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7933:1:8", + "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": 2637, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2080, + "src": "7768:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$2080_storage_ptr_$", + "typeString": "type(struct SPool.Record storage pointer)" + } + }, + "id": 2643, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "7768:202:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_memory", + "typeString": "struct SPool.Record memory" + } + }, + "src": "7750:220:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2645, + "nodeType": "ExpressionStatement", + "src": "7750:220:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2649, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "7993:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 2646, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "7980:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2648, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7980:12:8", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 2650, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7980:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2651, + "nodeType": "ExpressionStatement", + "src": "7980:19:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2653, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2594, + "src": "8016:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2654, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2596, + "src": "8023:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2655, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2598, + "src": "8032:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2652, + "name": "rebind", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2831, + "src": "8009:6:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 2656, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8009:30:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2657, + "nodeType": "ExpressionStatement", + "src": "8009:30:8" + } + ] + }, + "documentation": null, + "id": 2659, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2601, + "modifierName": { + "argumentTypes": null, + "id": 2600, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "7405:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "7405:6:8" + } + ], + "name": "bind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2599, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2594, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7338:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2593, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7338:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2596, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7353:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2595, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7353:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2598, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2659, + "src": "7367:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2597, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7367:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "7337:42:8" + }, + "returnParameters": { + "id": 2602, + "nodeType": "ParameterList", + "parameters": [], + "src": "7495:0:8" + }, + "scope": 4307, + "src": "7324:722:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2830, + "nodeType": "Block", + "src": "8159:1496:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2676, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2673, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "8178:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8178:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2675, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "8192:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8178:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2677, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8205:20:8", + "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": 2672, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8170:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8170:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2679, + "nodeType": "ExpressionStatement", + "src": "8170:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2681, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8244:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2683, + "indexExpression": { + "argumentTypes": null, + "id": 2682, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8253:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8244:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2684, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "8244:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2685, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8267:15:8", + "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": 2680, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8236:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2686, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8236:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2687, + "nodeType": "ExpressionStatement", + "src": "8236:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2690, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8301:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2689, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "8302:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2691, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8314:18:8", + "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": 2688, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8293:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8293:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2693, + "nodeType": "ExpressionStatement", + "src": "8293:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2697, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2695, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8352:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2696, + "name": "MIN_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 253, + "src": "8362:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8352:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f574549474854", + "id": 2698, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8374:16:8", + "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": 2694, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8344:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8344:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2700, + "nodeType": "ExpressionStatement", + "src": "8344:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2704, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2702, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8409:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2703, + "name": "MAX_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "8419:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8409:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f574549474854", + "id": 2705, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8431:16:8", + "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": 2701, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8401:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8401:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2707, + "nodeType": "ExpressionStatement", + "src": "8401:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2711, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2709, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "8466:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2710, + "name": "MIN_BALANCE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 270, + "src": "8477:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8466:22:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f42414c414e4345", + "id": 2712, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8490:17:8", + "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": 2708, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8458:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2713, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8458:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2714, + "nodeType": "ExpressionStatement", + "src": "8458:50:8" + }, + { + "assignments": [ + 2716 + ], + "declarations": [ + { + "constant": false, + "id": 2716, + "name": "oldWeight", + "nodeType": "VariableDeclaration", + "scope": 2830, + "src": "8564:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2715, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8564:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2721, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2717, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8581:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2719, + "indexExpression": { + "argumentTypes": null, + "id": 2718, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8590:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8581:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2720, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "8581:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8564:39:8" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2724, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2722, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8617:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 2723, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8626:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8617:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2743, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8809:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2744, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8818:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8809:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 2757, + "nodeType": "IfStatement", + "src": "8805:107:8", + "trueBody": { + "id": 2756, + "nodeType": "Block", + "src": "8829:83:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2754, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2746, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8843:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2748, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8863:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2750, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8882:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2751, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8893:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2749, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8877:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2752, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8877:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2747, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8858:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8858:43:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8843:58:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2755, + "nodeType": "ExpressionStatement", + "src": "8843:58:8" + } + ] + } + }, + "id": 2758, + "nodeType": "IfStatement", + "src": "8613:299:8", + "trueBody": { + "id": 2742, + "nodeType": "Block", + "src": "8637:162:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 2733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2725, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8651:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2727, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8671:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2729, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8690:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2730, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2716, + "src": "8698:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2728, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "8685:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8685:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2726, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "8666:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2732, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8666:43:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8651:58:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2734, + "nodeType": "ExpressionStatement", + "src": "8651:58:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2736, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "8731:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2737, + "name": "MAX_TOTAL_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 263, + "src": "8747:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8731:32:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f54414c5f574549474854", + "id": 2739, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8765:22:8", + "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": 2735, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "8723:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8723:65:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2741, + "nodeType": "ExpressionStatement", + "src": "8723:65:8" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 2764, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2759, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "8929:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2761, + "indexExpression": { + "argumentTypes": null, + "id": 2760, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "8938:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8929:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2762, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "8929:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2763, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2665, + "src": "8954:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8929:31:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2765, + "nodeType": "ExpressionStatement", + "src": "8929:31:8" + }, + { + "assignments": [ + 2767 + ], + "declarations": [ + { + "constant": false, + "id": 2767, + "name": "oldBalance", + "nodeType": "VariableDeclaration", + "scope": 2830, + "src": "9033:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2766, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9033:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2772, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2768, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9051:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2770, + "indexExpression": { + "argumentTypes": null, + "id": 2769, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9060:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9051:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2771, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9051:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9033:41:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2778, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2773, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9084:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2775, + "indexExpression": { + "argumentTypes": null, + "id": 2774, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9093:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9084:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2776, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9084:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2777, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9110:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9084:33:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2779, + "nodeType": "ExpressionStatement", + "src": "9084:33:8" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2780, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9131:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 2781, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9141:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9131:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2794, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9249:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 2795, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9259:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9249:20:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 2828, + "nodeType": "IfStatement", + "src": "9245:404:8", + "trueBody": { + "id": 2827, + "nodeType": "Block", + "src": "9271:378:8", + "statements": [ + { + "assignments": [ + 2798 + ], + "declarations": [ + { + "constant": false, + "id": 2798, + "name": "tokenBalanceWithdrawn", + "nodeType": "VariableDeclaration", + "scope": 2827, + "src": "9362:26:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2797, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9362:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2803, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2800, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9396:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2801, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9408:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2799, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9391:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2802, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9391:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9362:54:8" + }, + { + "assignments": [ + 2805 + ], + "declarations": [ + { + "constant": false, + "id": 2805, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2827, + "src": "9430:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2804, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9430:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2810, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2807, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2798, + "src": "9455:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2808, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "9478:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2806, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "9450:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9450:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9430:57:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2812, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9517:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2813, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9524:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9524:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2816, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2798, + "src": "9541:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2817, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2805, + "src": "9564:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2815, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9536:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9536:41:8", + "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": 2811, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "9501:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9501:77:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2820, + "nodeType": "ExpressionStatement", + "src": "9501:77:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2822, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9608:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2823, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "9615:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2824, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2805, + "src": "9625:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2821, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "9592:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9592:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2826, + "nodeType": "ExpressionStatement", + "src": "9592:46:8" + } + ] + } + }, + "id": 2829, + "nodeType": "IfStatement", + "src": "9127:522:8", + "trueBody": { + "id": 2793, + "nodeType": "Block", + "src": "9153:86:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2784, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2661, + "src": "9183:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2785, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9190:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2786, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9190:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2788, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2663, + "src": "9207:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2789, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2767, + "src": "9216:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2787, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "9202:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9202:25:8", + "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": 2783, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "9167:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2791, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9167:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2792, + "nodeType": "ExpressionStatement", + "src": "9167:61:8" + } + ] + } + } + ] + }, + "documentation": null, + "id": 2831, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2668, + "modifierName": { + "argumentTypes": null, + "id": 2667, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "8133:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8133:6:8" + }, + { + "arguments": null, + "id": 2670, + "modifierName": { + "argumentTypes": null, + "id": 2669, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "8148:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8148:6:8" + } + ], + "name": "rebind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2666, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2661, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8068:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2660, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8068:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2663, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8083:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2662, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8083:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2665, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 2831, + "src": "8097:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2664, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8097:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8067:42:8" + }, + "returnParameters": { + "id": 2671, + "nodeType": "ParameterList", + "parameters": [], + "src": "8159:0:8" + }, + "scope": 4307, + "src": "8052:1603:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2949, + "nodeType": "Block", + "src": "9743:928:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2841, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "9762:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9762:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2843, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2163, + "src": "9776:11:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "9762:25:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2845, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9789:20:8", + "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": 2840, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9754:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9754:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2847, + "nodeType": "ExpressionStatement", + "src": "9754:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2849, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9828:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2851, + "indexExpression": { + "argumentTypes": null, + "id": 2850, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "9837:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9828:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2852, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "9828:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2853, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9851:15:8", + "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": 2848, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9820:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2854, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9820:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2855, + "nodeType": "ExpressionStatement", + "src": "9820:47:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "9885:11:8", + "subExpression": { + "argumentTypes": null, + "id": 2857, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "9886:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2859, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9898:18:8", + "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": 2856, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "9877:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2860, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9877:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2861, + "nodeType": "ExpressionStatement", + "src": "9877:40:8" + }, + { + "assignments": [ + 2863 + ], + "declarations": [ + { + "constant": false, + "id": 2863, + "name": "tokenBalance", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "9928:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2862, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9928:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2868, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2864, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9948:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2866, + "indexExpression": { + "argumentTypes": null, + "id": 2865, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "9957:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9948:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2867, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "9948:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9928:43:8" + }, + { + "assignments": [ + 2870 + ], + "declarations": [ + { + "constant": false, + "id": 2870, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "9981:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2869, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9981:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2875, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2872, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2863, + "src": "10006:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2873, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "10020:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2871, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "10001:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2874, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10001:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9981:48:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2876, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "10040:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2878, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "10060:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2879, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10074:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2881, + "indexExpression": { + "argumentTypes": null, + "id": 2880, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10083:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10074:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2882, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "10074:22:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2877, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "10055:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10055:42:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10040:57:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2885, + "nodeType": "ExpressionStatement", + "src": "10040:57:8" + }, + { + "assignments": [ + 2887 + ], + "declarations": [ + { + "constant": false, + "id": 2887, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "10203:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2886, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10203:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2892, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2888, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10216:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2890, + "indexExpression": { + "argumentTypes": null, + "id": 2889, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10225:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10216:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2891, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 2075, + "src": "10216:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10203:34:8" + }, + { + "assignments": [ + 2894 + ], + "declarations": [ + { + "constant": false, + "id": 2894, + "name": "last", + "nodeType": "VariableDeclaration", + "scope": 2949, + "src": "10247:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2893, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10247:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2899, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2895, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10259:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2896, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10259:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 2897, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10276:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "10259:18:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10247:30:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2900, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10287:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2902, + "indexExpression": { + "argumentTypes": null, + "id": 2901, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10295:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10287:14:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2903, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10304:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2905, + "indexExpression": { + "argumentTypes": null, + "id": 2904, + "name": "last", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2894, + "src": "10312:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10304:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "10287:30:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2907, + "nodeType": "ExpressionStatement", + "src": "10287:30:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2915, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2908, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10327:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2912, + "indexExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2909, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10336:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2911, + "indexExpression": { + "argumentTypes": null, + "id": 2910, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10344:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10336:14:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10327:24:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2913, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 2075, + "src": "10327:30:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2914, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2887, + "src": "10360:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10327:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2916, + "nodeType": "ExpressionStatement", + "src": "10327:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2917, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "10375:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2919, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "pop", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10375:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypop_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 2920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10375:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2921, + "nodeType": "ExpressionStatement", + "src": "10375:13:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2931, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2922, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10398:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2924, + "indexExpression": { + "argumentTypes": null, + "id": 2923, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10407:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "10398:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2926, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10444:5:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2927, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10470:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2928, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10493:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2929, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10517:1:8", + "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": 2925, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2080, + "src": "10416:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$2080_storage_ptr_$", + "typeString": "type(struct SPool.Record storage pointer)" + } + }, + "id": 2930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "10416:113:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_memory", + "typeString": "struct SPool.Record memory" + } + }, + "src": "10398:131:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2932, + "nodeType": "ExpressionStatement", + "src": "10398:131:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2934, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10556:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2935, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "10563:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10563:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2938, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2863, + "src": "10580:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2939, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2870, + "src": "10594:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2937, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "10575:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2940, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10575:32:8", + "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": 2933, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "10540:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2941, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10540:68:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2942, + "nodeType": "ExpressionStatement", + "src": "10540:68:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2944, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2833, + "src": "10634:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2945, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "10641:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2946, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2870, + "src": "10651:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2943, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "10618:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2947, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10618:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2948, + "nodeType": "ExpressionStatement", + "src": "10618:46:8" + } + ] + }, + "documentation": null, + "id": 2950, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2836, + "modifierName": { + "argumentTypes": null, + "id": 2835, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "9717:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9717:6:8" + }, + { + "arguments": null, + "id": 2838, + "modifierName": { + "argumentTypes": null, + "id": 2837, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "9732:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9732:6:8" + } + ], + "name": "unbind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2834, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2833, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2950, + "src": "9677:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2832, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9677:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9676:15:8" + }, + "returnParameters": { + "id": 2839, + "nodeType": "ParameterList", + "parameters": [], + "src": "9743:0:8" + }, + "scope": 4307, + "src": "9661:1010:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2981, + "nodeType": "Block", + "src": "10833:138:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2960, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10851:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2962, + "indexExpression": { + "argumentTypes": null, + "id": 2961, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10860:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10851:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "10851:21:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10874:15:8", + "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": 2959, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "10843:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2965, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10843:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2966, + "nodeType": "ExpressionStatement", + "src": "10843:47:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 2979, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2967, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "10900:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2969, + "indexExpression": { + "argumentTypes": null, + "id": 2968, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10909:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10900:15:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2970, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "10900:23:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2976, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5675, + "src": "10958:4:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + ], + "id": 2975, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10950:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2977, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10950:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2972, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2952, + "src": "10933:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2971, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "10926:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 2973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10926:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 2974, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 1386, + "src": "10926:23:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 2978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10926:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10900:64:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2980, + "nodeType": "ExpressionStatement", + "src": "10900:64:8" + } + ] + }, + "documentation": null, + "id": 2982, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2955, + "modifierName": { + "argumentTypes": null, + "id": 2954, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "10807:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10807:6:8" + }, + { + "arguments": null, + "id": 2957, + "modifierName": { + "argumentTypes": null, + "id": 2956, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "10822:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10822:6:8" + } + ], + "name": "gulp", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2953, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2952, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2982, + "src": "10767:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2951, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10767:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10766:15:8" + }, + "returnParameters": { + "id": 2958, + "nodeType": "ParameterList", + "parameters": [], + "src": "10833:0:8" + }, + "scope": 4307, + "src": "10753:218:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3033, + "nodeType": "Block", + "src": "11112:420:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2994, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11130:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 2996, + "indexExpression": { + "argumentTypes": null, + "id": 2995, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2984, + "src": "11139:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11130:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 2997, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11130:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2998, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11155:15:8", + "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": 2993, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11122:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11122:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3000, + "nodeType": "ExpressionStatement", + "src": "11122:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3002, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11189:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3004, + "indexExpression": { + "argumentTypes": null, + "id": 3003, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2986, + "src": "11198:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11189:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3005, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11189:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3006, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11215:15:8", + "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": 3001, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11181:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11181:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3008, + "nodeType": "ExpressionStatement", + "src": "11181:50:8" + }, + { + "assignments": [ + 3010 + ], + "declarations": [ + { + "constant": false, + "id": 3010, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3033, + "src": "11241:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3009, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11241:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3014, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3011, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11267:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3013, + "indexExpression": { + "argumentTypes": null, + "id": 3012, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2984, + "src": "11276:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11267:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11241:43:8" + }, + { + "assignments": [ + 3016 + ], + "declarations": [ + { + "constant": false, + "id": 3016, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3033, + "src": "11294:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3015, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11294:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3020, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3017, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11321:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3019, + "indexExpression": { + "argumentTypes": null, + "id": 3018, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2986, + "src": "11330:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11321:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11294:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3022, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3010, + "src": "11383:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3023, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11383:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3024, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3010, + "src": "11414:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3025, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11414:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3026, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3016, + "src": "11444:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3027, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11444:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3028, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3016, + "src": "11476:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3029, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11476:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3030, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "11507:8:8", + "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": 3021, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "11356:13:8", + "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": 3031, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11356:169:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2992, + "id": 3032, + "nodeType": "Return", + "src": "11349:176:8" + } + ] + }, + "documentation": null, + "id": 3034, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2989, + "modifierName": { + "argumentTypes": null, + "id": 2988, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "11064:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11064:10:8" + } + ], + "name": "getSpotPrice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2987, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2984, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "10999:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2983, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10999:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2986, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "11016:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2985, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11016:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10998:35:8" + }, + "returnParameters": { + "id": 2992, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2991, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 3034, + "src": "11092:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2990, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11092:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11091:16:8" + }, + "scope": 4307, + "src": "10977:555:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3085, + "nodeType": "Block", + "src": "11680:413:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3046, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11698:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3048, + "indexExpression": { + "argumentTypes": null, + "id": 3047, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3036, + "src": "11707:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11698:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3049, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11698:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3050, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11723:15:8", + "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": 3045, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11690:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11690:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3052, + "nodeType": "ExpressionStatement", + "src": "11690:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3054, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11757:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3056, + "indexExpression": { + "argumentTypes": null, + "id": 3055, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3038, + "src": "11766:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11757:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "11757:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3058, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11783:15:8", + "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": 3053, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "11749:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3059, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11749:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3060, + "nodeType": "ExpressionStatement", + "src": "11749:50:8" + }, + { + "assignments": [ + 3062 + ], + "declarations": [ + { + "constant": false, + "id": 3062, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3085, + "src": "11809:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3061, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11809:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3066, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3063, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11835:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3065, + "indexExpression": { + "argumentTypes": null, + "id": 3064, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3036, + "src": "11844:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11835:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11809:43:8" + }, + { + "assignments": [ + 3068 + ], + "declarations": [ + { + "constant": false, + "id": 3068, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3085, + "src": "11862:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3067, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "11862:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3072, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3069, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "11889:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3071, + "indexExpression": { + "argumentTypes": null, + "id": 3070, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3038, + "src": "11898:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11889:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11862:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3074, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3062, + "src": "11951:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3075, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "11951:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3076, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3062, + "src": "11982:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3077, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "11982:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3078, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3068, + "src": "12012:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3079, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12012:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3080, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3068, + "src": "12044:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3081, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "12044:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 3082, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12075:1:8", + "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": 3073, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "11924:13:8", + "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": 3083, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11924:162:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3044, + "id": 3084, + "nodeType": "Return", + "src": "11917:169:8" + } + ] + }, + "documentation": null, + "id": 3086, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3041, + "modifierName": { + "argumentTypes": null, + "id": 3040, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2157, + "src": "11632:10:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11632:10:8" + } + ], + "name": "getSpotPriceSansFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3039, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3036, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11567:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3035, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11567:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3038, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11584:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3037, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11584:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11566:35:8" + }, + "returnParameters": { + "id": 3044, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3043, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 3086, + "src": "11660:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3042, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11660:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11659:16:8" + }, + "scope": 4307, + "src": "11538:555:8", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3208, + "nodeType": "Block", + "src": "12218:806:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3099, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "12236:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3100, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12248:19:8", + "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": 3098, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12228:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12228:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3102, + "nodeType": "ExpressionStatement", + "src": "12228:40:8" + }, + { + "assignments": [ + 3104 + ], + "declarations": [ + { + "constant": false, + "id": 3104, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 3208, + "src": "12279:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3103, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12279:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3107, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 3105, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1695, + "src": "12296:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 3106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12296:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12279:30:8" + }, + { + "assignments": [ + 3109 + ], + "declarations": [ + { + "constant": false, + "id": 3109, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 3208, + "src": "12319:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3108, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12319:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3114, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3111, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "12337:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3112, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3104, + "src": "12352:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3110, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "12332:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12332:30:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12319:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3116, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3109, + "src": "12380:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3117, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12389:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12380:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3119, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12392:17:8", + "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": 3115, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12372:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3121, + "nodeType": "ExpressionStatement", + "src": "12372:38:8" + }, + { + "body": { + "id": 3196, + "nodeType": "Block", + "src": "12463:465:8", + "statements": [ + { + "assignments": [ + 3134 + ], + "declarations": [ + { + "constant": false, + "id": 3134, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12477:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3133, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12477:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3138, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3135, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "12489:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3137, + "indexExpression": { + "argumentTypes": null, + "id": 3136, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12497:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12489:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12477:22:8" + }, + { + "assignments": [ + 3140 + ], + "declarations": [ + { + "constant": false, + "id": 3140, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12513:8:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3139, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12513:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3145, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3141, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12524:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3143, + "indexExpression": { + "argumentTypes": null, + "id": 3142, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12533:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12524:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3144, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12524:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12513:30:8" + }, + { + "assignments": [ + 3147 + ], + "declarations": [ + { + "constant": false, + "id": 3147, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3196, + "src": "12557:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3146, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12557:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3152, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3149, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3109, + "src": "12583:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3150, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3140, + "src": "12590:3:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3148, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "12578:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12578:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12557:37:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3156, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3154, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12616:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3155, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12633:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12616:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12636:17:8", + "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": 3153, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12608:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12608:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3159, + "nodeType": "ExpressionStatement", + "src": "12608:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3161, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12676:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3162, + "name": "maxAmountsIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3091, + "src": "12693:12:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 3164, + "indexExpression": { + "argumentTypes": null, + "id": 3163, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12706:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12693:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12676:32:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3166, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12710:14:8", + "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": 3160, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "12668:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12668:57:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3168, + "nodeType": "ExpressionStatement", + "src": "12668:57:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3169, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12739:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3171, + "indexExpression": { + "argumentTypes": null, + "id": 3170, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12748:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12739:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3172, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12739:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3174, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "12766:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3176, + "indexExpression": { + "argumentTypes": null, + "id": 3175, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12775:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12766:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3177, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "12766:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3178, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12787:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3173, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "12761:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3179, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12761:40:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12739:62:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3181, + "nodeType": "ExpressionStatement", + "src": "12739:62:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3183, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12829:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3184, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12829:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3185, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12841:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3186, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12844:13:8", + "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": 3182, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "12820:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3187, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12820:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3188, + "nodeType": "EmitStatement", + "src": "12815:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3190, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "12888:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3191, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12891:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12891:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3193, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3147, + "src": "12903:13:8", + "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": 3189, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "12872:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12872:45:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3195, + "nodeType": "ExpressionStatement", + "src": "12872:45:8" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3126, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12438:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3127, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "12442:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3128, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12442:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12438:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 3197, + "initializationExpression": { + "assignments": [ + 3123 + ], + "declarations": [ + { + "constant": false, + "id": 3123, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 3197, + "src": "12426:6:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3122, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12426:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3125, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 3124, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12435:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12426:10:8" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 3131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12458:3:8", + "subExpression": { + "argumentTypes": null, + "id": 3130, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3123, + "src": "12458:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3132, + "nodeType": "ExpressionStatement", + "src": "12458:3:8" + }, + "nodeType": "ForStatement", + "src": "12421:507:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3199, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "12952:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3198, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "12937:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12937:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3201, + "nodeType": "ExpressionStatement", + "src": "12937:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "12991:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12991:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3205, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3088, + "src": "13003:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3202, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "12976:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12976:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3207, + "nodeType": "ExpressionStatement", + "src": "12976:41:8" + } + ] + }, + "documentation": null, + "id": 3209, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3094, + "modifierName": { + "argumentTypes": null, + "id": 3093, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "12192:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12192:6:8" + }, + { + "arguments": null, + "id": 3096, + "modifierName": { + "argumentTypes": null, + "id": 3095, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "12207:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12207:6:8" + } + ], + "name": "joinPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3092, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3088, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3209, + "src": "12117:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3087, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12117:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3091, + "name": "maxAmountsIn", + "nodeType": "VariableDeclaration", + "scope": 3209, + "src": "12137:28:8", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 3089, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12137:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3090, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12137:6:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12116:50:8" + }, + "returnParameters": { + "id": 3097, + "nodeType": "ParameterList", + "parameters": [], + "src": "12218:0:8" + }, + "scope": 4307, + "src": "12099:925:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3350, + "nodeType": "Block", + "src": "13149:975:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3222, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "13167:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13179:19:8", + "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": 3221, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13159:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3224, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13159:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3225, + "nodeType": "ExpressionStatement", + "src": "13159:40:8" + }, + { + "assignments": [ + 3227 + ], + "declarations": [ + { + "constant": false, + "id": 3227, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13210:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3226, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13210:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3230, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 3228, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1695, + "src": "13227:11:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 3229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13227:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13210:30:8" + }, + { + "assignments": [ + 3232 + ], + "declarations": [ + { + "constant": false, + "id": 3232, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13250:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3231, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13250:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3237, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3234, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13270:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3235, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "13284:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3233, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "13265:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3236, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13265:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13250:43:8" + }, + { + "assignments": [ + 3239 + ], + "declarations": [ + { + "constant": false, + "id": 3239, + "name": "pAiAfterExitFee", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13303:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3238, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13303:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3244, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3241, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13331:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3242, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3232, + "src": "13345:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3240, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "13326:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13326:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13303:50:8" + }, + { + "assignments": [ + 3246 + ], + "declarations": [ + { + "constant": false, + "id": 3246, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 3350, + "src": "13363:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3245, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13363:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3251, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3248, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3239, + "src": "13381:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3249, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3227, + "src": "13398:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3247, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "13376:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13376:32:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13363:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3253, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3246, + "src": "13426:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13435:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13426:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13438:17:8", + "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": 3252, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13418:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13418:38:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3258, + "nodeType": "ExpressionStatement", + "src": "13418:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3260, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "13482:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13482:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3262, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3211, + "src": "13494:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3259, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "13467:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13467:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3264, + "nodeType": "ExpressionStatement", + "src": "13467:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3266, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "13532:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3267, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3232, + "src": "13542:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3265, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "13517:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13517:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3269, + "nodeType": "ExpressionStatement", + "src": "13517:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3271, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3239, + "src": "13575:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3270, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "13560:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13560:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3273, + "nodeType": "ExpressionStatement", + "src": "13560:31:8" + }, + { + "body": { + "id": 3348, + "nodeType": "Block", + "src": "13644:473:8", + "statements": [ + { + "assignments": [ + 3286 + ], + "declarations": [ + { + "constant": false, + "id": 3286, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13658:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3285, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "13658:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3290, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3287, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "13670:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3289, + "indexExpression": { + "argumentTypes": null, + "id": 3288, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13678:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13670:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13658:22:8" + }, + { + "assignments": [ + 3292 + ], + "declarations": [ + { + "constant": false, + "id": 3292, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13694:8:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3291, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13694:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3297, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3293, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13705:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3295, + "indexExpression": { + "argumentTypes": null, + "id": 3294, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13714:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13705:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3296, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13705:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13694:30:8" + }, + { + "assignments": [ + 3299 + ], + "declarations": [ + { + "constant": false, + "id": 3299, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3348, + "src": "13738:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3298, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13738:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3304, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3301, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3246, + "src": "13765:5:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3302, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3292, + "src": "13772:3:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3300, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "13760:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13760:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13738:38:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3306, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13798:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3307, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13816:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13798:19:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13819:17:8", + "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": 3305, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13790:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13790:47:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3311, + "nodeType": "ExpressionStatement", + "src": "13790:47:8" + }, + { + "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": 3313, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13859:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3314, + "name": "minAmountsOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3214, + "src": "13877:13:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 3316, + "indexExpression": { + "argumentTypes": null, + "id": 3315, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13891:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13877:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13859:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3318, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13895:15:8", + "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": 3312, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "13851:7:8", + "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": "13851:60:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3320, + "nodeType": "ExpressionStatement", + "src": "13851:60:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3321, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13925:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3323, + "indexExpression": { + "argumentTypes": null, + "id": 3322, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13934:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13925:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3324, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13925:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3326, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "13952:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3328, + "indexExpression": { + "argumentTypes": null, + "id": 3327, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "13961:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "13952:11:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3329, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "13952:19:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3330, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "13973:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3325, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "13947:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13947:41:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13925:63:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3333, + "nodeType": "ExpressionStatement", + "src": "13925:63:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3335, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "14016:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14016:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3337, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "14028:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3338, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "14031:14:8", + "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": 3334, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "14007:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3339, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14007:39:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3340, + "nodeType": "EmitStatement", + "src": "14002:44:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3342, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3286, + "src": "14076:1:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3343, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "14079:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14079:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3345, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3299, + "src": "14091:14:8", + "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": 3341, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "14060:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14060:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3347, + "nodeType": "ExpressionStatement", + "src": "14060:46:8" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3281, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3278, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13619:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3279, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2172, + "src": "13623:7:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 3280, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "13623:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13619:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 3349, + "initializationExpression": { + "assignments": [ + 3275 + ], + "declarations": [ + { + "constant": false, + "id": 3275, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 3349, + "src": "13607:6:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3274, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13607:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3277, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 3276, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13616:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "13607:10:8" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 3283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "13639:3:8", + "subExpression": { + "argumentTypes": null, + "id": 3282, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3275, + "src": "13639:1:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3284, + "nodeType": "ExpressionStatement", + "src": "13639:3:8" + }, + "nodeType": "ForStatement", + "src": "13602:515:8" + } + ] + }, + "documentation": null, + "id": 3351, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3217, + "modifierName": { + "argumentTypes": null, + "id": 3216, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "13123:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "13123:6:8" + }, + { + "arguments": null, + "id": 3219, + "modifierName": { + "argumentTypes": null, + "id": 3218, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "13138:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "13138:6:8" + } + ], + "name": "exitPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3215, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3211, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3351, + "src": "13048:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3210, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13048:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3214, + "name": "minAmountsOut", + "nodeType": "VariableDeclaration", + "scope": 3351, + "src": "13067:29:8", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 3212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13067:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3213, + "length": null, + "nodeType": "ArrayTypeName", + "src": "13067:6:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "13047:50:8" + }, + "returnParameters": { + "id": 3220, + "nodeType": "ParameterList", + "parameters": [], + "src": "13149:0:8" + }, + "scope": 4307, + "src": "13030:1094:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3548, + "nodeType": "Block", + "src": "14403:1921:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3373, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14422:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3375, + "indexExpression": { + "argumentTypes": null, + "id": 3374, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "14431:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14422:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3376, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "14422:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14447:15:8", + "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": 3372, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14414:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14414:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3379, + "nodeType": "ExpressionStatement", + "src": "14414:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3381, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14481:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3383, + "indexExpression": { + "argumentTypes": null, + "id": 3382, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "14490:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14481:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3384, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "14481:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3385, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14507:15:8", + "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": 3380, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14473:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14473:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3387, + "nodeType": "ExpressionStatement", + "src": "14473:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3389, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "14541:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 3390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14554:21:8", + "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": 3388, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14533:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14533:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3392, + "nodeType": "ExpressionStatement", + "src": "14533:43:8" + }, + { + "assignments": [ + 3394 + ], + "declarations": [ + { + "constant": false, + "id": 3394, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14587:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3393, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "14587:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3400, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3395, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14613:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3399, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3397, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "14630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3396, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14622:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14622:16:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14613:26:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14587:52:8" + }, + { + "assignments": [ + 3402 + ], + "declarations": [ + { + "constant": false, + "id": 3402, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14649:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3401, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "14649:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3408, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3403, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "14676:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3407, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3405, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "14693:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3404, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "14685:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14685:17:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "14676:27:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14649:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3410, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "14735:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3412, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14757:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3413, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14757:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3414, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "14775:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3411, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "14752:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14752:36:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14735:53:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3417, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14803:18:8", + "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": 3409, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "14714:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14714:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3419, + "nodeType": "ExpressionStatement", + "src": "14714:117:8" + }, + { + "assignments": [ + 3421 + ], + "declarations": [ + { + "constant": false, + "id": 3421, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 3548, + "src": "14842:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3420, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14842:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3433, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3423, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14892:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3424, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14892:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3425, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "14922:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3426, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "14922:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3427, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "14951:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3428, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "14951:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3429, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "14982:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "14982:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3431, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15012:8:8", + "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": 3422, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "14865:13:8", + "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": 3432, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14865:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "14842:188:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3435, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15048:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3436, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3361, + "src": "15067:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15048:27:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 3438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15077:21:8", + "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": 3434, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15040:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3439, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15040:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3440, + "nodeType": "ExpressionStatement", + "src": "15040:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3441, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15110:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3443, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15155:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3444, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15155:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3445, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15185:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15185:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3447, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15214:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3448, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15214:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3449, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15245:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3450, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15245:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3451, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15275:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3452, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15302:8:8", + "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": 3442, + "name": "calcOutGivenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 443, + "src": "15127:14:8", + "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": 3453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15127:193:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15110:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3455, + "nodeType": "ExpressionStatement", + "src": "15110:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3457, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15338:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3458, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3359, + "src": "15356:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15338:30:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3460, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15370:15:8", + "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": 3456, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15330:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3461, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15330:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3462, + "nodeType": "ExpressionStatement", + "src": "15330:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3471, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3463, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15397:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3465, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15397:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3467, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15421:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3468, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15421:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3469, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15439:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3466, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "15416:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3470, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15416:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15397:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3472, + "nodeType": "ExpressionStatement", + "src": "15397:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3473, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15463:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3475, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15463:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3477, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15488:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3478, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15488:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3479, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15507:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3476, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "15483:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15483:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15463:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3482, + "nodeType": "ExpressionStatement", + "src": "15463:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3495, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3483, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15533:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3485, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15577:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3486, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15577:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3487, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3394, + "src": "15607:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3488, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15607:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3489, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15636:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3490, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "15636:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3491, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3402, + "src": "15667:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3492, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "15667:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3493, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "15697:8:8", + "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": 3484, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "15550:13:8", + "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": 3494, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15550:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15533:182:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3496, + "nodeType": "ExpressionStatement", + "src": "15533:182:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3500, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3498, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15733:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3499, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15751:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15733:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3501, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15768:17:8", + "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": 3497, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15725:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15725:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3503, + "nodeType": "ExpressionStatement", + "src": "15725:61:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3505, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "15809:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3506, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3361, + "src": "15827:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15809:26:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 3508, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15837:17:8", + "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": 3504, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15801:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15801:54:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3510, + "nodeType": "ExpressionStatement", + "src": "15801:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3517, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3512, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3421, + "src": "15886:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3514, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "15910:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3515, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "15925:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3513, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "15905:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3516, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15905:35:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15886:54:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3518, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15955:17:8", + "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": 3511, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "15865:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3519, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15865:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3520, + "nodeType": "ExpressionStatement", + "src": "15865:117:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3522, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16020:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3523, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16020:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3524, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "16045:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3525, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "16067:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3526, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "16090:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3527, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16118:14:8", + "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": 3521, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "15998:8:8", + "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": 3528, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15998:144:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3529, + "nodeType": "EmitStatement", + "src": "15993:149:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3531, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3353, + "src": "16169:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3532, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16178:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16178:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3534, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3355, + "src": "16190:13:8", + "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": 3530, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "16153:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16153:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3536, + "nodeType": "ExpressionStatement", + "src": "16153:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3538, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3357, + "src": "16230:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3539, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "16240:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3540, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16240:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3541, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16252:14:8", + "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": 3537, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "16214:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3542, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16214:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3543, + "nodeType": "ExpressionStatement", + "src": "16214:53:8" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 3544, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3368, + "src": "16286:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3545, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3370, + "src": "16302:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 3546, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "16285:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 3371, + "id": 3547, + "nodeType": "Return", + "src": "16278:39:8" + } + ] + }, + "documentation": null, + "id": 3549, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3364, + "modifierName": { + "argumentTypes": null, + "id": 3363, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "14318:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14318:6:8" + }, + { + "arguments": null, + "id": 3366, + "modifierName": { + "argumentTypes": null, + "id": 3365, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "14333:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14333:6:8" + } + ], + "name": "swapExactAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3362, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3353, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14167:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3352, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14167:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3355, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14192:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3354, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14192:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3357, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14220:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3356, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14220:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3359, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14246:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3358, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14246:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3361, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14273:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3360, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14273:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14157:135:8" + }, + "returnParameters": { + "id": 3371, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3368, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14357:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3367, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14357:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3370, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 3549, + "src": "14378:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3369, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14378:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14356:42:8" + }, + "scope": 4307, + "src": "14131:2193:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3746, + "nodeType": "Block", + "src": "16603:1924:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3571, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16621:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3573, + "indexExpression": { + "argumentTypes": null, + "id": 3572, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "16630:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16621:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3574, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "16621:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3575, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16646:15:8", + "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": 3570, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16613:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3576, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16613:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3577, + "nodeType": "ExpressionStatement", + "src": "16613:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3579, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16680:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3581, + "indexExpression": { + "argumentTypes": null, + "id": 3580, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "16689:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16680:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3582, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "16680:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16706:15:8", + "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": 3578, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16672:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16672:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3585, + "nodeType": "ExpressionStatement", + "src": "16672:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3587, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2165, + "src": "16740:11:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 3588, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16753:21:8", + "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": 3586, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16732:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16732:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3590, + "nodeType": "ExpressionStatement", + "src": "16732:43:8" + }, + { + "assignments": [ + 3592 + ], + "declarations": [ + { + "constant": false, + "id": 3592, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "16786:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3591, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "16786:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3598, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3593, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16812:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3597, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3595, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "16829:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3594, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16821:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3596, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16821:16:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16812:26:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16786:52:8" + }, + { + "assignments": [ + 3600 + ], + "declarations": [ + { + "constant": false, + "id": 3600, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "16848:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3599, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "16848:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3606, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3601, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "16875:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3605, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3603, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "16892:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3602, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "16884:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3604, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16884:17:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "16875:27:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "16848:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3614, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3608, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "16934:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3610, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "16957:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3611, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "16957:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3612, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "16976:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3609, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "16952:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3613, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16952:38:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16934:56:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3615, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17005:19:8", + "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": 3607, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "16913:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3616, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16913:121:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3617, + "nodeType": "ExpressionStatement", + "src": "16913:121:8" + }, + { + "assignments": [ + 3619 + ], + "declarations": [ + { + "constant": false, + "id": 3619, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 3746, + "src": "17045:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3618, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17045:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3631, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3621, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17095:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3622, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17095:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3623, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17125:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3624, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17125:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3625, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17154:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3626, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17154:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3627, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17185:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3628, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17185:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3629, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17215:8:8", + "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": 3620, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "17068:13:8", + "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": 3630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17068:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17045:188:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3633, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "17260:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3634, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3559, + "src": "17279:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17260:27:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 3636, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17289:21:8", + "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": 3632, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17252:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17252:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3638, + "nodeType": "ExpressionStatement", + "src": "17252:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3652, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3639, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17322:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3641, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17366:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3642, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17366:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3643, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17396:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3644, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17396:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3645, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17425:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3646, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17425:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3647, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17456:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3648, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17456:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3649, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17486:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3650, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17514:8:8", + "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": 3640, + "name": "calcInGivenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "17338:14:8", + "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": 3651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17338:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17322:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3653, + "nodeType": "ExpressionStatement", + "src": "17322:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3655, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17550:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3656, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3553, + "src": "17567:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17550:28:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3658, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17580:14:8", + "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": 3654, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17542:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3659, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17542:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3660, + "nodeType": "ExpressionStatement", + "src": "17542:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3669, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3661, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17606:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3663, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17606:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3665, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17630:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3666, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17630:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3667, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "17648:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3664, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "17625:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17625:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17606:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3670, + "nodeType": "ExpressionStatement", + "src": "17606:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3671, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17672:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3673, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17672:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3675, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17697:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3676, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17697:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3677, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17716:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3674, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "17692:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3678, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17692:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17672:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3680, + "nodeType": "ExpressionStatement", + "src": "17672:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3681, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "17742:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3683, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17786:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3684, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17786:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3685, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3592, + "src": "17816:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3686, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17816:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3687, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17845:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3688, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "17845:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3689, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3600, + "src": "17876:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3690, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "17876:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3691, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "17906:8:8", + "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": 3682, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 371, + "src": "17759:13:8", + "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": 3692, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17759:165:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17742:182:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3694, + "nodeType": "ExpressionStatement", + "src": "17742:182:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3698, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3696, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "17942:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3697, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "17960:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17942:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3699, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17977:17:8", + "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": 3695, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "17934:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3700, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17934:61:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3701, + "nodeType": "ExpressionStatement", + "src": "17934:61:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3705, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3703, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "18013:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3704, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3559, + "src": "18031:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18013:26:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 3706, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18041:17:8", + "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": 3702, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18005:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18005:54:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3708, + "nodeType": "ExpressionStatement", + "src": "18005:54:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3715, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3710, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3619, + "src": "18090:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3712, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18114:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3713, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18129:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3711, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1104, + "src": "18109:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3714, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18109:35:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18090:54:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3716, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18159:17:8", + "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": 3709, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18069:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3717, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18069:117:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3718, + "nodeType": "ExpressionStatement", + "src": "18069:117:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3720, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18224:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18224:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3722, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "18249:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3723, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "18271:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3724, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18294:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3725, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18322:14:8", + "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": 3719, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2092, + "src": "18202:8:8", + "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": 3726, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18202:144:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3727, + "nodeType": "EmitStatement", + "src": "18197:149:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3729, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3551, + "src": "18373:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3730, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18382:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3731, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18382:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3732, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18394:13:8", + "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": 3728, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "18357:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3733, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18357:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3734, + "nodeType": "ExpressionStatement", + "src": "18357:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3736, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3555, + "src": "18434:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3737, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "18444:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3738, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18444:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3739, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18456:14:8", + "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": 3735, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "18418:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3740, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18418:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3741, + "nodeType": "ExpressionStatement", + "src": "18418:53:8" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 3742, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3566, + "src": "18490:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3743, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3568, + "src": "18505:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 3744, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "18489:31:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 3569, + "id": 3745, + "nodeType": "Return", + "src": "18482:38:8" + } + ] + }, + "documentation": null, + "id": 3747, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3562, + "modifierName": { + "argumentTypes": null, + "id": 3561, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "16518:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "16518:6:8" + }, + { + "arguments": null, + "id": 3564, + "modifierName": { + "argumentTypes": null, + "id": 3563, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "16533:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "16533:6:8" + } + ], + "name": "swapExactAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3560, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3551, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16367:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3550, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16367:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3553, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16392:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3552, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16392:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3555, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16418:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3554, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "16418:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3557, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16444:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3556, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16444:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3559, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16473:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3558, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16473:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "16357:135:8" + }, + "returnParameters": { + "id": 3569, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3566, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16558:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3565, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16558:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3568, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 3747, + "src": "16578:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3567, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "16578:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "16557:41:8" + }, + "scope": 4307, + "src": "16330:2197:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3850, + "nodeType": "Block", + "src": "18747:915:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3763, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "18773:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3764, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18785:19:8", + "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": 3762, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18765:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18765:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3766, + "nodeType": "ExpressionStatement", + "src": "18765:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3768, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "18823:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3770, + "indexExpression": { + "argumentTypes": null, + "id": 3769, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "18832:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18823:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3771, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "18823:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3772, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18848:15:8", + "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": 3767, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18815:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18815:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3774, + "nodeType": "ExpressionStatement", + "src": "18815:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3776, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "18895:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3778, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "18917:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3780, + "indexExpression": { + "argumentTypes": null, + "id": 3779, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "18926:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18917:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3781, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "18917:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3782, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "18944:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3777, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "18912:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3783, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18912:45:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18895:62:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3785, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18972:18:8", + "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": 3775, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "18874:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3786, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18874:126:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3787, + "nodeType": "ExpressionStatement", + "src": "18874:126:8" + }, + { + "assignments": [ + 3789 + ], + "declarations": [ + { + "constant": false, + "id": 3789, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3850, + "src": "19011:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3788, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "19011:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3793, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3790, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "19037:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3792, + "indexExpression": { + "argumentTypes": null, + "id": 3791, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19046:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19037:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19011:43:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3794, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19065:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3796, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19119:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3797, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19119:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3798, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19149:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3799, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "19149:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3800, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "19178:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3801, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "19204:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3802, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19230:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3803, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "19257:8:8", + "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": 3795, + "name": "calcPoolOutGivenSingleIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 597, + "src": "19081:24:8", + "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": 3804, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19081:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19065:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3806, + "nodeType": "ExpressionStatement", + "src": "19065:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3808, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19294:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3809, + "name": "minPoolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3753, + "src": "19311:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19294:33:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3811, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19329:15:8", + "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": 3807, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19286:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3812, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19286:59:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3813, + "nodeType": "ExpressionStatement", + "src": "19286:59:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3814, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19356:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3816, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19356:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3818, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3789, + "src": "19380:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3819, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "19380:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3820, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19398:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3817, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "19375:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3821, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19375:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19356:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3823, + "nodeType": "ExpressionStatement", + "src": "19356:56:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3825, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19437:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3826, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19437:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3827, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19449:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3828, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19458:13:8", + "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": 3824, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "19428:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3829, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19428:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3830, + "nodeType": "EmitStatement", + "src": "19423:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3832, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19498:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3831, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "19483:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19483:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3834, + "nodeType": "ExpressionStatement", + "src": "19483:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3836, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19537:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3837, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19537:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3838, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19549:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3835, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "19522:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19522:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3840, + "nodeType": "ExpressionStatement", + "src": "19522:41:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3842, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3749, + "src": "19589:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3843, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "19598:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19598:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3845, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3751, + "src": "19610:13:8", + "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": 3841, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "19573:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19573:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3847, + "nodeType": "ExpressionStatement", + "src": "19573:51:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3848, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3760, + "src": "19642:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3761, + "id": 3849, + "nodeType": "Return", + "src": "19635:20:8" + } + ] + }, + "documentation": null, + "id": 3851, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3756, + "modifierName": { + "argumentTypes": null, + "id": 3755, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "18683:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18683:6:8" + }, + { + "arguments": null, + "id": 3758, + "modifierName": { + "argumentTypes": null, + "id": 3757, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "18698:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18698:6:8" + } + ], + "name": "joinswapExternAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3754, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3749, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18575:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3748, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18575:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3751, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18601:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3750, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18601:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3753, + "name": "minPoolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18630:21:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3752, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18630:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18565:92:8" + }, + "returnParameters": { + "id": 3761, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3760, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3851, + "src": "18722:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3759, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18722:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18721:20:8" + }, + "scope": 4307, + "src": "18534:1128:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3961, + "nodeType": "Block", + "src": "19874:966:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3867, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "19892:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3868, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19904:19:8", + "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": 3866, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19884:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3869, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19884:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3870, + "nodeType": "ExpressionStatement", + "src": "19884:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3872, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "19942:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3874, + "indexExpression": { + "argumentTypes": null, + "id": 3873, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "19951:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19942:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3875, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "19942:23:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3876, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19967:15:8", + "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": 3871, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "19934:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19934:49:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3878, + "nodeType": "ExpressionStatement", + "src": "19934:49:8" + }, + { + "assignments": [ + 3880 + ], + "declarations": [ + { + "constant": false, + "id": 3880, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3961, + "src": "19994:23:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3879, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "19994:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3884, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3881, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "20020:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3883, + "indexExpression": { + "argumentTypes": null, + "id": 3882, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20029:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20020:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19994:43:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3896, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3885, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20048:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3887, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20102:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3888, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20102:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3889, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20132:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3890, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "20132:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3891, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "20161:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3892, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "20187:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3893, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20213:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3894, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "20240:8:8", + "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": 3886, + "name": "calcSingleInGivenPoolOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 686, + "src": "20064:24:8", + "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": 3895, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20064:194:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20048:210:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3897, + "nodeType": "ExpressionStatement", + "src": "20048:210:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3899, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20277:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3900, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20294:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "20277:18:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3902, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20297:17:8", + "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": 3898, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20269:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3903, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20269:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3904, + "nodeType": "ExpressionStatement", + "src": "20269:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3908, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3906, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20333:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3907, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3857, + "src": "20350:11:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20333:28:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20363:14:8", + "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": 3905, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20325:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3910, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20325:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3911, + "nodeType": "ExpressionStatement", + "src": "20325:53:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3913, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20418:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3915, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "20440:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3917, + "indexExpression": { + "argumentTypes": null, + "id": 3916, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20449:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20440:17:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3918, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20440:25:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3919, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 298, + "src": "20467:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3914, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "20435:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20435:45:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20418:62:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3922, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20495:18:8", + "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": 3912, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "20397:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3923, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20397:126:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3924, + "nodeType": "ExpressionStatement", + "src": "20397:126:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3933, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3925, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20534:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3927, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20534:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3929, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3880, + "src": "20558:8:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3930, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "20558:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3931, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20576:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3928, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 934, + "src": "20553:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20553:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20534:56:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3934, + "nodeType": "ExpressionStatement", + "src": "20534:56:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3936, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20615:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3937, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20615:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3938, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20627:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3939, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20636:13:8", + "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": 3935, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2100, + "src": "20606:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3940, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20606:44:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3941, + "nodeType": "EmitStatement", + "src": "20601:49:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3943, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20676:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3942, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4296, + "src": "20661:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20661:29:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3945, + "nodeType": "ExpressionStatement", + "src": "20661:29:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3947, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20715:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20715:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3949, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3855, + "src": "20727:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3946, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "20700:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20700:41:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3951, + "nodeType": "ExpressionStatement", + "src": "20700:41:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3953, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3853, + "src": "20767:7:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3954, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "20776:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20776:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3956, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20788:13:8", + "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": 3952, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4235, + "src": "20751:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20751:51:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3958, + "nodeType": "ExpressionStatement", + "src": "20751:51:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 3959, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3864, + "src": "20820:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3865, + "id": 3960, + "nodeType": "Return", + "src": "20813:20:8" + } + ] + }, + "documentation": null, + "id": 3962, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3860, + "modifierName": { + "argumentTypes": null, + "id": 3859, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "19811:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19811:6:8" + }, + { + "arguments": null, + "id": 3862, + "modifierName": { + "argumentTypes": null, + "id": 3861, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "19826:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19826:6:8" + } + ], + "name": "joinswapPoolAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3858, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3853, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19708:15:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3852, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "19708:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3855, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19734:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3854, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19734:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3857, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19763:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3856, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19763:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19698:87:8" + }, + "returnParameters": { + "id": 3865, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3864, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3962, + "src": "19850:18:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3863, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19850:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19849:20:8" + }, + "scope": 4307, + "src": "19668:1172:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4080, + "nodeType": "Block", + "src": "21053:1040:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3978, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "21071:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3979, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21083:19:8", + "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": 3977, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21063:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21063:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3981, + "nodeType": "ExpressionStatement", + "src": "21063:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3983, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21121:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3985, + "indexExpression": { + "argumentTypes": null, + "id": 3984, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21130:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21121:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 3986, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "21121:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3987, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21147:15:8", + "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": 3982, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21113:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21113:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3989, + "nodeType": "ExpressionStatement", + "src": "21113:50:8" + }, + { + "assignments": [ + 3991 + ], + "declarations": [ + { + "constant": false, + "id": 3991, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 4080, + "src": "21174:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3990, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "21174:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3995, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3992, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21201:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 3994, + "indexExpression": { + "argumentTypes": null, + "id": 3993, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21210:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21201:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21174:45:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4007, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3996, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21230:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3998, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21285:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 3999, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21285:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4000, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21316:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4001, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "21316:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4002, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "21346:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4003, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "21372:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4004, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21398:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4005, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "21424:8:8", + "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": 3997, + "name": "calcSingleOutGivenPoolIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 781, + "src": "21247:24:8", + "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": 4006, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21247:195:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21230:212:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4008, + "nodeType": "ExpressionStatement", + "src": "21230:212:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4010, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21461:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 4011, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3968, + "src": "21479:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21461:30:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 4013, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21493:15:8", + "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": 4009, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21453:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21453:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4015, + "nodeType": "ExpressionStatement", + "src": "21453:56:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4025, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4017, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21549:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4019, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "21572:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4021, + "indexExpression": { + "argumentTypes": null, + "id": 4020, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21581:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21572:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4022, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21572:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4023, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "21600:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4018, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "21567:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21567:47:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21549:65:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 4026, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21629:19:8", + "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": 4016, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "21528:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4027, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21528:130:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4028, + "nodeType": "ExpressionStatement", + "src": "21528:130:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4037, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4029, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21669:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4031, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21669:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4033, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3991, + "src": "21694:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4034, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "21694:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4035, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21713:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4032, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "21689:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4036, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21689:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21669:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4038, + "nodeType": "ExpressionStatement", + "src": "21669:59:8" + }, + { + "assignments": [ + 4040 + ], + "declarations": [ + { + "constant": false, + "id": 4040, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 4080, + "src": "21739:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4039, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21739:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4045, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4042, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21759:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4043, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "21773:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4041, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "21754:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21754:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21739:43:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4047, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "21807:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4048, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21807:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4049, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "21819:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4050, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "21829:14:8", + "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": 4046, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "21798:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4051, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21798:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4052, + "nodeType": "EmitStatement", + "src": "21793:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4054, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "21870:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4055, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21870:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4056, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21882:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4053, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "21855:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4057, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21855:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4058, + "nodeType": "ExpressionStatement", + "src": "21855:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4061, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3966, + "src": "21925:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4062, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4040, + "src": "21939:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4060, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "21920:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4063, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21920:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4059, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "21905:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21905:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4065, + "nodeType": "ExpressionStatement", + "src": "21905:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4067, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "21973:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4068, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4040, + "src": "21983:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4066, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "21958:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4069, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21958:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4070, + "nodeType": "ExpressionStatement", + "src": "21958:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4072, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3964, + "src": "22017:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4073, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "22027:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4074, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22027:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4075, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "22039:14:8", + "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": 4071, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "22001:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22001:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4077, + "nodeType": "ExpressionStatement", + "src": "22001:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4078, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3975, + "src": "22072:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3976, + "id": 4079, + "nodeType": "Return", + "src": "22065:21:8" + } + ] + }, + "documentation": null, + "id": 4081, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3971, + "modifierName": { + "argumentTypes": null, + "id": 3970, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "20989:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "20989:6:8" + }, + { + "arguments": null, + "id": 3973, + "modifierName": { + "argumentTypes": null, + "id": 3972, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "21004:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21004:6:8" + } + ], + "name": "exitswapPoolAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3969, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3964, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20885:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3963, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20885:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3966, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20912:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3965, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20912:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3968, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "20940:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3967, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20940:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "20875:88:8" + }, + "returnParameters": { + "id": 3976, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3975, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4081, + "src": "21028:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3974, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21028:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "21027:21:8" + }, + "scope": 4307, + "src": "20846:1247:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4206, + "nodeType": "Block", + "src": "22312:1092:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4097, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2169, + "src": "22330:10:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 4098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22342:19:8", + "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": 4096, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22322:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22322:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4100, + "nodeType": "ExpressionStatement", + "src": "22322:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4102, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22380:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4104, + "indexExpression": { + "argumentTypes": null, + "id": 4103, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22389:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22380:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4105, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 2073, + "src": "22380:24:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 4106, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22406:15:8", + "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": 4101, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22372:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4107, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22372:50:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4108, + "nodeType": "ExpressionStatement", + "src": "22372:50:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4110, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "22453:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4112, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22476:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4114, + "indexExpression": { + "argumentTypes": null, + "id": 4113, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22485:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22476:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "id": 4115, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22476:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4116, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 306, + "src": "22504:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4111, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "22471:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22471:47:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22453:65:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 4119, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22533:19:8", + "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": 4109, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22432:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22432:130:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4121, + "nodeType": "ExpressionStatement", + "src": "22432:130:8" + }, + { + "assignments": [ + 4123 + ], + "declarations": [ + { + "constant": false, + "id": 4123, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 4206, + "src": "22573:24:8", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 4122, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 2080, + "src": "22573:6:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4127, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 4124, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "22600:8:8", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$2080_storage_$", + "typeString": "mapping(address => struct SPool.Record storage ref)" + } + }, + "id": 4126, + "indexExpression": { + "argumentTypes": null, + "id": 4125, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "22609:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "22600:18:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage", + "typeString": "struct SPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22573:45:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 4128, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22629:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4130, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22682:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4131, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22682:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4132, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22713:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4133, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 2077, + "src": "22713:16:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4134, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1439, + "src": "22743:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4135, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2178, + "src": "22769:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4136, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "22795:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4137, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2167, + "src": "22823:8:8", + "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": 4129, + "name": "calcPoolInGivenSingleOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 877, + "src": "22644:24:8", + "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": 4138, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22644:197:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22629:212:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4140, + "nodeType": "ExpressionStatement", + "src": "22629:212:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4142, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22860:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 4143, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22876:1:8", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "22860:17:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 4145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22879:17:8", + "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": 4141, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22852:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22852:45:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4147, + "nodeType": "ExpressionStatement", + "src": "22852:45:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 4151, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 4149, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "22915:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 4150, + "name": "maxPoolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4087, + "src": "22931:15:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22915:31:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 4152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22948:14:8", + "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": 4148, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "22907:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22907:56:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4154, + "nodeType": "ExpressionStatement", + "src": "22907:56:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4155, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22974:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4157, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22974:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4159, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4123, + "src": "22999:9:8", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$2080_storage_ptr", + "typeString": "struct SPool.Record storage pointer" + } + }, + "id": 4160, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2079, + "src": "22999:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4161, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23018:14:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4158, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "22994:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22994:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "22974:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 4164, + "nodeType": "ExpressionStatement", + "src": "22974:59:8" + }, + { + "assignments": [ + 4166 + ], + "declarations": [ + { + "constant": false, + "id": 4166, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 4206, + "src": "23044:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4165, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23044:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4171, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4168, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23064:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4169, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "23078:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4167, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1044, + "src": "23059:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23059:28:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23044:43:8" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4173, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23112:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23112:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4175, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "23124:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4176, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23134:14:8", + "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": 4172, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2108, + "src": "23103:8:8", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23103:46:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4178, + "nodeType": "EmitStatement", + "src": "23098:51:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4180, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23175:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4181, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23175:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4182, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23187:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4179, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4273, + "src": "23160:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23160:40:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4184, + "nodeType": "ExpressionStatement", + "src": "23160:40:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4187, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23230:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 4188, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4166, + "src": "23244:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4186, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 961, + "src": "23225:4:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 4189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23225:27:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4185, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4306, + "src": "23210:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23210:43:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4191, + "nodeType": "ExpressionStatement", + "src": "23210:43:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4193, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2161, + "src": "23278:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4194, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4166, + "src": "23288:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4192, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4286, + "src": "23263:14:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4195, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23263:33:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4196, + "nodeType": "ExpressionStatement", + "src": "23263:33:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4198, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4083, + "src": "23322:8:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 4199, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5635, + "src": "23332:3:8", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 4200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "23332:10:8", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 4201, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4085, + "src": "23344:14:8", + "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": 4197, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4260, + "src": "23306:15:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 4202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23306:53:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4203, + "nodeType": "ExpressionStatement", + "src": "23306:53:8" + }, + { + "expression": { + "argumentTypes": null, + "id": 4204, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4094, + "src": "23385:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 4095, + "id": 4205, + "nodeType": "Return", + "src": "23378:19:8" + } + ] + }, + "documentation": null, + "id": 4207, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 4090, + "modifierName": { + "argumentTypes": null, + "id": 4089, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2129, + "src": "22250:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "22250:6:8" + }, + { + "arguments": null, + "id": 4092, + "modifierName": { + "argumentTypes": null, + "id": 4091, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2147, + "src": "22265:6:8", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "22265:6:8" + } + ], + "name": "exitswapExternAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4088, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4083, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22141:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4082, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22141:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4085, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22168:19:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4084, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22168:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4087, + "name": "maxPoolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22198:20:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4086, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22198:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22131:93:8" + }, + "returnParameters": { + "id": 4095, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4094, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 4207, + "src": "22289:17:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4093, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22289:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22288:19:8" + }, + "scope": 4307, + "src": "22099:1305:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 4234, + "nodeType": "Block", + "src": "23658:126:8", + "statements": [ + { + "assignments": [ + 4217 + ], + "declarations": [ + { + "constant": false, + "id": 4217, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 4234, + "src": "23668:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4216, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "23668:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4228, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4222, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4211, + "src": "23707:4:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4224, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5675, + "src": "23721:4:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_SPool_$4307", + "typeString": "contract SPool" + } + ], + "id": 4223, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "23713:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 4225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23713:13:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4226, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4213, + "src": "23728:6:8", + "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": 4219, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4209, + "src": "23687:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4218, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "23680:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 4220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23680:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 4221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 1424, + "src": "23680:26:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 4227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23680:55:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23668:67:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4230, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4217, + "src": "23753:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 4231, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23759:17:8", + "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": 4229, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "23745:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23745:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4233, + "nodeType": "ExpressionStatement", + "src": "23745:32:8" + } + ] + }, + "documentation": null, + "id": 4235, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4214, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4209, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23595:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4208, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23595:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4211, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23610:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4210, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23610:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4213, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4235, + "src": "23624:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23624:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23594:42:8" + }, + "returnParameters": { + "id": 4215, + "nodeType": "ParameterList", + "parameters": [], + "src": "23658:0:8" + }, + "scope": 4307, + "src": "23570:214:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4259, + "nodeType": "Block", + "src": "23876:105:8", + "statements": [ + { + "assignments": [ + 4245 + ], + "declarations": [ + { + "constant": false, + "id": 4245, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 4259, + "src": "23886:9:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 4244, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "23886:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 4253, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4250, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4239, + "src": "23921:2:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4251, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4241, + "src": "23925:6:8", + "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": 4247, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4237, + "src": "23905:5:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 4246, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1425, + "src": "23898:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$1425_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 4248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23898:13:8", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$1425", + "typeString": "contract IERC20" + } + }, + "id": 4249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 1413, + "src": "23898:22:8", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 4252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23898:34:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "23886:46:8" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4255, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4245, + "src": "23950:4:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 4256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "23956:17:8", + "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": 4254, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5638, + 5639 + ], + "referencedDeclaration": 5639, + "src": "23942:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 4257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23942:32:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4258, + "nodeType": "ExpressionStatement", + "src": "23942:32:8" + } + ] + }, + "documentation": null, + "id": 4260, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4242, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4237, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23815:13:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4236, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23815:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4239, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23830:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4238, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "23830:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4241, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4260, + "src": "23842:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4240, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23842:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23814:40:8" + }, + "returnParameters": { + "id": 4243, + "nodeType": "ParameterList", + "parameters": [], + "src": "23876:0:8" + }, + "scope": 4307, + "src": "23790:191:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4272, + "nodeType": "Block", + "src": "24059:36:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4268, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4262, + "src": "24075:4:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4269, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4264, + "src": "24081:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4267, + "name": "_pull", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1621, + "src": "24069:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24069:19:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4271, + "nodeType": "ExpressionStatement", + "src": "24069:19:8" + } + ] + }, + "documentation": null, + "id": 4273, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4265, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4262, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 4273, + "src": "24011:12:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4261, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24011:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4264, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4273, + "src": "24025:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4263, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24025:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24010:27:8" + }, + "returnParameters": { + "id": 4266, + "nodeType": "ParameterList", + "parameters": [], + "src": "24059:0:8" + }, + "scope": 4307, + "src": "23987:108:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4285, + "nodeType": "Block", + "src": "24171:34:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4281, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4275, + "src": "24187:2:8", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 4282, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4277, + "src": "24191:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4280, + "name": "_push", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1605, + "src": "24181:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 4283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24181:17:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4284, + "nodeType": "ExpressionStatement", + "src": "24181:17:8" + } + ] + }, + "documentation": null, + "id": 4286, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4278, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4275, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 4286, + "src": "24125:10:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 4274, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "24125:7:8", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 4277, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4286, + "src": "24137:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4276, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24137:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24124:25:8" + }, + "returnParameters": { + "id": 4279, + "nodeType": "ParameterList", + "parameters": [], + "src": "24171:0:8" + }, + "scope": 4307, + "src": "24101:104:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4295, + "nodeType": "Block", + "src": "24269:30:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4292, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4288, + "src": "24285:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4291, + "name": "_mint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1493, + "src": "24279:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24279:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4294, + "nodeType": "ExpressionStatement", + "src": "24279:13:8" + } + ] + }, + "documentation": null, + "id": 4296, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_mintPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4289, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4288, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4296, + "src": "24235:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4287, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24235:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24234:13:8" + }, + "returnParameters": { + "id": 4290, + "nodeType": "ParameterList", + "parameters": [], + "src": "24269:0:8" + }, + "scope": 4307, + "src": "24211:88:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 4305, + "nodeType": "Block", + "src": "24363:30:8", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 4302, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4298, + "src": "24379:6:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 4301, + "name": "_burn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1542, + "src": "24373:5:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 4303, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "24373:13:8", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 4304, + "nodeType": "ExpressionStatement", + "src": "24373:13:8" + } + ] + }, + "documentation": null, + "id": 4306, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_burnPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 4299, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 4298, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 4306, + "src": "24329:11:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4297, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "24329:4:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "24328:13:8" + }, + "returnParameters": { + "id": 4300, + "nodeType": "ParameterList", + "parameters": [], + "src": "24363:0:8" + }, + "scope": 4307, + "src": "24305:88:8", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + } + ], + "scope": 4308, + "src": "855:23541:8" + } + ], + "src": "0:24397:8" + }, + "compiler": { + "name": "solc", + "version": "0.5.7+commit.6da8b019.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.2.0", + "updatedAt": "2020-07-01T18:39:45.209Z", + "devdoc": { + "details": "Used by the (Ocean version) SFactory contract as a bytecode reference to deploy new SPools. * This contract is is nearly identical to the BPool.sol contract at [1] The only difference is the \"Proxy contract functionality\" section given below. We'd inherit from BPool if we could, for simplicity. But we can't, because the proxy section needs to access private variables declared in BPool, and Solidity disallows this. Therefore the best we can do for now is clearly demarcate the proxy section. * [1] https://github.com/balancer-labs/balancer-core/contracts/.", + "methods": {}, + "title": "SPool " + }, + "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 index df836102..059966b5 100644 --- a/src/balancer/balancerlib.ts +++ b/src/balancer/balancerlib.ts @@ -1,3 +1,6 @@ +// import * as jsonFactoryABI from './artifacts/SFactory.json' +// import * as jsonPoolABI from './artifacts/SPool.json' + import * as jsonFactoryABI from './artifacts/BFactory.json' import * as jsonPoolABI from './artifacts/BPool.json' @@ -12,67 +15,31 @@ export interface TokensToAdd { weight: string } -export class Balancer { - private GASLIMIT_DEFAULT: number = 5000000 - private web3: any = null +export class BalancerFactory { + public GASLIMIT_DEFAULT: number = 5000000 + public web3: any = null + public account: string = 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 + public factoryAddress: any constructor( web3: any, account: string, FactoryABI: any = null, - PoolABI: any = null, - factoryAddress: string = null, - oceanAddress: string = null + factoryAddress: 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 @@ -94,21 +61,46 @@ export class Balancer { 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 } +} + +export class BalancerPool extends BalancerFactory { + private PoolABI: any + private pool: any = null + public poolAddress: string = null + + constructor( + web3: any, + account: string, + FactoryABI: any = null, + PoolABI: any = null, + factoryAddress: string = null + ) { + super(web3, account, FactoryABI, factoryAddress) + if (PoolABI) this.PoolABI = PoolABI + else this.PoolABI = jsonPoolABI.abi + } + + /** + * Creates a new pool + */ + async newPool(): Promise { + const pooladdress = await super.newPool() + this.poolAddress = pooladdress + this.pool = new this.web3.eth.Contract(this.PoolABI, pooladdress, { + from: this.account + }) + 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 @@ -814,252 +806,4 @@ export class Balancer { } 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 - * @return {any} - */ - public async addDTLiquidity(amount: string): Promise { - if (this.dtAddress == null) { - console.error( - 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' - ) - return null - } - await this.approve( - this.dtAddress, - this.poolAddress, - this.web3.utils.toWei(amount) - ) - const result = await this.joinswapExternAmountIn(this.dtAddress, amount, '0') - return result - } - - /** - * Remove Data Token amount from pool liquidity - * @param {String} amount pool Liquidity Amount - * @return {any} - */ - public removeDTLiquidity(amount: string, maximumPoolShares: string): Promise { - if (this.dtAddress == null) { - console.error( - 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' - ) - return null - } - // TODO Check balance of PoolShares before doing exit - return this.exitswapExternAmountOut(this.dtAddress, amount, maximumPoolShares) - } - - /** - * Add Ocean Token amount to pool liquidity - * @param {String} amount Data Token Amount - * @return {any} - */ - public async addOceanLiquidity(amount: string): Promise { - if (this.oceanAddress == null) { - console.error('oceanAddress is not defined') - return null - } - await this.approve( - this.oceanAddress, - this.poolAddress, - this.web3.utils.toWei(amount) - ) - const result = await this.joinswapExternAmountIn(this.oceanAddress, amount, '0') - return result - } - - /** - * Remove Ocean Token amount from pool liquidity - * @param {String} amount pool Liquidity Amount - * @return {any} - */ - public removeOceanLiquidity(amount: string, maximumPoolShares: string): Promise { - if (this.oceanAddress == null) { - console.error('oceanAddress is not defined') - return null - } - // TODO Check balance of PoolShares before doing exit - return this.exitswapExternAmountOut(this.oceanAddress, amount, maximumPoolShares) - } - - /** - * 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 index f5080043..f4260e6f 100644 --- a/test/BalancerContractHandler.ts +++ b/test/BalancerContractHandler.ts @@ -10,10 +10,18 @@ export class BalancerContractHandler { public poolAddress: string public web3: any - constructor(factoryABI: Contract, factoryBytecode: string, web3: any) { + constructor( + factoryABI: Contract, + factoryBytecode: string, + poolABI: Contract, + poolBytecode: string, + web3: any + ) { this.web3 = web3 this.factory = new this.web3.eth.Contract(factoryABI) this.factoryBytecode = factoryBytecode + this.pool = new this.web3.eth.Contract(poolABI) + this.poolBytecode = poolBytecode } public async getAccounts() { @@ -30,6 +38,7 @@ export class BalancerContractHandler { if (err) console.log('DeployContracts: ' + err) return estGas }) + console.log('estGas:' + estGas) // deploy the contract and get it's address this.factoryAddress = await this.factory .deploy({ @@ -45,4 +54,58 @@ export class BalancerContractHandler { return contract.options.address }) } + + public async SdeployContracts(minter: string) { + let estGas + + estGas = await this.pool + .deploy({ + data: this.poolBytecode, + arguments: [] + }) + .estimateGas({ from: minter, gas: 9007199254740991 }, function (err, estGas) { + if (err) console.log('DeployContracts: ' + err) + return estGas + }) + // deploy the contract and get it's address + console.log('estGas:' + estGas) + this.poolAddress = await this.pool + .deploy({ + data: this.poolBytecode, + arguments: [] + }) + .send({ + from: minter, + gas: estGas + 1, + gasPrice: '3000000000' + }) + .then(function (contract) { + return contract.options.address + }) + + estGas = await this.factory + .deploy({ + data: this.factoryBytecode, + arguments: [this.poolAddress] + }) + .estimateGas(function (err, estGas) { + if (err) console.log('DeployContracts: ' + err) + return estGas + }) + console.log('estGas:' + estGas) + // deploy the contract and get it's address + this.factoryAddress = await this.factory + .deploy({ + data: this.factoryBytecode, + arguments: [this.poolAddress] + }) + .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 index 52f39bfc..c09dff02 100644 --- a/test/unit/balancer/Balancer.test.ts +++ b/test/unit/balancer/Balancer.test.ts @@ -2,7 +2,8 @@ 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 { Balancer } from '../../../src/balancer/balancerlib' +import { OceanPool } from '../../../src/balancer/OceanPool' import { Ocean } from '../../../src/ocean/Ocean' import { Config } from '../../../src/models/Config' @@ -12,14 +13,17 @@ const factory = require('@oceanprotocol/contracts/artifacts/development/Factory. 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') +const SFactory = require('../../../src/balancer/artifacts/SFactory.json') +const SPool = require('../../../src/balancer/artifacts/SPool.json') + +const OceanPoolFactory = require('../../../src/balancer/artifacts/BFactory.json') +const OceanPoolPool = require('../../../src/balancer/artifacts/BPool.json') describe('Balancer flow', () => { let oceanTokenAddress - let balancerFactoryAddress - let balancer - let balancerContracts + let OceanPoolFactoryAddress + let Pool + let OceanPoolContracts let oceandatatoken let alicePool let alicePoolAddress @@ -75,28 +79,50 @@ describe('Balancer flow', () => { ) oceanTokenAddress = await oceandatatoken.create(blob, alice) }) - it('Deploy Balancer Factory', async () => { - balancerContracts = new BalancerContractHandler( - balancerFactory.abi, - balancerFactory.bytecode, + it('Deploy OceanPool Factory', async () => { + OceanPoolContracts = new BalancerContractHandler( + OceanPoolFactory.abi, + OceanPoolFactory.bytecode, + OceanPoolPool.abi, + OceanPoolPool.bytecode, web3 ) - await balancerContracts.getAccounts() - owner = balancerContracts.accounts[0] - await balancerContracts.deployContracts(owner) - balancerFactoryAddress = balancerContracts.factoryAddress - assert(balancerFactoryAddress !== null) + await OceanPoolContracts.getAccounts() + owner = OceanPoolContracts.accounts[0] + console.log('Owner:' + owner) + await OceanPoolContracts.deployContracts(owner) + OceanPoolFactoryAddress = OceanPoolContracts.factoryAddress + assert(OceanPoolFactoryAddress !== null) }) - it('should initialize balancer class', async () => { - balancer = new Balancer( + + + it('Deploy SFactory', async () => { + const SContracts = new BalancerContractHandler( + SFactory.abi, + SFactory.bytecode, + SPool.abi, + SPool.bytecode, + web3 + ) + await SContracts.getAccounts() + owner = SContracts.accounts[0] + console.log('Owner:' + owner) + await SContracts.SdeployContracts(owner) + const SFactoryAddress = SContracts.factoryAddress + assert(SFactoryAddress !== null) + }) + + + it('should initialize OceanPool class', async () => { + Pool = new OceanPool( web3, alice, - balancerFactory.abi, - balancerPool.abi, - balancerFactoryAddress, + OceanPoolFactory.abi, + OceanPoolPool.abi, + OceanPoolFactoryAddress, oceanTokenAddress ) - assert(balancer !== null) + assert(Pool !== null) }) it('Alice mints 1000 tokens', async () => { @@ -114,10 +140,10 @@ describe('Balancer flow', () => { ) transactionId = ts.transactionHash }) - it('Alice creates a new balancer pool', async () => { + it('Alice creates a new OceanPool 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) + alicePoolAddress = await Pool.createDTPool(tokenAddress, 45, 9, '0.02') + alicePool = await Pool.loadDTPool(alicePoolAddress) assert(alicePool !== null) }) it('Get pool information', async () => { @@ -143,12 +169,12 @@ describe('Balancer flow', () => { assert(currentOceanReserve > 0) }) it("Bob should load Alice's pool ", async () => { - bobPool = new Balancer( + bobPool = new OceanPool( web3, bob, - balancerFactory.abi, - balancerPool.abi, - balancerFactoryAddress, + OceanPoolFactory.abi, + OceanPoolPool.abi, + OceanPoolFactoryAddress, oceanTokenAddress ) await bobPool.loadDTPool(alicePoolAddress)