cic-internal-integration/apps/cic-eth/tests/testdata/bancor/LiquidityPoolV1Converter.json

61559 lines
2.8 MiB

{
"contractName": "LiquidityPoolV1Converter",
"abi": [
{
"inputs": [
{
"internalType": "contract ISmartToken",
"name": "_token",
"type": "address"
},
{
"internalType": "contract IContractRegistry",
"name": "_registry",
"type": "address"
},
{
"internalType": "uint32",
"name": "_maxConversionFee",
"type": "uint32"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": true,
"internalType": "contract IConverterAnchor",
"name": "_anchor",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "_activated",
"type": "bool"
}
],
"name": "Activation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_fromToken",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_toToken",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_trader",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_return",
"type": "uint256"
},
{
"indexed": false,
"internalType": "int256",
"name": "_conversionFee",
"type": "int256"
}
],
"name": "Conversion",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "_prevFee",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint32",
"name": "_newFee",
"type": "uint32"
}
],
"name": "ConversionFeeUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_provider",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_newBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_newSupply",
"type": "uint256"
}
],
"name": "LiquidityAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_provider",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_newBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_newSupply",
"type": "uint256"
}
],
"name": "LiquidityRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_prevOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "OwnerUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_connectorToken",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_tokenSupply",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_connectorBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint32",
"name": "_connectorWeight",
"type": "uint32"
}
],
"name": "PriceDataUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_token1",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_token2",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_rateN",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_rateD",
"type": "uint256"
}
],
"name": "TokenRateUpdate",
"type": "event"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "acceptTokenOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "anchor",
"outputs": [
{
"internalType": "contract IConverterAnchor",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "connectorTokenCount",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "connectorTokens",
"outputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_address",
"type": "address"
}
],
"name": "connectors",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "",
"type": "uint32"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionFee",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionWhitelist",
"outputs": [
{
"internalType": "contract IWhitelist",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionsEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_trader",
"type": "address"
},
{
"internalType": "address payable",
"name": "_beneficiary",
"type": "address"
}
],
"name": "convert",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_connectorToken",
"type": "address"
}
],
"name": "getConnectorBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "getReturn",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hasETHReserve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isActive",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isStandardPool",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isV28OrHigher",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "maxConversionFee",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "newOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "onlyOwnerCanUpdateRegistry",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "prevAverageRate",
"outputs": [
{
"internalType": "uint256",
"name": "n",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "d",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "prevAverageRateUpdateTime",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "prevRegistry",
"outputs": [
{
"internalType": "contract IContractRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "registry",
"outputs": [
{
"internalType": "contract IContractRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
}
],
"name": "reserveBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "reserveRatio",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "reserveTokenCount",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "reserveTokens",
"outputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
}
],
"name": "reserveWeight",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"name": "reserves",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "weight",
"type": "uint32"
},
{
"internalType": "bool",
"name": "deprecated1",
"type": "bool"
},
{
"internalType": "bool",
"name": "deprecated2",
"type": "bool"
},
{
"internalType": "bool",
"name": "isSet",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "restoreRegistry",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_onlyOwnerCanUpdateRegistry",
"type": "bool"
}
],
"name": "restrictRegistryUpdate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_conversionFee",
"type": "uint32"
}
],
"name": "setConversionFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IWhitelist",
"name": "_whitelist",
"type": "address"
}
],
"name": "setConversionWhitelist",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IConverterAnchor",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferAnchorOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferTokenOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "updateRegistry",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_to",
"type": "address"
}
],
"name": "withdrawETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawFromAnchor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawTokens",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"inputs": [],
"name": "converterType",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "acceptAnchorOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "uint32",
"name": "_weight",
"type": "uint32"
}
],
"name": "addReserve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "targetAmountAndFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
}
],
"name": "recentAverageRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token[]",
"name": "_reserveTokens",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "_reserveAmounts",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "_minReturn",
"type": "uint256"
}
],
"name": "addLiquidity",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "contract IERC20Token[]",
"name": "_reserveTokens",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "_reserveMinReturnAmounts",
"type": "uint256[]"
}
],
"name": "removeLiquidity",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "fund",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "liquidate",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token[]",
"name": "_reserveTokens",
"type": "address[]"
},
{
"internalType": "uint256",
"name": "_reserveTokenIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_reserveAmount",
"type": "uint256"
}
],
"name": "addLiquidityCost",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_reserveAmount",
"type": "uint256"
}
],
"name": "addLiquidityReturn",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "contract IERC20Token[]",
"name": "_reserveTokens",
"type": "address[]"
}
],
"name": "removeLiquidityReturn",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_x",
"type": "uint256"
}
],
"name": "decimalLength",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_n",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_d",
"type": "uint256"
}
],
"name": "roundDiv",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_values",
"type": "uint256[]"
}
],
"name": "geometricMean",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISmartToken\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"contract IContractRegistry\",\"name\":\"_registry\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_maxConversionFee\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IConverterAnchor\",\"name\":\"_anchor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_activated\",\"type\":\"bool\"}],\"name\":\"Activation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_fromToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_toToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_trader\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_return\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_conversionFee\",\"type\":\"int256\"}],\"name\":\"Conversion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"_prevFee\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"_newFee\",\"type\":\"uint32\"}],\"name\":\"ConversionFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_reserveToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newSupply\",\"type\":\"uint256\"}],\"name\":\"LiquidityAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_reserveToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_newSupply\",\"type\":\"uint256\"}],\"name\":\"LiquidityRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_prevOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_connectorToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenSupply\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_connectorBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"_connectorWeight\",\"type\":\"uint32\"}],\"name\":\"PriceDataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_token1\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_token2\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_rateN\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_rateD\",\"type\":\"uint256\"}],\"name\":\"TokenRateUpdate\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptAnchorOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptTokenOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token[]\",\"name\":\"_reserveTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_reserveAmounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_minReturn\",\"type\":\"uint256\"}],\"name\":\"addLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token[]\",\"name\":\"_reserveTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_reserveTokenIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"addLiquidityCost\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_reserveToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"addLiquidityReturn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_weight\",\"type\":\"uint32\"}],\"name\":\"addReserve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"anchor\",\"outputs\":[{\"internalType\":\"contract IConverterAnchor\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"connectorTokenCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"connectorTokens\",\"outputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"connectors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionFee\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionWhitelist\",\"outputs\":[{\"internalType\":\"contract IWhitelist\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionsEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20Token\",\"name\":\"_targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_trader\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterType\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_x\",\"type\":\"uint256\"}],\"name\":\"decimalLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"fund\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_values\",\"type\":\"uint256[]\"}],\"name\":\"geometricMean\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_connectorToken\",\"type\":\"address\"}],\"name\":\"getConnectorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20Token\",\"name\":\"_targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"getReturn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hasETHReserve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isStandardPool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isV28OrHigher\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"liquidate\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxConversionFee\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"onlyOwnerCanUpdateRegistry\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"prevAverageRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"d\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"prevAverageRateUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"prevRegistry\",\"outputs\":[{\"internalType\":\"contract IContractRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"recentAverageRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"contract IContractRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20Token[]\",\"name\":\"_reserveTokens\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_reserveMinReturnAmounts\",\"type\":\"uint256[]\"}],\"name\":\"removeLiquidity\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20Token[]\",\"name\":\"_reserveTokens\",\"type\":\"address[]\"}],\"name\":\"removeLiquidityReturn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_reserveToken\",\"type\":\"address\"}],\"name\":\"reserveBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reserveRatio\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reserveTokenCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"reserveTokens\",\"outputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_reserveToken\",\"type\":\"address\"}],\"name\":\"reserveWeight\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"reserves\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"weight\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"deprecated1\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"deprecated2\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isSet\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"restoreRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_onlyOwnerCanUpdateRegistry\",\"type\":\"bool\"}],\"name\":\"restrictRegistryUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_n\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_d\",\"type\":\"uint256\"}],\"name\":\"roundDiv\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_conversionFee\",\"type\":\"uint32\"}],\"name\":\"setConversionFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IWhitelist\",\"name\":\"_whitelist\",\"type\":\"address\"}],\"name\":\"setConversionWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20Token\",\"name\":\"_targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"targetAmountAndFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IConverterAnchor\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferAnchorOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferTokenOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"withdrawETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFromAnchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"Liquidity Pool v1 Converter The liquidity pool v1 converter is a specialized version of a converter that manages a classic bancor liquidity pool. Even though pools can have many reserves, the standard pool configuration is 2 reserves with 50%/50% weights.\",\"events\":{\"PriceDataUpdate(address,uint256,uint256,uint32)\":{\"details\":\"triggered after a conversion with new price data deprecated, use `TokenRateUpdate` from version 28 and up\",\"params\":{\"_connectorBalance\":\"reserve balance\",\"_connectorToken\":\"reserve token\",\"_connectorWeight\":\"reserve weight\",\"_tokenSupply\":\"smart token supply\"}}},\"kind\":\"dev\",\"methods\":{\"acceptAnchorOwnership()\":{\"details\":\"accepts ownership of the anchor after an ownership transfer also activates the converter can only be called by the contract owner note that prior to version 28, you should use 'acceptTokenOwnership' instead\"},\"acceptOwnership()\":{\"details\":\"used by a new owner to accept an ownership transfer\"},\"acceptTokenOwnership()\":{\"details\":\"deprecated, backward compatibility\"},\"addLiquidity(address[],uint256[],uint256)\":{\"details\":\"increases the pool's liquidity and mints new shares in the pool to the caller note that prior to version 28, you should use 'fund' instead\",\"params\":{\"_minReturn\":\"token minimum return-amount\",\"_reserveAmounts\":\"amount of each reserve token\",\"_reserveTokens\":\"address of each reserve token\"},\"returns\":{\"_0\":\"amount of pool tokens issued\"}},\"addLiquidityCost(address[],uint256,uint256)\":{\"details\":\"given the amount of one of the reserve tokens to add liquidity of, returns the required amount of each one of the other reserve tokens since an empty pool can be funded with any list of non-zero input amounts, this function assumes that the pool is not empty (has already been funded)\",\"params\":{\"_reserveAmount\":\"amount of the relevant reserve token\",\"_reserveTokenIndex\":\"index of the relevant reserve token\",\"_reserveTokens\":\"address of each reserve token\"},\"returns\":{\"_0\":\"the required amount of each one of the reserve tokens\"}},\"addLiquidityReturn(address,uint256)\":{\"details\":\"given the amount of one of the reserve tokens to add liquidity of, returns the amount of pool tokens entitled for it since an empty pool can be funded with any list of non-zero input amounts, this function assumes that the pool is not empty (has already been funded)\",\"params\":{\"_reserveAmount\":\"amount of the reserve token\",\"_reserveToken\":\"address of the reserve token\"},\"returns\":{\"_0\":\"the amount of pool tokens entitled\"}},\"addReserve(address,uint32)\":{\"details\":\"defines a new reserve token for the converter can only be called by the owner while the converter is inactive\",\"params\":{\"_token\":\"address of the reserve token\",\"_weight\":\"reserve weight, represented in ppm, 1-1000000\"}},\"connectorTokenCount()\":{\"details\":\"deprecated, backward compatibility\"},\"connectorTokens(uint256)\":{\"details\":\"deprecated, backward compatibility\"},\"connectors(address)\":{\"details\":\"deprecated, backward compatibility\"},\"constructor\":{\"details\":\"initializes a new LiquidityPoolV1Converter instance\",\"params\":{\"_maxConversionFee\":\"maximum conversion fee, represented in ppm\",\"_registry\":\"address of a contract registry contract\",\"_token\":\"pool token governed by the converter\"}},\"convert(address,address,uint256,address,address)\":{\"details\":\"converts a specific amount of source tokens to target tokens can only be called by the bancor network contract\",\"params\":{\"_amount\":\"amount of tokens to convert (in units of the source token)\",\"_beneficiary\":\"wallet to receive the conversion result\",\"_sourceToken\":\"source ERC20 token\",\"_targetToken\":\"target ERC20 token\",\"_trader\":\"address of the caller who executed the conversion\"},\"returns\":{\"_0\":\"amount of tokens received (in units of the target token)\"}},\"converterType()\":{\"details\":\"returns the converter type\",\"returns\":{\"_0\":\"see the converter types in the the main contract doc\"}},\"decimalLength(uint256)\":{\"details\":\"returns the number of decimal digits in a given value\",\"params\":{\"_x\":\"value (assumed positive)\"},\"returns\":{\"_0\":\"the number of decimal digits in the given value\"}},\"fund(uint256)\":{\"details\":\"increases the pool's liquidity and mints new shares in the pool to the caller for example, if the caller increases the supply by 10%, then it will cost an amount equal to 10% of each reserve token balance note that starting from version 28, you should use 'addLiquidity' instead\",\"params\":{\"_amount\":\"amount to increase the supply by (in the pool token)\"},\"returns\":{\"_0\":\"amount of pool tokens issued\"}},\"geometricMean(uint256[])\":{\"details\":\"returns the average number of decimal digits in a given list of values\",\"params\":{\"_values\":\"list of values (each of which assumed positive)\"},\"returns\":{\"_0\":\"the average number of decimal digits in the given list of values\"}},\"getConnectorBalance(address)\":{\"details\":\"deprecated, backward compatibility\"},\"getReturn(address,address,uint256)\":{\"details\":\"deprecated, backward compatibility\"},\"hasETHReserve()\":{\"details\":\"checks whether or not the converter has an ETH reserve\",\"returns\":{\"_0\":\"true if the converter has an ETH reserve, false otherwise\"}},\"isActive()\":{\"details\":\"returns true if the converter is active, false otherwise\",\"returns\":{\"_0\":\"true if the converter is active, false otherwise\"}},\"isV28OrHigher()\":{\"details\":\"checks whether or not the converter version is 28 or higher\",\"returns\":{\"_0\":\"true, since the converter version is 28 or higher\"}},\"liquidate(uint256)\":{\"details\":\"decreases the pool's liquidity and burns the caller's shares in the pool for example, if the holder sells 10% of the supply, then they will receive 10% of each reserve token balance in return note that starting from version 28, you should use 'removeLiquidity' instead\",\"params\":{\"_amount\":\"amount to liquidate (in the pool token)\"},\"returns\":{\"_0\":\"the amount of each reserve token granted for the given amount of pool tokens\"}},\"recentAverageRate(address)\":{\"details\":\"returns the recent average rate of 1 `_token` in the other reserve token units note that the rate can only be queried for reserves in a standard pool\",\"params\":{\"_token\":\"token to get the rate for\"},\"returns\":{\"_0\":\"recent average rate between the reserves (numerator)\",\"_1\":\"recent average rate between the reserves (denominator)\"}},\"removeLiquidity(uint256,address[],uint256[])\":{\"details\":\"decreases the pool's liquidity and burns the caller's shares in the pool note that prior to version 28, you should use 'liquidate' instead\",\"params\":{\"_amount\":\"token amount\",\"_reserveMinReturnAmounts\":\"minimum return-amount of each reserve token\",\"_reserveTokens\":\"address of each reserve token\"},\"returns\":{\"_0\":\"the amount of each reserve token granted for the given amount of pool tokens\"}},\"removeLiquidityReturn(uint256,address[])\":{\"details\":\"returns the amount of each reserve token entitled for a given amount of pool tokens\",\"params\":{\"_amount\":\"amount of pool tokens\",\"_reserveTokens\":\"address of each reserve token\"},\"returns\":{\"_0\":\"the amount of each reserve token entitled for the given amount of pool tokens\"}},\"reserveBalance(address)\":{\"details\":\"returns the reserve's balance note that prior to version 17, you should use 'getConnectorBalance' instead\",\"params\":{\"_reserveToken\":\"reserve token contract address\"},\"returns\":{\"_0\":\"reserve balance\"}},\"reserveTokenCount()\":{\"details\":\"returns the number of reserve tokens defined note that prior to version 17, you should use 'connectorTokenCount' instead\",\"returns\":{\"_0\":\"number of reserve tokens\"}},\"reserveWeight(address)\":{\"details\":\"returns the reserve's weight added in version 28\",\"params\":{\"_reserveToken\":\"reserve token contract address\"},\"returns\":{\"_0\":\"reserve weight\"}},\"restoreRegistry()\":{\"details\":\"restores the previous contract-registry\"},\"restrictRegistryUpdate(bool)\":{\"details\":\"restricts the permission to update the contract-registry\",\"params\":{\"_onlyOwnerCanUpdateRegistry\":\"indicates whether or not permission is restricted to owner only\"}},\"roundDiv(uint256,uint256)\":{\"details\":\"returns the nearest integer to a given quotient\",\"params\":{\"_d\":\"quotient denominator\",\"_n\":\"quotient numerator\"},\"returns\":{\"_0\":\"the nearest integer to the given quotient\"}},\"setConversionFee(uint32)\":{\"details\":\"updates the current conversion fee can only be called by the contract owner\",\"params\":{\"_conversionFee\":\"new conversion fee, represented in ppm\"}},\"setConversionWhitelist(address)\":{\"details\":\"allows the owner to update & enable the conversion whitelist contract address when set, only addresses that are whitelisted are actually allowed to use the converter note that the whitelist check is actually done by the BancorNetwork contract\",\"params\":{\"_whitelist\":\"address of a whitelist contract\"}},\"targetAmountAndFee(address,address,uint256)\":{\"details\":\"returns the expected target amount of converting one reserve to another along with the fee\",\"params\":{\"_amount\":\"amount of tokens received from the user\",\"_sourceToken\":\"contract address of the source reserve token\",\"_targetToken\":\"contract address of the target reserve token\"},\"returns\":{\"_0\":\"expected target amount\",\"_1\":\"expected fee\"}},\"token()\":{\"details\":\"deprecated since version 28, backward compatibility - use only for earlier versions\"},\"transferAnchorOwnership(address)\":{\"details\":\"transfers the anchor ownership the new owner needs to accept the transfer can only be called by the converter upgrder while the upgrader is the owner note that prior to version 28, you should use 'transferAnchorOwnership' instead\",\"params\":{\"_newOwner\":\"new token owner\"}},\"transferOwnership(address)\":{\"details\":\"allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner\",\"params\":{\"_newOwner\":\"new contract owner\"}},\"transferTokenOwnership(address)\":{\"details\":\"deprecated, backward compatibility\"},\"updateRegistry()\":{\"details\":\"updates to the new contract-registry\"},\"upgrade()\":{\"details\":\"upgrades the converter to the latest version can only be called by the owner note that the owner needs to call acceptOwnership on the new converter after the upgrade\"},\"withdrawETH(address)\":{\"details\":\"withdraws ether can only be called by the owner if the converter is inactive or by upgrader contract can only be called after the upgrader contract has accepted the ownership of this contract can only be called if the converter has an ETH reserve\",\"params\":{\"_to\":\"address to send the ETH to\"}},\"withdrawFromAnchor(address,address,uint256)\":{\"details\":\"withdraws tokens held by the anchor and sends them to an account can only be called by the owner\",\"params\":{\"_amount\":\"amount to withdraw\",\"_to\":\"account to receive the new amount\",\"_token\":\"ERC20 token contract address\"}},\"withdrawTokens(address,address,uint256)\":{\"details\":\"withdraws tokens held by the converter and sends them to an account can only be called by the owner note that reserve tokens can only be withdrawn by the owner while the converter is inactive unless the owner is the converter upgrader contract\",\"params\":{\"_amount\":\"amount to withdraw\",\"_to\":\"account to receive the new amount\",\"_token\":\"ERC20 token contract address\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol\":\"LiquidityPoolV1Converter\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/bancorx/interfaces/IBancorX.sol\":{\"keccak256\":\"0x65b5780d710159c7540078c38406c53db37a349fb468a0bf21bdc6262e497951\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://3df931a12770d10a22451326e38ae9d405d3e2716bdbdd6306b5e2361f6fe511\",\"dweb:/ipfs/QmcRBSaFLz516dAEqb8ZEiyx8ZTHZZ6rfxHn5roL2fHA3S\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol\":{\"keccak256\":\"0x242211f471f27635fa98bdeed238429942c55fc9a5e824c1a30cd88fad727f9b\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://f9769299a5e13c363d102c4c08b09e3a87ec053124dcc157be0a6448c13e3320\",\"dweb:/ipfs/QmUC2CaAr6emVkJN62xXBY83r1f7Hxj62UAavZsCSWcqUb\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/LiquidityPoolConverter.sol\":{\"keccak256\":\"0x075a4ba13d871f8f55da9889651f875a1f7537b2c8ea7ad330499d148345fc17\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://34f5ed00855a9737349919242b0c7f1d531ad4e7caf3c9e5c14583c743224eaa\",\"dweb:/ipfs/QmRjiQLCLCEkrkXFmaYRtu597ezB42mHCmdN2RkF876ibE\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol\":{\"keccak256\":\"0xf30c95034af4c4ec6e8a859e90cf7a0bada29a805ede76e04644107a7c677c4e\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://b48070d4abf9c4a08c39e6c494fa9efd7389aa7f8b61b283c9ba02062b1c59b6\",\"dweb:/ipfs/Qme6U7SpspFPzMH2mTyKsXCnJEAgg1vX6NNFzuykbVSY5R\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverter.sol\":{\"keccak256\":\"0x18b0d73a3d5ee951ede1b3f840ed35b40570e34975703079a4451555f4dd089b\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://1cd7263f1ef60793e3929509150420037df9a1194c3d0f40bb2ff5516d6a373f\",\"dweb:/ipfs/QmNUbsZt2rzWPjStYycgz3vMbNP4VrAqZPRAK39QNqUoos\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterAnchor.sol\":{\"keccak256\":\"0x9448cdbe90293fb5c1a0808b77af8754a1025b59c45f432eee01f659361a6115\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://1ef2bb2e1543c9324daf7f3fd086a57efb45b89f3d62b9d7a9fc78c138d24dbc\",\"dweb:/ipfs/QmVcXDib3K6xYJMBNxawmo4krJGiDfxb5oL64Lc3pi14XK\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterUpgrader.sol\":{\"keccak256\":\"0x456faf61358bfd76498892509cc99f9729f310c9450e28b0d03b5e7cd9752802\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://01f7b3f24cc895a948ea44f8e067d312b55ef1e9cf491908f3fb948d02b914da\",\"dweb:/ipfs/QmfSwZrWFWmT8xeX3iwSq75Vs8pQaQBGkmxJEHehUiPP1N\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol\":{\"keccak256\":\"0xa85da56481d8c3e936853f4292f67bb41a534163c11fdb380507fa99b8453648\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://20ab9df64f764e0b050525e489165119026ff12af769bf417ed682b5f3ee70d3\",\"dweb:/ipfs/QmVupKPZQwoTd5ifKDx71iyFVZ7hQvMeimMz7VE4TBn53v\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IERC20Token.sol\":{\"keccak256\":\"0xe6f988c3156e88258474526a541d5a42b6a9adae98b04177a059d9f723bc82cd\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://9a6eb77a5b9ce70995a11a6e48ac3985a4c70896fe5fe04d46146ad7c1c83ea3\",\"dweb:/ipfs/QmYvGSveZFG51tghwkVuu6eK9Jy8frHpfLxHTMyvNZN461\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IEtherToken.sol\":{\"keccak256\":\"0x6ed324da616d70af0b21fa073b1e5329b430e38b470177633a69710eff3da893\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://44f94aa59c67de636423cbdef82efb7d8e0562e73dfc9049a48054156aebaf14\",\"dweb:/ipfs/Qmdn8KAP54s7X3J6TCoZPhCpS19aCQzFYZuFABugJ5JA5D\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol\":{\"keccak256\":\"0x5cfc15e7a23a9872059b0cea4d2ae902c3fc074a39e1c645036ce38ad47881ec\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://890ee09d24de5778e34c4c27d1377d83d378e8f4a13fcb94d5102f61d4749cce\",\"dweb:/ipfs/QmT89f61fmsUN1BVdebKxUc5VU7sitiP33LNk7TTtF18oj\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ContractRegistryClient.sol\":{\"keccak256\":\"0x74caf88eff1cb113ad8277df9ba7933a6f1e0deea8fd1855157def3be833b859\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://c7793c9f245736cd8413bc8c4b5c40b67949cbee32289a16d29c83cf59396ad6\",\"dweb:/ipfs/QmWony7b1buUrGnE32gjLAnSwkBYMrJ68vUcCwDMmp3MbJ\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/Owned.sol\":{\"keccak256\":\"0x6ef69d9dcc80a8a36d5eb37783375cd5e4831c6d20c723fa6f6b6a06c0aeb53d\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://5a5d087e2c5b47739615ef22e1f29749de44b43c9a37cfae32b3dfc498a258c4\",\"dweb:/ipfs/Qmd1mXKEQbmBxqHk326LGVzNoayXsam8gZNecknnYpBnyh\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol\":{\"keccak256\":\"0x5ea87c10dd6e7e79212da712eb5f079c03361e6c96e299a4ffd9aaee8d6a3899\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://882aac64a791df35a942480e6ce611d1acb399af4ac0c4ef0288965c3785bf50\",\"dweb:/ipfs/QmeWeYYFh5HZAzJ1SzPHoTcPvZrE4NPUVfmjvH9Q3m36Gg\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/SafeMath.sol\":{\"keccak256\":\"0x1ab7391a19ca8a3ad2f3c4a1074e080d4d76dfdb834637bdd0c1e6b6acdf28af\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://d6d8c99621ca884b72da2d84eddfec8ec8c5533915691d6eec94a07adf445608\",\"dweb:/ipfs/QmaXr6DN7VbfxfMn3PsTy7SAMgZVVXbdeaw11BsAjVL2x1\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol\":{\"keccak256\":\"0xf65b87e3bf3343e368da67878c19d1a043a1025b10e9053d3562b53b4aa447fe\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://b85c5d96642c14c53b8d5062eecd4d27d3bdb457d1d0f130900763a75a512eb7\",\"dweb:/ipfs/QmUHtbqC1khqnRZXYn11Aykus4m5e9MVNUWqorxhpr5ipJ\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHolder.sol\":{\"keccak256\":\"0xac6bc102eff6c1bb8c1bb4466eab50322c7c101e2e33d577dd3035f106627577\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://9fdbda2d4509260ca3dd43654bdaea07ef18a5e04213ff16e38e3b4abad78a5f\",\"dweb:/ipfs/QmPb69rzX1DwDeEhhfzqQNS3U2bfGcFjXNaV5ffHsZHzfP\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/Types.sol\":{\"keccak256\":\"0x1616bdc4668c6396eb8e302177249284a5406dc1dfa3c9ab2e83f6c3c180be36\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://f4feb67f11147068d227366f8a13e4261ad1f927f0fd01d1e1764479ab2df8f5\",\"dweb:/ipfs/QmYV4TdmbL8pyeRi2w5ofUzTK3CEiwUZepia5JcuFgxb4x\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/Utils.sol\":{\"keccak256\":\"0x073efa69fcd6b5e60f841b28b366d63b62ff48ab12a06ce3f5a7f41afd6ce885\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://e8b8ecb2d29197ca77f0ed98f728ace54e6edcfdf5cd1194ae22701607eaf608\",\"dweb:/ipfs/QmcsR6Q35Hurh3TrPkYAboicz9bQQoGCWmZLzUCDyhotH8\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/interfaces/IContractRegistry.sol\":{\"keccak256\":\"0x3551889a83738b621c29ed66f1ecb6a843cca4217e54c9357198559b9cc92259\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://231a59c8f2665adeda8c7e6930832409c9b991fd27ad84b3a24335e7bf269bbe\",\"dweb:/ipfs/QmeJJbn1EAUbZenruTEdJAnwUn3dxsVNeJvxPe81qKEGqL\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/interfaces/IOwned.sol\":{\"keccak256\":\"0xc60a9d197abc28c1906ed4d18b59caa0242db754a0e1f67af6e6277593530dae\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://a8c6f3e6525a81a5165ccbf04f73f6c389c14b74135d11a7b5f70b1c9bdac75c\",\"dweb:/ipfs/QmaPu4Z7yUPc9sMADmoTZVY6AnyDSYHtNNCx3mm4VkJwhP\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/interfaces/ITokenHolder.sol\":{\"keccak256\":\"0x9ccb8ab04d0bd874ba7aae5277e60f35c36918922649a0596bf3664ed257bfe2\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://b65e6db19cd244c9f3545695de5fd7573711c49fb306631ddbf0e1d2fa9fb589\",\"dweb:/ipfs/QmZeu5KYVMTbTx7h2BVUq52fpwL9Q44AUfzeVksucDohgf\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/interfaces/IWhitelist.sol\":{\"keccak256\":\"0x356ad553ceeaea04d7cb8f0d6a5663c47dfccb2bd82517348128f032416ee34a\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://9ea3bbb9945144ead2c1392351f2f9f7444af78569f2b95da2e68bb6b919db52\",\"dweb:/ipfs/QmPyUAk44Kj7nJB4tzYqeSXWHyYP51mRNynEmWra9m4eKS\"]}},\"version\":1}",
"bytecode": "0x60806040526003805460ff60a81b191690557fc0829421c1d260bd3cb3e0f06cfe2d52db2ce3150000000000000000000000006008556009805460ff191690553480156200004c57600080fd5b50604051620056ce380380620056ce833981810160405260608110156200007257600080fd5b5080516020820151604090920151600080546001600160a01b031916331790559091908282828282828180620000a88162000142565b50600280546001600160a01b039092166001600160a01b031992831681179091556003805490921617905582620000df8162000142565b81620000eb81620001a1565b5050600480546001600160a01b039094166001600160a01b031990941693909317909255506008805463ffffffff9092166401000000000263ffffffff60201b199092169190911790555062000200945050505050565b6001600160a01b0381166200019e576040805162461bcd60e51b815260206004820152601360248201527f4552525f494e56414c49445f4144445245535300000000000000000000000000604482015290519081900360640190fd5b50565b620f424063ffffffff821611156200019e576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6154be80620002106000396000f3fe6080604052600436106103905760003560e01c806371f52bf3116101dc578063ca1d209d11610102578063d66bd524116100a0578063e8dc12ff1161006f578063e8dc12ff14611081578063ecbca55d146110c7578063f2fde38b146110f7578063fc0c546a1461112a57610421565b8063d66bd52414610fd3578063d895951214611006578063dc8de37914611039578063e2c524681461106c57610421565b8063d260529c116100dc578063d260529c14610f7f578063d3fb73b414610f94578063d4ee1d9014610fa9578063d55ec69714610fbe57610421565b8063ca1d209d14610f23578063cdc91c6914610f40578063d031370b14610f5557610421565b80639b99a8e21161017a578063b4a176d311610149578063b4a176d314610eb4578063bbb7e5d814610ec9578063bf75455814610ef9578063c45d3d9214610f0e57610421565b80639b99a8e214610c77578063a60e772414610c8c578063af94b8d814610d3a578063b127c0a514610d7d57610421565b80637d8916bd116101b65780637d8916bd14610a7557806380d9416d14610b9a5780638da5cb5b14610c4d57806394c275ad14610c6257610421565b806371f52bf314610a3657806379ba509714610a4b5780637b10399914610a6057610421565b806338e9f27a116102c157806354fd4d501161025f57806367b6d57c1161022e57806367b6d57c14610967578063690d83201461099a5780636a49d2c4146109cd5780636aa5332c14610a0c57610421565b806354fd4d50146108e5578063579cd3ca146108fa5780635e35359e1461090f57806361cd756e1461095257610421565b8063415f12401161029b578063415f12401461083a57806349d10b64146108645780634af80f0e146108795780634e40c260146108ac57610421565b806338e9f27a146107b6578063395900d4146107cb5780633e8ff43f1461080e57610421565b80631d4db7911161032e57806321e6b53d1161030857806321e6b53d1461074457806322f3e2d4146107775780632fe8a6ad1461078c57806338a5e016146107a157610421565b80631d4db7911461068e5780631e1401f8146106b55780631f0181bc1461071157610421565b806312c2aca41161036a57806312c2aca4146104e7578063154588371461051057806319b64015146106155780631cfab2901461065b57610421565b8063024c7ec7146104265780630c7d5cd8146104525780630e53aae91461048057610421565b366104215760008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1661041f576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b005b600080fd5b34801561043257600080fd5b5061041f6004803603602081101561044957600080fd5b5035151561113f565b34801561045e57600080fd5b50610467611165565b6040805163ffffffff9092168252519081900360200190f35b34801561048c57600080fd5b506104b3600480360360208110156104a357600080fd5b50356001600160a01b0316611171565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156104f357600080fd5b506104fc611208565b604080519115158252519081900360200190f35b34801561051c57600080fd5b506105c56004803603604081101561053357600080fd5b81359190810190604081016020820135600160201b81111561055457600080fd5b82018360208201111561056657600080fd5b803590602001918460208302840111600160201b8311171561058757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061124f945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106015781810151838201526020016105e9565b505050509050019250505060405180910390f35b34801561062157600080fd5b5061063f6004803603602081101561063857600080fd5b50356112f6565b604080516001600160a01b039092168252519081900360200190f35b34801561066757600080fd5b506104676004803603602081101561067e57600080fd5b50356001600160a01b0316611320565b34801561069a57600080fd5b506106a3611352565b60408051918252519081900360200190f35b3480156106c157600080fd5b506106f8600480360360608110156106d857600080fd5b506001600160a01b03813581169160208101359091169060400135611358565b6040805192835260208301919091528051918290030190f35b34801561071d57600080fd5b506106f86004803603602081101561073457600080fd5b50356001600160a01b0316611373565b34801561075057600080fd5b5061041f6004803603602081101561076757600080fd5b50356001600160a01b031661142a565b34801561078357600080fd5b506104fc61143e565b34801561079857600080fd5b506104fc6114bd565b3480156107ad57600080fd5b5061041f6114cd565b3480156107c257600080fd5b506104fc6114df565b3480156107d757600080fd5b5061041f600480360360608110156107ee57600080fd5b506001600160a01b038135811691602081013590911690604001356114e8565b34801561081a57600080fd5b5061082361156e565b6040805161ffff9092168252519081900360200190f35b34801561084657600080fd5b506105c56004803603602081101561085d57600080fd5b5035611573565b34801561087057600080fd5b5061041f6117b1565b34801561088557600080fd5b5061041f6004803603602081101561089c57600080fd5b50356001600160a01b03166119b9565b3480156108b857600080fd5b506106a3600480360360408110156108cf57600080fd5b506001600160a01b0381351690602001356119ee565b3480156108f157600080fd5b50610823611b2a565b34801561090657600080fd5b50610467611b2f565b34801561091b57600080fd5b5061041f6004803603606081101561093257600080fd5b506001600160a01b03813581169160208101359091169060400135611b42565b34801561095e57600080fd5b5061063f611c73565b34801561097357600080fd5b5061041f6004803603602081101561098a57600080fd5b50356001600160a01b0316611c82565b3480156109a657600080fd5b5061041f600480360360208110156109bd57600080fd5b50356001600160a01b0316611d2e565b3480156109d957600080fd5b5061041f600480360360408110156109f057600080fd5b5080356001600160a01b0316906020013563ffffffff16611e55565b348015610a1857600080fd5b506106a360048036036020811015610a2f57600080fd5b5035611f1e565b348015610a4257600080fd5b50610823611f40565b348015610a5757600080fd5b5061041f611f4f565b348015610a6c57600080fd5b5061063f612006565b6106a360048036036060811015610a8b57600080fd5b810190602081018135600160201b811115610aa557600080fd5b820183602082011115610ab757600080fd5b803590602001918460208302840111600160201b83111715610ad857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b2757600080fd5b820183602082011115610b3957600080fd5b803590602001918460208302840111600160201b83111715610b5a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250612015915050565b348015610ba657600080fd5b506105c560048036036060811015610bbd57600080fd5b810190602081018135600160201b811115610bd757600080fd5b820183602082011115610be957600080fd5b803590602001918460208302840111600160201b83111715610c0a57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602001356122df565b348015610c5957600080fd5b5061063f61258e565b348015610c6e57600080fd5b5061046761259d565b348015610c8357600080fd5b506108236125b0565b348015610c9857600080fd5b506106a360048036036020811015610caf57600080fd5b810190602081018135600160201b811115610cc957600080fd5b820183602082011115610cdb57600080fd5b803590602001918460208302840111600160201b83111715610cfc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506125b6945050505050565b348015610d4657600080fd5b506106f860048036036060811015610d5d57600080fd5b506001600160a01b03813581169160208101359091169060400135612608565b348015610d8957600080fd5b506105c560048036036060811015610da057600080fd5b81359190810190604081016020820135600160201b811115610dc157600080fd5b820183602082011115610dd357600080fd5b803590602001918460208302840111600160201b83111715610df457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610e4357600080fd5b820183602082011115610e5557600080fd5b803590602001918460208302840111600160201b83111715610e7657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506127ab945050505050565b348015610ec057600080fd5b5061041f6128e7565b348015610ed557600080fd5b506106a360048036036040811015610eec57600080fd5b5080359060200135612913565b348015610f0557600080fd5b506104fc61292b565b348015610f1a57600080fd5b5061063f612930565b6106a360048036036020811015610f3957600080fd5b503561293f565b348015610f4c57600080fd5b5061041f612dba565b348015610f6157600080fd5b5061063f60048036036020811015610f7857600080fd5b5035612e13565b348015610f8b57600080fd5b506104fc61156e565b348015610fa057600080fd5b5061063f612e3a565b348015610fb557600080fd5b5061063f612e49565b348015610fca57600080fd5b5061041f612e58565b348015610fdf57600080fd5b506104b360048036036020811015610ff657600080fd5b50356001600160a01b0316612f40565b34801561101257600080fd5b506106a36004803603602081101561102957600080fd5b50356001600160a01b0316612f82565b34801561104557600080fd5b506106a36004803603602081101561105c57600080fd5b50356001600160a01b0316612f89565b34801561107857600080fd5b506106f8612fb2565b6106a3600480360360a081101561109757600080fd5b506001600160a01b0381358116916020810135821691604082013591606081013582169160809091013516612fbb565b3480156110d357600080fd5b5061041f600480360360208110156110ea57600080fd5b503563ffffffff166131cb565b34801561110357600080fd5b5061041f6004803603602081101561111a57600080fd5b50356001600160a01b03166132b2565b34801561113657600080fd5b5061063f613330565b61114761333f565b60038054911515600160a01b0260ff60a01b19909216919091179055565b60085463ffffffff1681565b6000806000806000611181615400565b505050506001600160a01b03929092166000908152600760209081526040808320815160a081018352815480825260019092015463ffffffff811694820185905260ff600160201b82048116151594830194909452650100000000008104841615156060830152600160301b90049092161515608090920182905295919450919250829190565b60008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff165b90565b60048054604080516318160ddd60e01b815290516060936000936001600160a01b0316926318160ddd9281830192602092829003018186803b15801561129457600080fd5b505afa1580156112a8573d6000803e3d6000fd5b505050506040513d60208110156112be57600080fd5b5051905060006112dd6c42616e636f72466f726d756c6160981b613392565b90506112eb85858484613410565b925050505b92915050565b60006006828154811061130557fe5b6000918252602090912001546001600160a01b031692915050565b60008161132c81613555565b50506001600160a01b031660009081526007602052604090206001015463ffffffff1690565b600c5481565b600080611366858585612608565b915091505b935093915050565b600954600090819060ff166113c7576040805162461bcd60e51b815260206004820152601560248201527411549497d393d397d4d510539110549117d413d3d3605a1b604482015290519081900360640190fd5b6113cf61542e565b6113d76135c2565b905060066000815481106113e757fe5b6000918252602090912001546001600160a01b03858116911614156114185780516020909101519092509050611425565b6020810151905190925090505b915091565b61143261333f565b61143b81611c82565b50565b6004805460408051638da5cb5b60e01b8152905160009330936001600160a01b031692638da5cb5b9281830192602092829003018186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d60208110156114ac57600080fd5b50516001600160a01b031614905090565b600354600160a01b900460ff1681565b6114d561333f565b6114dd612dba565b565b60095460ff1681565b6114f061333f565b6004805460408051632f1a9acf60e11b81526001600160a01b038781169482019490945285841660248201526044810185905290519290911691635e35359e9160648082019260009290919082900301818387803b15801561155157600080fd5b505af1158015611565573d6000803e3d6000fd5b50505050505050565b600190565b606061157d61375d565b6003805460ff60a81b1916600160a81b179055816115d4576040805162461bcd60e51b815260206004820152600f60248201526e11549497d6915493d7d05353d55395608a1b604482015290519081900360640190fd5b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561162457600080fd5b505afa158015611638573d6000803e3d6000fd5b505050506040513d602081101561164e57600080fd5b5051600480546040805163a24835d160e01b8152339381019390935260248301879052519293506001600160a01b03169163a24835d19160448082019260009290919082900301818387803b1580156116a657600080fd5b505af11580156116ba573d6000803e3d6000fd5b505060065460609250905067ffffffffffffffff811180156116db57600080fd5b50604051908082528060200260200182016040528015611705578160200160208202803683370190505b50905060005b815181101561173557600182828151811061172257fe5b602090810291909101015260010161170b565b5061179c600680548060200260200160405190810160405280929190818152602001828054801561178f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611771575b50505050508284876137ad565b6003805460ff60a81b19169055949350505050565b6000546001600160a01b03163314806117d45750600354600160a01b900460ff16155b611819576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b60006118376f436f6e7472616374526567697374727960801b613392565b6002549091506001600160a01b0380831691161480159061186057506001600160a01b03811615155b6118a8576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60006001600160a01b0316816001600160a01b031663bb34534c6f436f6e7472616374526567697374727960801b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561190a57600080fd5b505afa15801561191e573d6000803e3d6000fd5b505050506040513d602081101561193457600080fd5b50516001600160a01b03161415611989576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60028054600380546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6119c161333f565b806119cb816139b8565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60048054604080516318160ddd60e01b8152905160009384936001600160a01b0316926318160ddd9281830192602092829003018186803b158015611a3257600080fd5b505afa158015611a46573d6000803e3d6000fd5b505050506040513d6020811015611a5c57600080fd5b505190506000611a7b6c42616e636f72466f726d756c6160981b613392565b6001600160a01b03868116600090815260076020908152604091829020546008548351632f55bdb560e01b815260048101899052602481019290925263ffffffff16604482015260648101899052915193945091841692632f55bdb592608480840193919291829003018186803b158015611af557600080fd5b505afa158015611b09573d6000803e3d6000fd5b505050506040513d6020811015611b1f57600080fd5b505195945050505050565b602781565b600854600160401b900463ffffffff1681565b611b4a61375d565b6003805460ff60a81b1916600160a81b179055611b6561333f565b6000611b8a762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b6001600160a01b038516600090815260076020526040902060010154909150600160301b900460ff161580611bc45750611bc261143e565b155b80611bdc57506000546001600160a01b038281169116145b611c21576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611c2c848484613a0c565b6001600160a01b038416600090815260076020526040902060010154600160301b900460ff1615611c6057611c6084613a3d565b50506003805460ff60a81b191690555050565b6003546001600160a01b031681565b611c8a61333f565b762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611cae81613b16565b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611d1257600080fd5b505af1158015611d26573d6000803e3d6000fd5b505050505050565b611d3661375d565b6003805460ff60a81b1916600160a81b179055611d5161333f565b600080516020615449833981519152611d6981613555565b6000611d8e762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b9050611d9861143e565b1580611db157506000546001600160a01b038281169116145b611df6576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6040516001600160a01b038416904780156108fc02916000818181858888f19350505050158015611e2b573d6000803e3d6000fd5b50611e43600080516020615449833981519152613a3d565b50506003805460ff60a81b1916905550565b611e5d61333f565b611e678282613b78565b6006546002148015611ebb5750600760006006600081548110611e8657fe5b6000918252602080832091909101546001600160a01b0316835282019290925260400190206001015463ffffffff166207a120145b8015611f095750600760006006600181548110611ed457fe5b6000918252602080832091909101546001600160a01b0316835282019290925260400190206001015463ffffffff166207a120145b6009805460ff19169115159190911790555050565b600080825b8015611f395760019190910190600a9004611f23565b5092915050565b6000611f4a6125b0565b905090565b6001546001600160a01b03163314611fa2576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6002546001600160a01b031681565b600061201f61375d565b6003805460ff60a81b1916600160a81b17905561203a613d9a565b612045848484613de2565b60005b84518110156120f5576000805160206154498339815191526001600160a01b031685828151811061207557fe5b60200260200101516001600160a01b031614156120ed573484828151811061209957fe5b6020026020010151146120ed576040805162461bcd60e51b815260206004820152601760248201527608aa4a4be8aa890be829a9eaa9ca8be9a92a69a82a8869604b1b604482015290519081900360640190fd5b600101612048565b5034156121855760008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff16612185576040805162461bcd60e51b81526020600482015260126024820152714552525f4e4f5f4554485f5245534552564560701b604482015290519081900360640190fd5b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d557600080fd5b505afa1580156121e9573d6000803e3d6000fd5b505050506040513d60208110156121ff57600080fd5b505190506000612210868684614077565b90508381101561225c576040805162461bcd60e51b81526020600482015260126024820152714552525f52455455524e5f544f4f5f4c4f5760701b604482015290519081900360640190fd5b600480546040805163219e412d60e21b8152339381019390935260248301849052516001600160a01b039091169163867904b491604480830192600092919082900301818387803b1580156122b057600080fd5b505af11580156122c4573d6000803e3d6000fd5b50506003805460ff60a81b1916905550909695505050505050565b606080845167ffffffffffffffff811180156122fa57600080fd5b50604051908082528060200260200182016040528015612324578160200160208202803683370190505b5090506000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561237757600080fd5b505afa15801561238b573d6000803e3d6000fd5b505050506040513d60208110156123a157600080fd5b5051905060006123c06c42616e636f72466f726d756c6160981b613392565b90506000816001600160a01b0316632f55bdb584600760008c8c815181106123e457fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff166044840152606483018b905251608480840193829003018186803b15801561245e57600080fd5b505afa158015612472573d6000803e3d6000fd5b505050506040513d602081101561248857600080fd5b5051905060005b845181101561257f57826001600160a01b031663ebbb215885600760008d86815181106124b857fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff1660448401526064830187905251608480840193829003018186803b15801561253257600080fd5b505afa158015612546573d6000803e3d6000fd5b505050506040513d602081101561255c57600080fd5b5051855186908390811061256c57fe5b602090810291909101015260010161248f565b509293505050505b9392505050565b6000546001600160a01b031681565b600854600160201b900463ffffffff1681565b60065490565b80516000908190815b818110156125ef576125e38582815181106125d657fe5b6020026020010151611f1e565b909201916001016125bf565b5060016125fc8383612913565b03600a0a949350505050565b600080612613613d9a565b8461261d81613555565b8461262781613555565b856001600160a01b0316876001600160a01b03161415612687576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b60006126a26c42616e636f72466f726d756c6160981b613392565b6001600160a01b03166394491fab6126b98a612f89565b6001600160a01b038b1660009081526007602052604090206001015463ffffffff166126e48b612f89565b6001600160a01b038c166000908152600760209081526040918290206001015482516001600160e01b031960e089901b168152600481019690965263ffffffff94851660248701526044860193909352929091166064840152608483018b90525160a480840193829003018186803b15801561275f57600080fd5b505afa158015612773573d6000803e3d6000fd5b505050506040513d602081101561278957600080fd5b505190506000612798826140a2565b9182900399919850909650505050505050565b60606127b561375d565b6003805460ff60a81b1916600160a81b1790556127d0613d9a565b6127db838386613de2565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561282b57600080fd5b505afa15801561283f573d6000803e3d6000fd5b505050506040513d602081101561285557600080fd5b5051600480546040805163a24835d160e01b8152339381019390935260248301899052519293506001600160a01b03169163a24835d19160448082019260009290919082900301818387803b1580156128ad57600080fd5b505af11580156128c1573d6000803e3d6000fd5b505050506128d1848483886137ad565b6003805460ff60a81b1916905595945050505050565b6128ef61333f565b600354600280546001600160a01b0319166001600160a01b03909216919091179055565b6000816002810484018161292357fe5b049392505050565b600181565b6005546001600160a01b031681565b600061294961375d565b6003805460ff60a81b1916600160a81b1790556129646140d3565b6000805160206154498339815191526000526007602052600080516020615469833981519152546129959034614113565b6000805160206154498339815191526000908152600760209081526000805160206154698339815191529290925560048054604080516318160ddd60e01b8152905193946001600160a01b03909216936318160ddd938281019392829003018186803b158015612a0457600080fd5b505afa158015612a18573d6000803e3d6000fd5b505050506040513d6020811015612a2e57600080fd5b505190506000612a4d6c42616e636f72466f726d756c6160981b613392565b60065490915060005b81811015612d3757600060068281548110612a6d57fe5b60009182526020808320909101546001600160a01b03908116808452600783526040808520546008548251631d77642b60e31b8152600481018d90526024810183905263ffffffff9091166044820152606481018e9052915192965094939289169263ebbb215892608480840193829003018186803b158015612aef57600080fd5b505afa158015612b03573d6000803e3d6000fd5b505050506040513d6020811015612b1957600080fd5b505190506001600160a01b0383166000805160206154498339815191521415612c645780341115612b795760405133903483900380156108fc02916000818181858888f19350505050158015612b73573d6000803e3d6000fd5b50612c5f565b80341015612c5f573415612bcc576040805162461bcd60e51b81526020600482015260156024820152744552525f494e56414c49445f4554485f56414c554560581b604482015290519081900360640190fd5b600854612beb90600160601b90046001600160a01b0316333084614160565b6008600c9054906101000a90046001600160a01b03166001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612c4657600080fd5b505af1158015612c5a573d6000803e3d6000fd5b505050505b612c70565b612c7083333084614160565b6000612c7c83836142cb565b6001600160a01b0385166000908152600760205260408120829055909150612ca4898c6142cb565b604080518581526020810185905280820183905290519192506001600160a01b0387169133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038516600090815260076020526040902060010154612d269082908790859063ffffffff16614314565b505060019093019250612a56915050565b50600480546040805163219e412d60e21b8152339381019390935260248301889052516001600160a01b039091169163867904b491604480830192600092919082900301818387803b158015612d8c57600080fd5b505af1158015612da0573d6000803e3d6000fd5b50506003805460ff60a81b19169055509495945050505050565b612dc261333f565b612dca614383565b6004546001906001600160a01b0316612de161156e565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4565b60068181548110612e2057fe5b6000918252602090912001546001600160a01b0316905081565b6004546001600160a01b031681565b6001546001600160a01b031681565b612e6061333f565b6000612e85762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b6004549091506000906001600160a01b0316612e9f61156e565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4612ed8816132b2565b6040805163487ac64b60e11b81526027600482015290516001600160a01b038316916390f58c9691602480830192600092919082900301818387803b158015612f2057600080fd5b505af1158015612f34573d6000803e3d6000fd5b5050505061143b611f4f565b6007602052600090815260409020805460019091015463ffffffff81169060ff600160201b8204811691650100000000008104821691600160301b9091041685565b60006112f0825b600081612f9581613555565b50506001600160a01b031660009081526007602052604090205490565b600a54600b5482565b6000612fc561375d565b6003805460ff60a81b1916600160a81b1790556c42616e636f724e6574776f726b60981b612ff281613b16565b856001600160a01b0316876001600160a01b03161415613052576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b6005546001600160a01b0316158061315f575060055460408051633af32abf60e01b81526001600160a01b03878116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156130b257600080fd5b505afa1580156130c6573d6000803e3d6000fd5b505050506040513d60208110156130dc57600080fd5b5051801561315f575060055460408051633af32abf60e01b81526001600160a01b03868116600483015291519190921691633af32abf916024808301926020929190829003018186803b15801561313257600080fd5b505afa158015613146573d6000803e3d6000fd5b505050506040513d602081101561315c57600080fd5b50515b6131a6576040805162461bcd60e51b815260206004820152601360248201527211549497d393d517d5d2125511531254d51151606a1b604482015290519081900360640190fd5b6131b387878787876143e7565b6003805460ff60a81b19169055979650505050505050565b6131d361333f565b60085463ffffffff600160201b9091048116908216111561323b576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6008546040805163ffffffff600160401b90930483168152918316602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a16008805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6132ba61333f565b6000546001600160a01b038281169116141561330e576040805162461bcd60e51b815260206004820152600e60248201526d22a9292fa9a0a6a2afa7aba722a960911b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031690565b6000546001600160a01b031633146114dd576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b60025460408051632ecd14d360e21b81526004810184905290516000926001600160a01b03169163bb34534c916024808301926020929190829003018186803b1580156133de57600080fd5b505afa1580156133f2573d6000803e3d6000fd5b505050506040513d602081101561340857600080fd5b505192915050565b606080845167ffffffffffffffff8111801561342b57600080fd5b50604051908082528060200260200182016040528015613455578160200160208202803683370190505b50905060005b815181101561354b57836001600160a01b0316638074590a86600760008a868151811061348457fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff166044840152606483018c905251608480840193829003018186803b1580156134fe57600080fd5b505afa158015613512573d6000803e3d6000fd5b505050506040513d602081101561352857600080fd5b5051825183908390811061353857fe5b602090810291909101015260010161345b565b5095945050505050565b6001600160a01b038116600090815260076020526040902060010154600160301b900460ff1661143b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b6135ca61542e565b6000600c546135d76146aa565b039050806135fd57505060408051808201909152600a548152600b54602082015261124c565b600060076000600660018154811061361157fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460068054919350600791839190829061364b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549050610258831061369657604080518082019091529182526020820152915061124c9050565b61369e61542e565b5060408051808201909152600a548152600b54602082018190526000906136c590856146ae565b82519091506000906136d790856146ae565b905060006136fd6136e884896146ae565b6136f7846102588b90036146ae565b906142cb565b9050600061372461025861371e8888602001516146ae90919063ffffffff16565b906146ae565b905061373e82826c0c9f2c9cd04674edea4000000061470c565b6040805180820190915291825260208201529850505050505050505090565b600354600160a81b900460ff16156114dd576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b60606137b76140d3565b60006137d26c42616e636f72466f726d756c6160981b613392565b905060006137e08585614113565b905060606137f085898886613410565b905060005b88518110156139ac57600089828151811061380c57fe5b60200260200101519050600083838151811061382457fe5b6020026020010151905089838151811061383a57fe5b602002602001015181101561388f576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b6001600160a01b0382166000908152600760205260408120546138b29083614113565b6001600160a01b0384166000818152600760205260409020829055909150600080516020615449833981519152141561391857604051339083156108fc029084906000818181858888f19350505050158015613912573d6000803e3d6000fd5b50613923565b61392383338461473e565b604080518381526020810183905280820188905290516001600160a01b0385169133917fbc7d19d505c7ec4db83f3b51f19fb98c4c8a99922e7839d1ee608dfbee29501b9181900360600190a36001600160a01b0383166000908152600760205260409020600101546139a19087908590849063ffffffff16614314565b5050506001016137f5565b50979650505050505050565b6001600160a01b03811630141561143b576040805162461bcd60e51b815260206004820152601360248201527222a9292fa0a2222922a9a9afa4a9afa9a2a62360691b604482015290519081900360640190fd5b613a1461333f565b82613a1e8161489e565b82613a288161489e565b83613a32816139b8565b611d2686868661473e565b80613a4781613555565b6001600160a01b0382166000805160206154498339815191521415613a86576001600160a01b0382166000908152600760205260409020479055613b12565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015613acc57600080fd5b505afa158015613ae0573d6000803e3d6000fd5b505050506040513d6020811015613af657600080fd5b50516001600160a01b0383166000908152600760205260409020555b5050565b613b1f81613392565b6001600160a01b0316336001600160a01b03161461143b576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b613b8061333f565b613b886148ef565b81613b928161489e565b82613b9c816139b8565b82613ba681614936565b6004546001600160a01b03868116911614801590613be757506001600160a01b038516600090815260076020526040902060010154600160301b900460ff16155b613c2e576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60085463ffffffff908116620f42400381169085161115613c96576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b61ffff613ca16125b0565b61ffff1610613cf3576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b5050506001600160a01b0390911660008181526007602052604081208181556001908101805466ff0000000000001963ffffffff80881663ffffffff199384161791909116600160301b179092556006805493840181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910180546001600160a01b031916909317909255600880548084169094019092169216919091179055565b613da261143e565b6114dd576040805162461bcd60e51b815260206004820152600c60248201526b4552525f494e41435449564560a01b604482015290519081900360640190fd5b600654835160009182918114613e35576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b84518114613e7f576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600092505b808310156140305760076000878581518110613e9c57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060010160069054906101000a900460ff16613f1c576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b600091505b80821015613f7e57858281518110613f3557fe5b60200260200101516001600160a01b031660068481548110613f5357fe5b6000918252602090912001546001600160a01b03161415613f7357613f7e565b600190910190613f21565b808210613fc8576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b6000858481518110613fd657fe5b602002602001015111614025576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600190920191613e84565b60008411611d26576040805162461bcd60e51b815260206004820152600f60248201526e11549497d6915493d7d05353d55395608a1b604482015290519081900360640190fd5b60008161408f5761408884846149a6565b9050612587565b61409a848484614ac5565b949350505050565b6008546000906112f090620f4240906140cd908590600160401b900463ffffffff908116906146ae16565b90614df2565b60065460005b81811015613b125761410b600682815481106140f157fe5b6000918252602090912001546001600160a01b0316613a3d565b6001016140d9565b60008183101561415a576040805162461bcd60e51b815260206004820152600d60248201526c4552525f554e444552464c4f5760981b604482015290519081900360640190fd5b50900390565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106141e55780518252601f1990920191602091820191016141c6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114614247576040519150601f19603f3d011682016040523d82523d6000602084013e61424c565b606091505b509150915081801561427a57508051158061427a575080806020019051602081101561427757600080fd5b50515b611d26576040805162461bcd60e51b815260206004820152601860248201527f4552525f5452414e534645525f46524f4d5f4641494c45440000000000000000604482015290519081900360640190fd5b600082820183811015612587576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b6004546001600160a01b0380851691167f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c2461435285620f42406146ae565b6143658863ffffffff808816906146ae16565b6040805192835260208301919091528051918290030190a350505050565b600161438d6125b0565b61ffff16116143df576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b6114dd614e51565b60008060006143f7888888612608565b91509150816000141561444a576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b61445387612f89565b821061445b57fe5b6001600160a01b03881660008051602061544983398151915214156144cd578534146144c8576040805162461bcd60e51b815260206004820152601760248201527608aa4a4be8aa890be829a9eaa9ca8be9a92a69a82a8869604b1b604482015290519081900360640190fd5b6145a4565b3415801561455e57508561455b6144e38a612f89565b604080516370a0823160e01b815230600482015290516001600160a01b038d16916370a08231916024808301926020929190829003018186803b15801561452957600080fd5b505afa15801561453d573d6000803e3d6000fd5b505050506040513d602081101561455357600080fd5b505190614113565b10155b6145a4576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b6145ad88613a3d565b6001600160a01b0387166000908152600760205260409020546145d09083614113565b6001600160a01b038816600081815260076020526040902091909155600080516020615449833981519152141561463d576040516001600160a01b0385169083156108fc029084906000818181858888f19350505050158015614637573d6000803e3d6000fd5b50614648565b61464887858461473e565b60095460ff168015614662575061465d6146aa565b600c54105b156146875761466f6135c2565b8051600a5560200151600b556146836146aa565b600c555b614695888887898686614f18565b61469f8888614f81565b509695505050505050565b4290565b6000826146bd575060006112f0565b828202828482816146ca57fe5b0414612587576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b6000808285118061471c57508284115b156147355761472c858585615185565b9150915061136b565b50929391925050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106147bb5780518252601f19909201916020918201910161479c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461481d576040519150601f19603f3d011682016040523d82523d6000602084013e614822565b606091505b5091509150818015614850575080511580614850575080806020019051602081101561484d57600080fd5b50515b614897576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b5050505050565b6001600160a01b03811661143b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f4144445245535360681b604482015290519081900360640190fd5b6148f761143e565b156114dd576040805162461bcd60e51b815260206004820152600a6024820152694552525f41435449564560b01b604482015290519081900360640190fd5b60008163ffffffff161180156149555750620f424063ffffffff821611155b61143b576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b6000806149b2836125b6565b905060005b8451811015614abd5760008582815181106149ce57fe5b6020026020010151905060008583815181106149e657fe5b602002602001015190506000805160206154498339815191526001600160a01b0316826001600160a01b031614614a2357614a2382333084614160565b6001600160a01b0382166000818152600760209081526040918290208490558151848152908101849052808201879052905133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038216600090815260076020526040902060010154614ab39085908490849063ffffffff16614314565b50506001016149b7565b509392505050565b6000614acf6140d3565b600080516020615449833981519152600052600760205260008051602061546983398151915254614b009034614113565b6000805160206154498339815191526000908152600760205260008051602061546983398151915291909155614b456c42616e636f72466f726d756c6160981b613392565b90506000614b55828588886151ca565b90506000614b6385836142cb565b905060005b8751811015614de6576000888281518110614b7f57fe5b6020908102919091018101516001600160a01b038082166000908152600784526040808220546008548251631d77642b60e31b8152600481018f90526024810183905263ffffffff9091166044820152606481018b90529151949650949193928a169263ebbb215892608480840193919291829003018186803b158015614c0557600080fd5b505afa158015614c19573d6000803e3d6000fd5b505050506040513d6020811015614c2f57600080fd5b5051905080614c7e576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b898481518110614c8a57fe5b6020026020010151811115614c9b57fe5b6001600160a01b03831660008051602061544983398151915214614cca57614cc583333084614160565b614d35565b808a8581518110614cd757fe5b60200260200101511115614d3557336001600160a01b03166108fc828c8781518110614cff57fe5b6020026020010151039081150290604051600060405180830381858888f19350505050158015614d33573d6000803e3d6000fd5b505b6000614d4183836142cb565b6001600160a01b03851660008181526007602090815260409182902084905581518681529081018490528082018a90529051929350909133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038416600090815260076020526040902060010154614dd69087908690849063ffffffff16614314565b505060019092019150614b689050565b50909695505050505050565b6000808211614e3d576040805162461bcd60e51b81526020600482015260126024820152714552525f4449564944455f42595f5a45524f60701b604482015290519081900360640190fd5b6000828481614e4857fe5b04949350505050565b614e5961333f565b6000614e636125b0565b61ffff1611614eb5576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b60048054604080516379ba509760e01b815290516001600160a01b03909216926379ba509792828201926000929082900301818387803b158015614ef857600080fd5b505af1158015614f0c573d6000803e3d6000fd5b505050506114dd6140d3565b600160ff1b8110614f2557fe5b604080518481526020810184905280820183905290516001600160a01b038087169288821692918a16917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb9181900360600190a4505050505050565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015614fd157600080fd5b505afa158015614fe5573d6000803e3d6000fd5b505050506040513d6020811015614ffb57600080fd5b50519050600061500a84612f89565b9050600061501784612f89565b6001600160a01b038087166000908152600760205260408082206001908101549389168352908220015492935063ffffffff9182169282169161505e90859085906146ae16565b905060006150758663ffffffff808616906146ae16565b604080518481526020810183905281519293506001600160a01b03808c1693908d16927f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c24928290030190a36150cc878a8887614314565b6150d887898786614314565b604080518881526020810188905263ffffffff86168183015290516001600160a01b038b16917f8a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788919081900360600190a2604080518881526020810187905263ffffffff85168183015290516001600160a01b038a16917f8a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788919081900360600190a2505050505050505050565b6000808385141561519c575050600281048061136b565b838510156151af5761472c858585615390565b6000806151bd868887615390565b9890975095505050505050565b60008060015b84518110156152975761523a600760008784815181106151ec57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000015485848151811061522457fe5b60200260200101516146ae90919063ffffffff16565b6152856007600088868151811061524d57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000015486848151811061522457fe5b101561528f578091505b6001016151d0565b50856001600160a01b0316632f55bdb586600760008886815181106152b857fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000154600860009054906101000a900463ffffffff1687868151811061530357fe5b60200260200101516040518563ffffffff1660e01b8152600401808581526020018481526020018363ffffffff16815260200182815260200194505050505060206040518083038186803b15801561535a57600080fd5b505afa15801561536e573d6000803e3d6000fd5b505050506040513d602081101561538457600080fd5b50519695505050505050565b600080600083600019816153a057fe5b049050808611156153d95760008160010187816153b957fe5b0460010190508087816153c857fe5b0496508086816153d457fe5b049550505b60006153f08786026153eb89896142cb565b612913565b9794889003965093945050505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60405180604001604052806000815260200160008152509056fe000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0ea2646970667358221220dc4c1eb48a73c448bec71e9e69e5d49a32f99ae3d43ede630d3172fc61af9d7764736f6c634300060c0033",
"deployedBytecode": "0x6080604052600436106103905760003560e01c806371f52bf3116101dc578063ca1d209d11610102578063d66bd524116100a0578063e8dc12ff1161006f578063e8dc12ff14611081578063ecbca55d146110c7578063f2fde38b146110f7578063fc0c546a1461112a57610421565b8063d66bd52414610fd3578063d895951214611006578063dc8de37914611039578063e2c524681461106c57610421565b8063d260529c116100dc578063d260529c14610f7f578063d3fb73b414610f94578063d4ee1d9014610fa9578063d55ec69714610fbe57610421565b8063ca1d209d14610f23578063cdc91c6914610f40578063d031370b14610f5557610421565b80639b99a8e21161017a578063b4a176d311610149578063b4a176d314610eb4578063bbb7e5d814610ec9578063bf75455814610ef9578063c45d3d9214610f0e57610421565b80639b99a8e214610c77578063a60e772414610c8c578063af94b8d814610d3a578063b127c0a514610d7d57610421565b80637d8916bd116101b65780637d8916bd14610a7557806380d9416d14610b9a5780638da5cb5b14610c4d57806394c275ad14610c6257610421565b806371f52bf314610a3657806379ba509714610a4b5780637b10399914610a6057610421565b806338e9f27a116102c157806354fd4d501161025f57806367b6d57c1161022e57806367b6d57c14610967578063690d83201461099a5780636a49d2c4146109cd5780636aa5332c14610a0c57610421565b806354fd4d50146108e5578063579cd3ca146108fa5780635e35359e1461090f57806361cd756e1461095257610421565b8063415f12401161029b578063415f12401461083a57806349d10b64146108645780634af80f0e146108795780634e40c260146108ac57610421565b806338e9f27a146107b6578063395900d4146107cb5780633e8ff43f1461080e57610421565b80631d4db7911161032e57806321e6b53d1161030857806321e6b53d1461074457806322f3e2d4146107775780632fe8a6ad1461078c57806338a5e016146107a157610421565b80631d4db7911461068e5780631e1401f8146106b55780631f0181bc1461071157610421565b806312c2aca41161036a57806312c2aca4146104e7578063154588371461051057806319b64015146106155780631cfab2901461065b57610421565b8063024c7ec7146104265780630c7d5cd8146104525780630e53aae91461048057610421565b366104215760008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1661041f576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b005b600080fd5b34801561043257600080fd5b5061041f6004803603602081101561044957600080fd5b5035151561113f565b34801561045e57600080fd5b50610467611165565b6040805163ffffffff9092168252519081900360200190f35b34801561048c57600080fd5b506104b3600480360360208110156104a357600080fd5b50356001600160a01b0316611171565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156104f357600080fd5b506104fc611208565b604080519115158252519081900360200190f35b34801561051c57600080fd5b506105c56004803603604081101561053357600080fd5b81359190810190604081016020820135600160201b81111561055457600080fd5b82018360208201111561056657600080fd5b803590602001918460208302840111600160201b8311171561058757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061124f945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106015781810151838201526020016105e9565b505050509050019250505060405180910390f35b34801561062157600080fd5b5061063f6004803603602081101561063857600080fd5b50356112f6565b604080516001600160a01b039092168252519081900360200190f35b34801561066757600080fd5b506104676004803603602081101561067e57600080fd5b50356001600160a01b0316611320565b34801561069a57600080fd5b506106a3611352565b60408051918252519081900360200190f35b3480156106c157600080fd5b506106f8600480360360608110156106d857600080fd5b506001600160a01b03813581169160208101359091169060400135611358565b6040805192835260208301919091528051918290030190f35b34801561071d57600080fd5b506106f86004803603602081101561073457600080fd5b50356001600160a01b0316611373565b34801561075057600080fd5b5061041f6004803603602081101561076757600080fd5b50356001600160a01b031661142a565b34801561078357600080fd5b506104fc61143e565b34801561079857600080fd5b506104fc6114bd565b3480156107ad57600080fd5b5061041f6114cd565b3480156107c257600080fd5b506104fc6114df565b3480156107d757600080fd5b5061041f600480360360608110156107ee57600080fd5b506001600160a01b038135811691602081013590911690604001356114e8565b34801561081a57600080fd5b5061082361156e565b6040805161ffff9092168252519081900360200190f35b34801561084657600080fd5b506105c56004803603602081101561085d57600080fd5b5035611573565b34801561087057600080fd5b5061041f6117b1565b34801561088557600080fd5b5061041f6004803603602081101561089c57600080fd5b50356001600160a01b03166119b9565b3480156108b857600080fd5b506106a3600480360360408110156108cf57600080fd5b506001600160a01b0381351690602001356119ee565b3480156108f157600080fd5b50610823611b2a565b34801561090657600080fd5b50610467611b2f565b34801561091b57600080fd5b5061041f6004803603606081101561093257600080fd5b506001600160a01b03813581169160208101359091169060400135611b42565b34801561095e57600080fd5b5061063f611c73565b34801561097357600080fd5b5061041f6004803603602081101561098a57600080fd5b50356001600160a01b0316611c82565b3480156109a657600080fd5b5061041f600480360360208110156109bd57600080fd5b50356001600160a01b0316611d2e565b3480156109d957600080fd5b5061041f600480360360408110156109f057600080fd5b5080356001600160a01b0316906020013563ffffffff16611e55565b348015610a1857600080fd5b506106a360048036036020811015610a2f57600080fd5b5035611f1e565b348015610a4257600080fd5b50610823611f40565b348015610a5757600080fd5b5061041f611f4f565b348015610a6c57600080fd5b5061063f612006565b6106a360048036036060811015610a8b57600080fd5b810190602081018135600160201b811115610aa557600080fd5b820183602082011115610ab757600080fd5b803590602001918460208302840111600160201b83111715610ad857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b2757600080fd5b820183602082011115610b3957600080fd5b803590602001918460208302840111600160201b83111715610b5a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250612015915050565b348015610ba657600080fd5b506105c560048036036060811015610bbd57600080fd5b810190602081018135600160201b811115610bd757600080fd5b820183602082011115610be957600080fd5b803590602001918460208302840111600160201b83111715610c0a57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602001356122df565b348015610c5957600080fd5b5061063f61258e565b348015610c6e57600080fd5b5061046761259d565b348015610c8357600080fd5b506108236125b0565b348015610c9857600080fd5b506106a360048036036020811015610caf57600080fd5b810190602081018135600160201b811115610cc957600080fd5b820183602082011115610cdb57600080fd5b803590602001918460208302840111600160201b83111715610cfc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506125b6945050505050565b348015610d4657600080fd5b506106f860048036036060811015610d5d57600080fd5b506001600160a01b03813581169160208101359091169060400135612608565b348015610d8957600080fd5b506105c560048036036060811015610da057600080fd5b81359190810190604081016020820135600160201b811115610dc157600080fd5b820183602082011115610dd357600080fd5b803590602001918460208302840111600160201b83111715610df457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610e4357600080fd5b820183602082011115610e5557600080fd5b803590602001918460208302840111600160201b83111715610e7657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506127ab945050505050565b348015610ec057600080fd5b5061041f6128e7565b348015610ed557600080fd5b506106a360048036036040811015610eec57600080fd5b5080359060200135612913565b348015610f0557600080fd5b506104fc61292b565b348015610f1a57600080fd5b5061063f612930565b6106a360048036036020811015610f3957600080fd5b503561293f565b348015610f4c57600080fd5b5061041f612dba565b348015610f6157600080fd5b5061063f60048036036020811015610f7857600080fd5b5035612e13565b348015610f8b57600080fd5b506104fc61156e565b348015610fa057600080fd5b5061063f612e3a565b348015610fb557600080fd5b5061063f612e49565b348015610fca57600080fd5b5061041f612e58565b348015610fdf57600080fd5b506104b360048036036020811015610ff657600080fd5b50356001600160a01b0316612f40565b34801561101257600080fd5b506106a36004803603602081101561102957600080fd5b50356001600160a01b0316612f82565b34801561104557600080fd5b506106a36004803603602081101561105c57600080fd5b50356001600160a01b0316612f89565b34801561107857600080fd5b506106f8612fb2565b6106a3600480360360a081101561109757600080fd5b506001600160a01b0381358116916020810135821691604082013591606081013582169160809091013516612fbb565b3480156110d357600080fd5b5061041f600480360360208110156110ea57600080fd5b503563ffffffff166131cb565b34801561110357600080fd5b5061041f6004803603602081101561111a57600080fd5b50356001600160a01b03166132b2565b34801561113657600080fd5b5061063f613330565b61114761333f565b60038054911515600160a01b0260ff60a01b19909216919091179055565b60085463ffffffff1681565b6000806000806000611181615400565b505050506001600160a01b03929092166000908152600760209081526040808320815160a081018352815480825260019092015463ffffffff811694820185905260ff600160201b82048116151594830194909452650100000000008104841615156060830152600160301b90049092161515608090920182905295919450919250829190565b60008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff165b90565b60048054604080516318160ddd60e01b815290516060936000936001600160a01b0316926318160ddd9281830192602092829003018186803b15801561129457600080fd5b505afa1580156112a8573d6000803e3d6000fd5b505050506040513d60208110156112be57600080fd5b5051905060006112dd6c42616e636f72466f726d756c6160981b613392565b90506112eb85858484613410565b925050505b92915050565b60006006828154811061130557fe5b6000918252602090912001546001600160a01b031692915050565b60008161132c81613555565b50506001600160a01b031660009081526007602052604090206001015463ffffffff1690565b600c5481565b600080611366858585612608565b915091505b935093915050565b600954600090819060ff166113c7576040805162461bcd60e51b815260206004820152601560248201527411549497d393d397d4d510539110549117d413d3d3605a1b604482015290519081900360640190fd5b6113cf61542e565b6113d76135c2565b905060066000815481106113e757fe5b6000918252602090912001546001600160a01b03858116911614156114185780516020909101519092509050611425565b6020810151905190925090505b915091565b61143261333f565b61143b81611c82565b50565b6004805460408051638da5cb5b60e01b8152905160009330936001600160a01b031692638da5cb5b9281830192602092829003018186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d60208110156114ac57600080fd5b50516001600160a01b031614905090565b600354600160a01b900460ff1681565b6114d561333f565b6114dd612dba565b565b60095460ff1681565b6114f061333f565b6004805460408051632f1a9acf60e11b81526001600160a01b038781169482019490945285841660248201526044810185905290519290911691635e35359e9160648082019260009290919082900301818387803b15801561155157600080fd5b505af1158015611565573d6000803e3d6000fd5b50505050505050565b600190565b606061157d61375d565b6003805460ff60a81b1916600160a81b179055816115d4576040805162461bcd60e51b815260206004820152600f60248201526e11549497d6915493d7d05353d55395608a1b604482015290519081900360640190fd5b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561162457600080fd5b505afa158015611638573d6000803e3d6000fd5b505050506040513d602081101561164e57600080fd5b5051600480546040805163a24835d160e01b8152339381019390935260248301879052519293506001600160a01b03169163a24835d19160448082019260009290919082900301818387803b1580156116a657600080fd5b505af11580156116ba573d6000803e3d6000fd5b505060065460609250905067ffffffffffffffff811180156116db57600080fd5b50604051908082528060200260200182016040528015611705578160200160208202803683370190505b50905060005b815181101561173557600182828151811061172257fe5b602090810291909101015260010161170b565b5061179c600680548060200260200160405190810160405280929190818152602001828054801561178f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611771575b50505050508284876137ad565b6003805460ff60a81b19169055949350505050565b6000546001600160a01b03163314806117d45750600354600160a01b900460ff16155b611819576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b60006118376f436f6e7472616374526567697374727960801b613392565b6002549091506001600160a01b0380831691161480159061186057506001600160a01b03811615155b6118a8576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60006001600160a01b0316816001600160a01b031663bb34534c6f436f6e7472616374526567697374727960801b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561190a57600080fd5b505afa15801561191e573d6000803e3d6000fd5b505050506040513d602081101561193457600080fd5b50516001600160a01b03161415611989576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60028054600380546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b6119c161333f565b806119cb816139b8565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60048054604080516318160ddd60e01b8152905160009384936001600160a01b0316926318160ddd9281830192602092829003018186803b158015611a3257600080fd5b505afa158015611a46573d6000803e3d6000fd5b505050506040513d6020811015611a5c57600080fd5b505190506000611a7b6c42616e636f72466f726d756c6160981b613392565b6001600160a01b03868116600090815260076020908152604091829020546008548351632f55bdb560e01b815260048101899052602481019290925263ffffffff16604482015260648101899052915193945091841692632f55bdb592608480840193919291829003018186803b158015611af557600080fd5b505afa158015611b09573d6000803e3d6000fd5b505050506040513d6020811015611b1f57600080fd5b505195945050505050565b602781565b600854600160401b900463ffffffff1681565b611b4a61375d565b6003805460ff60a81b1916600160a81b179055611b6561333f565b6000611b8a762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b6001600160a01b038516600090815260076020526040902060010154909150600160301b900460ff161580611bc45750611bc261143e565b155b80611bdc57506000546001600160a01b038281169116145b611c21576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611c2c848484613a0c565b6001600160a01b038416600090815260076020526040902060010154600160301b900460ff1615611c6057611c6084613a3d565b50506003805460ff60a81b191690555050565b6003546001600160a01b031681565b611c8a61333f565b762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611cae81613b16565b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611d1257600080fd5b505af1158015611d26573d6000803e3d6000fd5b505050505050565b611d3661375d565b6003805460ff60a81b1916600160a81b179055611d5161333f565b600080516020615449833981519152611d6981613555565b6000611d8e762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b9050611d9861143e565b1580611db157506000546001600160a01b038281169116145b611df6576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6040516001600160a01b038416904780156108fc02916000818181858888f19350505050158015611e2b573d6000803e3d6000fd5b50611e43600080516020615449833981519152613a3d565b50506003805460ff60a81b1916905550565b611e5d61333f565b611e678282613b78565b6006546002148015611ebb5750600760006006600081548110611e8657fe5b6000918252602080832091909101546001600160a01b0316835282019290925260400190206001015463ffffffff166207a120145b8015611f095750600760006006600181548110611ed457fe5b6000918252602080832091909101546001600160a01b0316835282019290925260400190206001015463ffffffff166207a120145b6009805460ff19169115159190911790555050565b600080825b8015611f395760019190910190600a9004611f23565b5092915050565b6000611f4a6125b0565b905090565b6001546001600160a01b03163314611fa2576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6002546001600160a01b031681565b600061201f61375d565b6003805460ff60a81b1916600160a81b17905561203a613d9a565b612045848484613de2565b60005b84518110156120f5576000805160206154498339815191526001600160a01b031685828151811061207557fe5b60200260200101516001600160a01b031614156120ed573484828151811061209957fe5b6020026020010151146120ed576040805162461bcd60e51b815260206004820152601760248201527608aa4a4be8aa890be829a9eaa9ca8be9a92a69a82a8869604b1b604482015290519081900360640190fd5b600101612048565b5034156121855760008051602061544983398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff16612185576040805162461bcd60e51b81526020600482015260126024820152714552525f4e4f5f4554485f5245534552564560701b604482015290519081900360640190fd5b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d557600080fd5b505afa1580156121e9573d6000803e3d6000fd5b505050506040513d60208110156121ff57600080fd5b505190506000612210868684614077565b90508381101561225c576040805162461bcd60e51b81526020600482015260126024820152714552525f52455455524e5f544f4f5f4c4f5760701b604482015290519081900360640190fd5b600480546040805163219e412d60e21b8152339381019390935260248301849052516001600160a01b039091169163867904b491604480830192600092919082900301818387803b1580156122b057600080fd5b505af11580156122c4573d6000803e3d6000fd5b50506003805460ff60a81b1916905550909695505050505050565b606080845167ffffffffffffffff811180156122fa57600080fd5b50604051908082528060200260200182016040528015612324578160200160208202803683370190505b5090506000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561237757600080fd5b505afa15801561238b573d6000803e3d6000fd5b505050506040513d60208110156123a157600080fd5b5051905060006123c06c42616e636f72466f726d756c6160981b613392565b90506000816001600160a01b0316632f55bdb584600760008c8c815181106123e457fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff166044840152606483018b905251608480840193829003018186803b15801561245e57600080fd5b505afa158015612472573d6000803e3d6000fd5b505050506040513d602081101561248857600080fd5b5051905060005b845181101561257f57826001600160a01b031663ebbb215885600760008d86815181106124b857fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff1660448401526064830187905251608480840193829003018186803b15801561253257600080fd5b505afa158015612546573d6000803e3d6000fd5b505050506040513d602081101561255c57600080fd5b5051855186908390811061256c57fe5b602090810291909101015260010161248f565b509293505050505b9392505050565b6000546001600160a01b031681565b600854600160201b900463ffffffff1681565b60065490565b80516000908190815b818110156125ef576125e38582815181106125d657fe5b6020026020010151611f1e565b909201916001016125bf565b5060016125fc8383612913565b03600a0a949350505050565b600080612613613d9a565b8461261d81613555565b8461262781613555565b856001600160a01b0316876001600160a01b03161415612687576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b60006126a26c42616e636f72466f726d756c6160981b613392565b6001600160a01b03166394491fab6126b98a612f89565b6001600160a01b038b1660009081526007602052604090206001015463ffffffff166126e48b612f89565b6001600160a01b038c166000908152600760209081526040918290206001015482516001600160e01b031960e089901b168152600481019690965263ffffffff94851660248701526044860193909352929091166064840152608483018b90525160a480840193829003018186803b15801561275f57600080fd5b505afa158015612773573d6000803e3d6000fd5b505050506040513d602081101561278957600080fd5b505190506000612798826140a2565b9182900399919850909650505050505050565b60606127b561375d565b6003805460ff60a81b1916600160a81b1790556127d0613d9a565b6127db838386613de2565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561282b57600080fd5b505afa15801561283f573d6000803e3d6000fd5b505050506040513d602081101561285557600080fd5b5051600480546040805163a24835d160e01b8152339381019390935260248301899052519293506001600160a01b03169163a24835d19160448082019260009290919082900301818387803b1580156128ad57600080fd5b505af11580156128c1573d6000803e3d6000fd5b505050506128d1848483886137ad565b6003805460ff60a81b1916905595945050505050565b6128ef61333f565b600354600280546001600160a01b0319166001600160a01b03909216919091179055565b6000816002810484018161292357fe5b049392505050565b600181565b6005546001600160a01b031681565b600061294961375d565b6003805460ff60a81b1916600160a81b1790556129646140d3565b6000805160206154498339815191526000526007602052600080516020615469833981519152546129959034614113565b6000805160206154498339815191526000908152600760209081526000805160206154698339815191529290925560048054604080516318160ddd60e01b8152905193946001600160a01b03909216936318160ddd938281019392829003018186803b158015612a0457600080fd5b505afa158015612a18573d6000803e3d6000fd5b505050506040513d6020811015612a2e57600080fd5b505190506000612a4d6c42616e636f72466f726d756c6160981b613392565b60065490915060005b81811015612d3757600060068281548110612a6d57fe5b60009182526020808320909101546001600160a01b03908116808452600783526040808520546008548251631d77642b60e31b8152600481018d90526024810183905263ffffffff9091166044820152606481018e9052915192965094939289169263ebbb215892608480840193829003018186803b158015612aef57600080fd5b505afa158015612b03573d6000803e3d6000fd5b505050506040513d6020811015612b1957600080fd5b505190506001600160a01b0383166000805160206154498339815191521415612c645780341115612b795760405133903483900380156108fc02916000818181858888f19350505050158015612b73573d6000803e3d6000fd5b50612c5f565b80341015612c5f573415612bcc576040805162461bcd60e51b81526020600482015260156024820152744552525f494e56414c49445f4554485f56414c554560581b604482015290519081900360640190fd5b600854612beb90600160601b90046001600160a01b0316333084614160565b6008600c9054906101000a90046001600160a01b03166001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612c4657600080fd5b505af1158015612c5a573d6000803e3d6000fd5b505050505b612c70565b612c7083333084614160565b6000612c7c83836142cb565b6001600160a01b0385166000908152600760205260408120829055909150612ca4898c6142cb565b604080518581526020810185905280820183905290519192506001600160a01b0387169133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038516600090815260076020526040902060010154612d269082908790859063ffffffff16614314565b505060019093019250612a56915050565b50600480546040805163219e412d60e21b8152339381019390935260248301889052516001600160a01b039091169163867904b491604480830192600092919082900301818387803b158015612d8c57600080fd5b505af1158015612da0573d6000803e3d6000fd5b50506003805460ff60a81b19169055509495945050505050565b612dc261333f565b612dca614383565b6004546001906001600160a01b0316612de161156e565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4565b60068181548110612e2057fe5b6000918252602090912001546001600160a01b0316905081565b6004546001600160a01b031681565b6001546001600160a01b031681565b612e6061333f565b6000612e85762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b613392565b6004549091506000906001600160a01b0316612e9f61156e565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4612ed8816132b2565b6040805163487ac64b60e11b81526027600482015290516001600160a01b038316916390f58c9691602480830192600092919082900301818387803b158015612f2057600080fd5b505af1158015612f34573d6000803e3d6000fd5b5050505061143b611f4f565b6007602052600090815260409020805460019091015463ffffffff81169060ff600160201b8204811691650100000000008104821691600160301b9091041685565b60006112f0825b600081612f9581613555565b50506001600160a01b031660009081526007602052604090205490565b600a54600b5482565b6000612fc561375d565b6003805460ff60a81b1916600160a81b1790556c42616e636f724e6574776f726b60981b612ff281613b16565b856001600160a01b0316876001600160a01b03161415613052576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b6005546001600160a01b0316158061315f575060055460408051633af32abf60e01b81526001600160a01b03878116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156130b257600080fd5b505afa1580156130c6573d6000803e3d6000fd5b505050506040513d60208110156130dc57600080fd5b5051801561315f575060055460408051633af32abf60e01b81526001600160a01b03868116600483015291519190921691633af32abf916024808301926020929190829003018186803b15801561313257600080fd5b505afa158015613146573d6000803e3d6000fd5b505050506040513d602081101561315c57600080fd5b50515b6131a6576040805162461bcd60e51b815260206004820152601360248201527211549497d393d517d5d2125511531254d51151606a1b604482015290519081900360640190fd5b6131b387878787876143e7565b6003805460ff60a81b19169055979650505050505050565b6131d361333f565b60085463ffffffff600160201b9091048116908216111561323b576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6008546040805163ffffffff600160401b90930483168152918316602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a16008805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6132ba61333f565b6000546001600160a01b038281169116141561330e576040805162461bcd60e51b815260206004820152600e60248201526d22a9292fa9a0a6a2afa7aba722a960911b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031690565b6000546001600160a01b031633146114dd576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b60025460408051632ecd14d360e21b81526004810184905290516000926001600160a01b03169163bb34534c916024808301926020929190829003018186803b1580156133de57600080fd5b505afa1580156133f2573d6000803e3d6000fd5b505050506040513d602081101561340857600080fd5b505192915050565b606080845167ffffffffffffffff8111801561342b57600080fd5b50604051908082528060200260200182016040528015613455578160200160208202803683370190505b50905060005b815181101561354b57836001600160a01b0316638074590a86600760008a868151811061348457fe5b6020908102919091018101516001600160a01b031682528181019290925260409081016000205460085482516001600160e01b031960e088901b1681526004810195909552602485019190915263ffffffff166044840152606483018c905251608480840193829003018186803b1580156134fe57600080fd5b505afa158015613512573d6000803e3d6000fd5b505050506040513d602081101561352857600080fd5b5051825183908390811061353857fe5b602090810291909101015260010161345b565b5095945050505050565b6001600160a01b038116600090815260076020526040902060010154600160301b900460ff1661143b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b6135ca61542e565b6000600c546135d76146aa565b039050806135fd57505060408051808201909152600a548152600b54602082015261124c565b600060076000600660018154811061361157fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460068054919350600791839190829061364b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549050610258831061369657604080518082019091529182526020820152915061124c9050565b61369e61542e565b5060408051808201909152600a548152600b54602082018190526000906136c590856146ae565b82519091506000906136d790856146ae565b905060006136fd6136e884896146ae565b6136f7846102588b90036146ae565b906142cb565b9050600061372461025861371e8888602001516146ae90919063ffffffff16565b906146ae565b905061373e82826c0c9f2c9cd04674edea4000000061470c565b6040805180820190915291825260208201529850505050505050505090565b600354600160a81b900460ff16156114dd576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b60606137b76140d3565b60006137d26c42616e636f72466f726d756c6160981b613392565b905060006137e08585614113565b905060606137f085898886613410565b905060005b88518110156139ac57600089828151811061380c57fe5b60200260200101519050600083838151811061382457fe5b6020026020010151905089838151811061383a57fe5b602002602001015181101561388f576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b6001600160a01b0382166000908152600760205260408120546138b29083614113565b6001600160a01b0384166000818152600760205260409020829055909150600080516020615449833981519152141561391857604051339083156108fc029084906000818181858888f19350505050158015613912573d6000803e3d6000fd5b50613923565b61392383338461473e565b604080518381526020810183905280820188905290516001600160a01b0385169133917fbc7d19d505c7ec4db83f3b51f19fb98c4c8a99922e7839d1ee608dfbee29501b9181900360600190a36001600160a01b0383166000908152600760205260409020600101546139a19087908590849063ffffffff16614314565b5050506001016137f5565b50979650505050505050565b6001600160a01b03811630141561143b576040805162461bcd60e51b815260206004820152601360248201527222a9292fa0a2222922a9a9afa4a9afa9a2a62360691b604482015290519081900360640190fd5b613a1461333f565b82613a1e8161489e565b82613a288161489e565b83613a32816139b8565b611d2686868661473e565b80613a4781613555565b6001600160a01b0382166000805160206154498339815191521415613a86576001600160a01b0382166000908152600760205260409020479055613b12565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015613acc57600080fd5b505afa158015613ae0573d6000803e3d6000fd5b505050506040513d6020811015613af657600080fd5b50516001600160a01b0383166000908152600760205260409020555b5050565b613b1f81613392565b6001600160a01b0316336001600160a01b03161461143b576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b613b8061333f565b613b886148ef565b81613b928161489e565b82613b9c816139b8565b82613ba681614936565b6004546001600160a01b03868116911614801590613be757506001600160a01b038516600090815260076020526040902060010154600160301b900460ff16155b613c2e576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60085463ffffffff908116620f42400381169085161115613c96576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b61ffff613ca16125b0565b61ffff1610613cf3576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b5050506001600160a01b0390911660008181526007602052604081208181556001908101805466ff0000000000001963ffffffff80881663ffffffff199384161791909116600160301b179092556006805493840181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910180546001600160a01b031916909317909255600880548084169094019092169216919091179055565b613da261143e565b6114dd576040805162461bcd60e51b815260206004820152600c60248201526b4552525f494e41435449564560a01b604482015290519081900360640190fd5b600654835160009182918114613e35576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b84518114613e7f576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600092505b808310156140305760076000878581518110613e9c57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060010160069054906101000a900460ff16613f1c576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b600091505b80821015613f7e57858281518110613f3557fe5b60200260200101516001600160a01b031660068481548110613f5357fe5b6000918252602090912001546001600160a01b03161415613f7357613f7e565b600190910190613f21565b808210613fc8576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b6000858481518110613fd657fe5b602002602001015111614025576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600190920191613e84565b60008411611d26576040805162461bcd60e51b815260206004820152600f60248201526e11549497d6915493d7d05353d55395608a1b604482015290519081900360640190fd5b60008161408f5761408884846149a6565b9050612587565b61409a848484614ac5565b949350505050565b6008546000906112f090620f4240906140cd908590600160401b900463ffffffff908116906146ae16565b90614df2565b60065460005b81811015613b125761410b600682815481106140f157fe5b6000918252602090912001546001600160a01b0316613a3d565b6001016140d9565b60008183101561415a576040805162461bcd60e51b815260206004820152600d60248201526c4552525f554e444552464c4f5760981b604482015290519081900360640190fd5b50900390565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106141e55780518252601f1990920191602091820191016141c6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114614247576040519150601f19603f3d011682016040523d82523d6000602084013e61424c565b606091505b509150915081801561427a57508051158061427a575080806020019051602081101561427757600080fd5b50515b611d26576040805162461bcd60e51b815260206004820152601860248201527f4552525f5452414e534645525f46524f4d5f4641494c45440000000000000000604482015290519081900360640190fd5b600082820183811015612587576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b6004546001600160a01b0380851691167f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c2461435285620f42406146ae565b6143658863ffffffff808816906146ae16565b6040805192835260208301919091528051918290030190a350505050565b600161438d6125b0565b61ffff16116143df576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b6114dd614e51565b60008060006143f7888888612608565b91509150816000141561444a576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b61445387612f89565b821061445b57fe5b6001600160a01b03881660008051602061544983398151915214156144cd578534146144c8576040805162461bcd60e51b815260206004820152601760248201527608aa4a4be8aa890be829a9eaa9ca8be9a92a69a82a8869604b1b604482015290519081900360640190fd5b6145a4565b3415801561455e57508561455b6144e38a612f89565b604080516370a0823160e01b815230600482015290516001600160a01b038d16916370a08231916024808301926020929190829003018186803b15801561452957600080fd5b505afa15801561453d573d6000803e3d6000fd5b505050506040513d602081101561455357600080fd5b505190614113565b10155b6145a4576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b6145ad88613a3d565b6001600160a01b0387166000908152600760205260409020546145d09083614113565b6001600160a01b038816600081815260076020526040902091909155600080516020615449833981519152141561463d576040516001600160a01b0385169083156108fc029084906000818181858888f19350505050158015614637573d6000803e3d6000fd5b50614648565b61464887858461473e565b60095460ff168015614662575061465d6146aa565b600c54105b156146875761466f6135c2565b8051600a5560200151600b556146836146aa565b600c555b614695888887898686614f18565b61469f8888614f81565b509695505050505050565b4290565b6000826146bd575060006112f0565b828202828482816146ca57fe5b0414612587576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b6000808285118061471c57508284115b156147355761472c858585615185565b9150915061136b565b50929391925050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106147bb5780518252601f19909201916020918201910161479c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461481d576040519150601f19603f3d011682016040523d82523d6000602084013e614822565b606091505b5091509150818015614850575080511580614850575080806020019051602081101561484d57600080fd5b50515b614897576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b5050505050565b6001600160a01b03811661143b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f4144445245535360681b604482015290519081900360640190fd5b6148f761143e565b156114dd576040805162461bcd60e51b815260206004820152600a6024820152694552525f41435449564560b01b604482015290519081900360640190fd5b60008163ffffffff161180156149555750620f424063ffffffff821611155b61143b576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b6000806149b2836125b6565b905060005b8451811015614abd5760008582815181106149ce57fe5b6020026020010151905060008583815181106149e657fe5b602002602001015190506000805160206154498339815191526001600160a01b0316826001600160a01b031614614a2357614a2382333084614160565b6001600160a01b0382166000818152600760209081526040918290208490558151848152908101849052808201879052905133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038216600090815260076020526040902060010154614ab39085908490849063ffffffff16614314565b50506001016149b7565b509392505050565b6000614acf6140d3565b600080516020615449833981519152600052600760205260008051602061546983398151915254614b009034614113565b6000805160206154498339815191526000908152600760205260008051602061546983398151915291909155614b456c42616e636f72466f726d756c6160981b613392565b90506000614b55828588886151ca565b90506000614b6385836142cb565b905060005b8751811015614de6576000888281518110614b7f57fe5b6020908102919091018101516001600160a01b038082166000908152600784526040808220546008548251631d77642b60e31b8152600481018f90526024810183905263ffffffff9091166044820152606481018b90529151949650949193928a169263ebbb215892608480840193919291829003018186803b158015614c0557600080fd5b505afa158015614c19573d6000803e3d6000fd5b505050506040513d6020811015614c2f57600080fd5b5051905080614c7e576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b898481518110614c8a57fe5b6020026020010151811115614c9b57fe5b6001600160a01b03831660008051602061544983398151915214614cca57614cc583333084614160565b614d35565b808a8581518110614cd757fe5b60200260200101511115614d3557336001600160a01b03166108fc828c8781518110614cff57fe5b6020026020010151039081150290604051600060405180830381858888f19350505050158015614d33573d6000803e3d6000fd5b505b6000614d4183836142cb565b6001600160a01b03851660008181526007602090815260409182902084905581518681529081018490528082018a90529051929350909133917f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f7919081900360600190a36001600160a01b038416600090815260076020526040902060010154614dd69087908690849063ffffffff16614314565b505060019092019150614b689050565b50909695505050505050565b6000808211614e3d576040805162461bcd60e51b81526020600482015260126024820152714552525f4449564944455f42595f5a45524f60701b604482015290519081900360640190fd5b6000828481614e4857fe5b04949350505050565b614e5961333f565b6000614e636125b0565b61ffff1611614eb5576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b60048054604080516379ba509760e01b815290516001600160a01b03909216926379ba509792828201926000929082900301818387803b158015614ef857600080fd5b505af1158015614f0c573d6000803e3d6000fd5b505050506114dd6140d3565b600160ff1b8110614f2557fe5b604080518481526020810184905280820183905290516001600160a01b038087169288821692918a16917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb9181900360600190a4505050505050565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015614fd157600080fd5b505afa158015614fe5573d6000803e3d6000fd5b505050506040513d6020811015614ffb57600080fd5b50519050600061500a84612f89565b9050600061501784612f89565b6001600160a01b038087166000908152600760205260408082206001908101549389168352908220015492935063ffffffff9182169282169161505e90859085906146ae16565b905060006150758663ffffffff808616906146ae16565b604080518481526020810183905281519293506001600160a01b03808c1693908d16927f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c24928290030190a36150cc878a8887614314565b6150d887898786614314565b604080518881526020810188905263ffffffff86168183015290516001600160a01b038b16917f8a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788919081900360600190a2604080518881526020810187905263ffffffff85168183015290516001600160a01b038a16917f8a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788919081900360600190a2505050505050505050565b6000808385141561519c575050600281048061136b565b838510156151af5761472c858585615390565b6000806151bd868887615390565b9890975095505050505050565b60008060015b84518110156152975761523a600760008784815181106151ec57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000015485848151811061522457fe5b60200260200101516146ae90919063ffffffff16565b6152856007600088868151811061524d57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000015486848151811061522457fe5b101561528f578091505b6001016151d0565b50856001600160a01b0316632f55bdb586600760008886815181106152b857fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060000154600860009054906101000a900463ffffffff1687868151811061530357fe5b60200260200101516040518563ffffffff1660e01b8152600401808581526020018481526020018363ffffffff16815260200182815260200194505050505060206040518083038186803b15801561535a57600080fd5b505afa15801561536e573d6000803e3d6000fd5b505050506040513d602081101561538457600080fd5b50519695505050505050565b600080600083600019816153a057fe5b049050808611156153d95760008160010187816153b957fe5b0460010190508087816153c857fe5b0496508086816153d457fe5b049550505b60006153f08786026153eb89896142cb565b612913565b9794889003965093945050505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60405180604001604052806000815260200160008152509056fe000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0ea2646970667358221220dc4c1eb48a73c448bec71e9e69e5d49a32f99ae3d43ede630d3172fc61af9d7764736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "519:35281:26:-:0;;;349:27:60;;;-1:-1:-1;;;;349:27:60;;;-1:-1:-1;;;2899:30:8;586:89:26;989:34;;;-1:-1:-1;;989:34:26;;;2190:220;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2190:220:26;;;;;;;;;;;619:5:58;:18;;-1:-1:-1;;;;;;619:18:58;627:10;619:18;;;2190:220:26;;;;;;;;;;;594:23:65;2190:220:26;594:13:65;:23::i;:::-;-1:-1:-1;2122:8:57::1;:39:::0;;-1:-1:-1;;;;;2122:39:57;;;::::1;-1:-1:-1::0;;;;;;2122:39:57;;::::1;::::0;::::1;::::0;;;2172:12:::1;:43:::0;;;;::::1;;::::0;;6069:7:8;594:23:65;6069:7:8;594:13:65;:23::i;:::-;6168:17:8;7294:35:::2;6168:17:::0;7294:19:::2;:35::i;:::-;-1:-1:-1::0;;6203:6:8::3;:16:::0;;-1:-1:-1;;;;;;6203:16:8::3;-1:-1:-1::0;;;;;6203:16:8;;;::::3;::::0;;;::::3;::::0;;;-1:-1:-1;6230:16:8::3;:36:::0;;-1:-1:-1;;6230:36:8::3;::::0;::::3;::::0;;::::3;::::0;;;::::3;::::0;;;::::3;::::0;;-1:-1:-1;519:35281:26;;-1:-1:-1;;;;;519:35281:26;692:128:65;-1:-1:-1;;;;;766:22:65;;758:54;;;;;-1:-1:-1;;;758:54:65;;;;;;;;;;;;-1:-1:-1;;;758:54:65;;;;;;;;;;;;;;;692:128;:::o;7404:156:8:-;1846:7;7489:32;;;;;7481:71;;;;;-1:-1:-1;;;7481:71:8;;;;;;;;;;;;;;;;;;;;;;;;;;;519:35281:26;;;;;;;",
"deployedSourceMap": "519:35281:26:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;8454:29:8;:8;:29;;:35;;-1:-1:-1;;;8454:35:8;;;;8446:67;;;;;-1:-1:-1;;;8446:67:8;;;;;;;;;;;;-1:-1:-1;;;8446:67:8;;;;;;;;;;;;;;;519:35281:26;;;;;3655:224:57;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3655:224:57;;;;:::i;2899:30:8:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;22514:248;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22514:248:8;-1:-1:-1;;;;;22514:248:8;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17176:113;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;20265:410:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;20265:410:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;20265:410:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;20265:410:26;;-1:-1:-1;20265:410:26;;-1:-1:-1;;;;;20265:410:26:i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22836:145:8;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22836:145:8;;:::i;:::-;;;;-1:-1:-1;;;;;22836:145:8;;;;;;;;;;;;;;16300:204;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16300:204:8;-1:-1:-1;;;;;16300:204:8;;:::i;1206:40:26:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;23471:208:8;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;23471:208:8;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;7816:436:26;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7816:436:26;-1:-1:-1;;;;;7816:436:26;;:::i;22136:130:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22136:130:8;-1:-1:-1;;;;;22136:130:8;;:::i;10641:121::-;;;;;;;;;;;;;:::i;1333:38:57:-;;;;;;;;;;;;;:::i;22340:100:8:-;;;;;;;;;;;;;:::i;989:34:26:-;;;;;;;;;;;;;:::i;12220:157:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;12220:157:8;;;;;;;;;;;;;;;;;:::i;2555:90:26:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;16888:626;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16888:626:26;;:::i;2300:925:57:-;;;;;;;;;;;;;:::i;10268:202:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10268:202:8;-1:-1:-1;;;;;10268:202:8;;:::i;19492:419:26:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;19492:419:26;;-1:-1:-1;;;;;19492:419:26;;;;;;:::i;2343:35:8:-;;;;;;;;;;;;;:::i;3292:40::-;;;;;;;;;;;;;:::i;13330:735::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;13330:735:8;;;;;;;;;;;;;;;;;:::i;1243:37:57:-;;;;;;;;;;;;;:::i;11112:198:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;11112:198:8;-1:-1:-1;;;;;11112:198:8;;:::i;9086:554::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9086:554:8;-1:-1:-1;;;;;9086:554:8;;:::i;3376:322:26:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3376:322:26;;-1:-1:-1;;;;;3376:322:26;;;;;;;;:::i;30782:180::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30782:180:26;;:::i;23055:114:8:-;;;;;;;;;;;;;:::i;1422:217:58:-;;;;;;;;;;;;;:::i;1154:33:57:-;;;;;;;;;;;;;:::i;10576:1538:26:-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;10576:1538:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;10576:1538:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10576:1538:26;;;;;;;;-1:-1:-1;10576:1538:26;;-1:-1:-1;;;;;10576:1538:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;10576:1538:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10576:1538:26;;-1:-1:-1;;10576:1538:26;;;-1:-1:-1;10576:1538:26;;-1:-1:-1;;10576:1538:26:i;18168:798::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;18168:798:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;18168:798:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18168:798:26;;-1:-1:-1;;18168:798:26;;;-1:-1:-1;;;18168:798:26;;;;:::i;219:29:58:-;;;;;;;;;;;;;:::i;3041:43:8:-;;;;;;;;;;;;;:::i;14882:112::-;;;;;;;;;;;;;:::i;31607:332:26:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;31607:332:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;31607:332:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31607:332:26;;-1:-1:-1;31607:332:26;;-1:-1:-1;;;;;31607:332:26:i;4133:848::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4133:848:26;;;;;;;;;;;;;;;;;:::i;12623:783::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;12623:783:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;12623:783:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12623:783:26;;;;;;;;-1:-1:-1;12623:783:26;;-1:-1:-1;;;;;12623:783:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;12623:783:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12623:783:26;;-1:-1:-1;12623:783:26;;-1:-1:-1;;;;;12623:783:26:i;3304:137:57:-;;;;;;;;;;;;;:::i;31208:116:26:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31208:116:26;;;;;;;:::i;3417:46:8:-;;;;;;;;;;;;;:::i;2473:::-;;;;;;;;;;;;;:::i;13893:2483:26:-;;;;;;;;;;;;;;;;-1:-1:-1;13893:2483:26;;:::i;2918:166::-;;;;;;;;;;;;;:::i;2613:34:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2613:34:8;;:::i;9815:82::-;;;;;;;;;;;;;:::i;2387:39::-;;;;;;;;;;;;;:::i;255:23:58:-;;;;;;;;;;;;;:::i;14288:374:8:-;;;;;;;;;;;;;:::i;2754:48::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2754:48:8;-1:-1:-1;;;;;2754:48:8;;:::i;23243:154::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;23243:154:8;-1:-1:-1;;;;;23243:154:8;;:::i;16773:225::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16773:225:8;-1:-1:-1;;;;;16773:225:8;;:::i;1068:31:26:-;;;;;;;;;;;;;:::i;17872:782:8:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;17872:782:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;12580:274::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12580:274:8;;;;:::i;1164:167:58:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1164:167:58;-1:-1:-1;;;;;1164:167:58;;:::i;21965:97:8:-;;;;;;;;;;;;;:::i;3655:224:57:-;726:12:58;:10;:12::i;:::-;3815:26:57::1;:56:::0;;;::::1;;-1:-1:-1::0;;;3815:56:57::1;-1:-1:-1::0;;;;3815:56:57;;::::1;::::0;;;::::1;::::0;;3655:224::o;2899:30:8:-;;;;;;:::o;22514:248::-;22586:7;22595:6;22603:4;22609;22615;22632:22;;:::i;:::-;-1:-1:-1;;;;;;;;;22657:18:8;;;;;;;;:8;:18;;;;;;;;22632:43;;-1:-1:-1;22632:43:8;;;;;;;;;-1:-1:-1;22632:43:8;;;;;;;;;;;;;;-1:-1:-1;;;22632:43:8;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;22632:43:8;;;;;;;;;;;;;;;;;-1:-1:-1;22657:18:8;;-1:-1:-1;22657:18:8;;22632:43;22514:248::o;17176:113::-;-1:-1:-1;;;;;;;;;;;;17246:29:8;:8;:29;;:35;;-1:-1:-1;;;17246:35:8;;;;17176:113;;:::o;20265:410:26:-;20474:6;;;20454:42;;;-1:-1:-1;;;20454:42:26;;;;20398:16;;20432:19;;-1:-1:-1;;;;;20474:6:26;;-1:-1:-1;;20454:42:26;;;;;;;;;;;20474:6;20454:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;20454:42:26;;-1:-1:-1;20507:22:26;20547:25;-1:-1:-1;;;20547:9:26;:25::i;:::-;20507:66;;20591:76;20621:7;20630:14;20646:11;20659:7;20591:29;:76::i;:::-;20584:83;;;;20265:410;;;;;:::o;22836:145:8:-;22907:11;22938:27;22966:6;22938:35;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;22938:35:8;;;-1:-1:-1;;22836:145:8:o;16300:204::-;16435:6;16402:13;6959:23;6973:8;6959:13;:23::i;:::-;-1:-1:-1;;;;;;;16466:23:8::1;;::::0;;;:8:::1;:23;::::0;;;;-1:-1:-1;16466:30:8::1;::::0;::::1;;::::0;16300:204::o;1206:40:26:-;;;;:::o;23471:208:8:-;23580:7;23589;23616:55;23635:12;23649;23663:7;23616:18;:55::i;:::-;23609:62;;;;23471:208;;;;;;;:::o;7816:436:26:-;7968:14;;7886:7;;;;7968:14;;7960:48;;;;;-1:-1:-1;;;7960:48:26;;;;;;;;;;;;-1:-1:-1;;;7960:48:26;;;;;;;;;;;;;;;8074:20;;:::i;:::-;8097:19;:17;:19::i;:::-;8074:42;;8141:13;8155:1;8141:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8131:26:26;;;8141:16;;8131:26;8127:82;;;8182:6;;8190;;;;;8182;;-1:-1:-1;8190:6:26;-1:-1:-1;8174:23:26;;8127:82;8229:6;;;;8237;;8229;;-1:-1:-1;8237:6:26;-1:-1:-1;7816:436:26;;;;:::o;22136:130:8:-;726:12:58;:10;:12::i;:::-;22224:34:8::1;22248:9;22224:23;:34::i;:::-;22136:130:::0;:::o;10641:121::-;10723:6;;;:14;;;-1:-1:-1;;;10723:14:8;;;;10699:4;;10749;;-1:-1:-1;;;;;10723:6:8;;-1:-1:-1;;10723:14:8;;;;;;;;;;;:6;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10723:14:8;-1:-1:-1;;;;;10723:31:8;;;10641:121;-1:-1:-1;10641:121:8:o;1333:38:57:-;;;-1:-1:-1;;;1333:38:57;;;;;:::o;22340:100:8:-;726:12:58;:10;:12::i;:::-;22409:23:8::1;:21;:23::i;:::-;22340:100::o:0;989:34:26:-;;;;;;:::o;12220:157:8:-;726:12:58;:10;:12::i;:::-;12326:6:8::1;::::0;;:43:::1;::::0;;-1:-1:-1;;;12326:43:8;;-1:-1:-1;;;;;12326:43:8;;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;;;;;;;;;;;:6;;;::::1;::::0;:21:::1;::::0;:43;;;;;-1:-1:-1;;12326:43:8;;;;;;;;-1:-1:-1;12326:6:8;:43;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;12220:157:::0;;;:::o;2555:90:26:-;2636:1;2555:90;:::o;16888:626::-;16977:16;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;17019:11:26;17011:39:::1;;;::::0;;-1:-1:-1;;;17011:39:26;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;17011:39:26;;;;;;;;;;;;;::::1;;17105:6;::::0;;17085:42:::1;::::0;;-1:-1:-1;;;17085:42:26;;;;17063:19:::1;::::0;-1:-1:-1;;;;;17105:6:26;;::::1;::::0;17085:40:::1;::::0;:42;;::::1;::::0;::::1;::::0;;;;;;;;17105:6;17085:42;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;17085:42:26;17158:6:::1;::::0;;17138:57:::1;::::0;;-1:-1:-1;;;17138:57:26;;17175:10:::1;17138:57:::0;;::::1;::::0;;;;;;;;;;;17085:42;;-1:-1:-1;;;;;;17158:6:26::1;::::0;-1:-1:-1;;17138:57:26;;;;;-1:-1:-1;;17138:57:26;;;;;;;;-1:-1:-1;17158:6:26;17138:57;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;17265:13:26::1;:20:::0;17208:40:::1;::::0;-1:-1:-1;17265:20:26;-1:-1:-1;17251:35:26::1;::::0;::::1;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;-1:-1:-1;17251:35:26::1;;17208:78;;17302:9;17297:104;17321:23;:30;17317:1;:34;17297:104;;;17400:1;17371:23;17395:1;17371:26;;;;;;;;;::::0;;::::1;::::0;;;;;:30;17353:3:::1;;17297:104;;;;17421:85;17445:13;17421:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;;-1:-1:-1;;;;;17421:85:26::1;::::0;;-1:-1:-1;17421:85:26;;::::1;::::0;::::1;;::::0;;::::1;;;;;;;;;17460:23;17485:11;17498:7;17421:23;:85::i;:::-;639:6:60::0;:14;;-1:-1:-1;;;;639:14:60;;;17414:92:26;;-1:-1:-1;;;;16888:626:26:o;2300:925:57:-;2417:5;;-1:-1:-1;;;;;2417:5:57;2403:10;:19;;:50;;-1:-1:-1;2427:26:57;;-1:-1:-1;;;2427:26:57;;;;2426:27;2403:50;2395:80;;;;;-1:-1:-1;;;2395:80:57;;;;;;;;;;;;-1:-1:-1;;;2395:80:57;;;;;;;;;;;;;;;2530:29;2580:28;-1:-1:-1;;;2580:9:57;:28::i;:::-;2721:8;;2530:79;;-1:-1:-1;;;;;;2706:23:57;;;2721:8;;2706:23;;;;:61;;-1:-1:-1;;;;;;2733:34:57;;;;2706:61;2698:94;;;;;-1:-1:-1;;;2698:94:57;;;;;;;;;;;;-1:-1:-1;;;2698:94:57;;;;;;;;;;;;;;;2907:40;;;-1:-1:-1;;;2907:40:57;;-1:-1:-1;;;2907:40:57;;;;;;2959:1;;-1:-1:-1;;;;;2907:21:57;;;;;:40;;;;;;;;;;;;;;;:21;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2907:40:57;-1:-1:-1;;;;;2907:54:57;;;2899:87;;;;;-1:-1:-1;;;2899:87:57;;;;;;;;;;;;-1:-1:-1;;;2899:87:57;;;;;;;;;;;;;;;3093:8;;;3078:12;:23;;-1:-1:-1;;;;;3093:8:57;;;-1:-1:-1;;;;;;3078:23:57;;;;;;;3195:22;;;;;;;;;;;2300:925::o;10268:202:8:-;726:12:58;:10;:12::i;:::-;10401:10:8::1;948:18:65;957:8;948;:18::i;:::-;-1:-1:-1::0;10430:19:8::2;:32:::0;;-1:-1:-1;;;;;;10430:32:8::2;-1:-1:-1::0;;;;;10430:32:8;;;::::2;::::0;;;::::2;::::0;;10268:202::o;19492:419:26:-;19686:6;;;19666:42;;;-1:-1:-1;;;19666:42:26;;;;19619:7;;;;-1:-1:-1;;;;;19686:6:26;;-1:-1:-1;;19666:42:26;;;;;;;;;;;19686:6;19666:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;19666:42:26;;-1:-1:-1;19719:22:26;19759:25;-1:-1:-1;;;19759:9:26;:25::i;:::-;-1:-1:-1;;;;;19841:23:26;;;;;;;:8;:23;;;;;;;;;:31;19874:12;;19803:100;;-1:-1:-1;;;19803:100:26;;;;;;;;;;;;;;;19874:12;;19803:100;;;;;;;;;;;;19719:66;;-1:-1:-1;19803:24:26;;;;-1:-1:-1;;19803:100:26;;;;;19841:23;;19803:100;;;;;;:24;:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;19803:100:26;;19492:419;-1:-1:-1;;;;;19492:419:26:o;2343:35:8:-;2376:2;2343:35;:::o;3292:40::-;;;-1:-1:-1;;;3292:40:8;;;;;:::o;13330:735::-;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;726:12:58::1;:10;:12::i;:::-;13517:25:8::2;13545:29;-1:-1:-1::0;;;13545:9:8::2;:29::i;:::-;-1:-1:-1::0;;;;;13765:16:8;::::2;;::::0;;;:8:::2;:16;::::0;;;;-1:-1:-1;13765:22:8::2;::::0;13517:57;;-1:-1:-1;;;;13765:22:8;::::2;;;13764:23;::::0;:38:::2;;;13792:10;:8;:10::i;:::-;13791:11;13764:38;:68;;;-1:-1:-1::0;13806:5:8::2;::::0;-1:-1:-1;;;;;13806:26:8;;::::2;:5:::0;::::2;:26;13764:68;13756:98;;;::::0;;-1:-1:-1;;;13756:98:8;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;13756:98:8;;;;;;;;;;;;;::::2;;13865:42;13886:6;13894:3;13899:7;13865:20;:42::i;:::-;-1:-1:-1::0;;;;;13994:16:8;::::2;;::::0;;;:8:::2;:16;::::0;;;;-1:-1:-1;13994:22:8::2;::::0;-1:-1:-1;;;13994:22:8;::::2;;;13990:67;;;14031:26;14050:6;14031:18;:26::i;:::-;-1:-1:-1::0;;639:6:60;:14;;-1:-1:-1;;;;639:14:60;;;-1:-1:-1;;13330:735:8:o;1243:37:57:-;;;-1:-1:-1;;;;;1243:37:57;;:::o;11112:198:8:-;726:12:58;:10;:12::i;:::-;-1:-1:-1;;;1627:20:57::1;-1:-1:-1::0;1627:5:57::1;:20::i;:::-;11267:6:8::2;::::0;;:35:::2;::::0;;-1:-1:-1;;;11267:35:8;;-1:-1:-1;;;;;11267:35:8;;::::2;::::0;;::::2;::::0;;;;;;:6;;;::::2;::::0;:24:::2;::::0;:35;;;;;:6:::2;::::0;:35;;;;;;;;:6;;:35;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;749:1:58::1;11112:198:8::0;:::o;9086:554::-;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;726:12:58::1;:10;:12::i;:::-;-1:-1:-1::0;;;;;;;;;;;6959:23:8::2;6973:8;6959:13;:23::i;:::-;9259:25:::3;9287:29;-1:-1:-1::0;;;9287:9:8::3;:29::i;:::-;9259:57;;9431:10;:8;:10::i;:::-;9430:11;:41;;;-1:-1:-1::0;9445:5:8::3;::::0;-1:-1:-1;;;;;9445:26:8;;::::3;:5:::0;::::3;:26;9430:41;9422:71;;;::::0;;-1:-1:-1;;;9422:71:8;;::::3;;::::0;::::3;::::0;::::3;::::0;;;;-1:-1:-1;;;9422:71:8;;;;;;;;;;;;;::::3;;9504:35;::::0;-1:-1:-1;;;;;9504:12:8;::::3;::::0;9517:21:::3;9504:35:::0;::::3;;;::::0;::::3;::::0;;;9517:21;9504:12;:35;::::3;;;;;;;;;;;;;::::0;::::3;;;;;;9593:39;-1:-1:-1::0;;;;;;;;;;;9593:18:8::3;:39::i;:::-;-1:-1:-1::0;;639:6:60;:14;;-1:-1:-1;;;;639:14:60;;;-1:-1:-1;9086:554:8:o;3376:322:26:-;726:12:58;:10;:12::i;:::-;3469:33:26::1;3486:6;3494:7;3469:16;:33::i;:::-;3545:13;:20:::0;3569:1:::1;3545:25;:85:::0;::::1;;;;3587:8;:26;3596:13;3610:1;3596:16;;;;;;;;;::::0;;;::::1;::::0;;;;;;::::1;::::0;-1:-1:-1;;;;;3596:16:26::1;3587:26:::0;;;::::1;::::0;;;;;;;;-1:-1:-1;3587:33:26::1;::::0;::::1;;3624:6;3587:43;3545:85;:145;;;;;3647:8;:26;3656:13;3670:1;3656:16;;;;;;;;;::::0;;;::::1;::::0;;;;;;::::1;::::0;-1:-1:-1;;;;;3656:16:26::1;3647:26:::0;;;::::1;::::0;;;;;;;;-1:-1:-1;3647:33:26::1;::::0;::::1;;3684:6;3647:43;3545:145;3515:14;:175:::0;;-1:-1:-1;;3515:175:26::1;::::0;::::1;;::::0;;;::::1;::::0;;-1:-1:-1;;3376:322:26:o;30782:180::-;30838:7;;30899:2;30882:53;30903:5;;30882:53;;30932:3;;;;;;30915:2;30910:7;;30882:53;;;-1:-1:-1;30953:1:26;30782:180;-1:-1:-1;;30782:180:26:o;23055:114:8:-;23116:6;23142:19;:17;:19::i;:::-;23135:26;;23055:114;:::o;1422:217:58:-;1498:8;;-1:-1:-1;;;;;1498:8:58;1484:10;:22;1476:52;;;;;-1:-1:-1;;;1476:52:58;;;;;;;;;;;;-1:-1:-1;;;1476:52:58;;;;;;;;;;;;;;;1563:8;;;1556:5;;1544:28;;-1:-1:-1;;;;;1563:8:58;;;;1556:5;;;;1544:28;;;1591:8;;;;1583:16;;-1:-1:-1;;;;;1591:8:58;;-1:-1:-1;;;;;;1583:16:58;;;;;;;1610:21;;;1422:217::o;1154:33:57:-;;;-1:-1:-1;;;;;1154:33:57;;:::o;10576:1538:26:-;10775:7;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;6356:9:8::1;:7;:9::i;:::-;10834:65:26::2;10855:14;10871:15;10888:10;10834:20;:65::i;:::-;11036:9;11031:195;11055:14;:21;11051:1;:25;11031:195;;;-1:-1:-1::0;;;;;;;;;;;;;;;;11100:40:26::2;:14;11115:1;11100:17;;;;;;;;;;;;;;-1:-1:-1::0;;;;;11100:40:26::2;;11096:130;;;11189:9;11167:15;11183:1;11167:18;;;;;;;;;;;;;;:31;11159:67;;;::::0;;-1:-1:-1;;;11159:67:26;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;11159:67:26;;;;;;;;;;;;;::::2;;11078:3;;11031:195;;;-1:-1:-1::0;11346:9:26::2;:13:::0;11342:112:::2;;-1:-1:-1::0;;;;;;;;;;;;11384:29:26;:8:::2;:29;::::0;:35;;-1:-1:-1;;;11384:35:26;::::2;;;11376:66;;;::::0;;-1:-1:-1;;;11376:66:26;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;11376:66:26;;;;;;;;;;;;;::::2;;11541:6;::::0;;11521:42:::2;::::0;;-1:-1:-1;;;11521:42:26;;;;11499:19:::2;::::0;-1:-1:-1;;;;;11541:6:26;;::::2;::::0;11521:40:::2;::::0;:42;;::::2;::::0;::::2;::::0;;;;;;;;11541:6;11521:42;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;11521:42:26;;-1:-1:-1;11669:14:26::2;11686:64;11705:14:::0;11721:15;11521:42;11686:18:::2;:64::i;:::-;11669:81;;11887:10;11877:6;:20;;11869:51;;;::::0;;-1:-1:-1;;;11869:51:26;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;11869:51:26;;;;;;;;;;;;;::::2;;11994:6;::::0;;11974:54:::2;::::0;;-1:-1:-1;;;11974:54:26;;12009:10:::2;11974:54:::0;;::::2;::::0;;;;;;;;;;;-1:-1:-1;;;;;11994:6:26;;::::2;::::0;11974:34:::2;::::0;:54;;;;;-1:-1:-1;;11974:54:26;;;;;;;-1:-1:-1;11994:6:26;11974:54;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;639:6:60;:14;;-1:-1:-1;;;;639:14:60;;;-1:-1:-1;12100:6:26;;;-1:-1:-1;;;;;;10576:1538:26:o;18168:798::-;18331:16;18365:31;18413:14;:21;18399:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18399:36:26;-1:-1:-1;18490:6:26;;;18470:42;;;-1:-1:-1;;;18470:42:26;;;;18365:70;;-1:-1:-1;18448:19:26;;-1:-1:-1;;;;;18490:6:26;;;;18470:40;;:42;;;;;;;;;;;;18490:6;18470:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18470:42:26;;-1:-1:-1;18523:22:26;18563:25;-1:-1:-1;;;18563:9:26;:25::i;:::-;18523:66;;18600:14;18617:7;-1:-1:-1;;;;;18617:24:26;;18642:11;18655:8;:44;18664:14;18679:18;18664:34;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;18655:44:26;;;;;;;;;;;;;;-1:-1:-1;18655:44:26;:52;18709:12;;18617:121;;-1:-1:-1;18617:121:26;;;-1:-1:-1;;;;;;18617:121:26;;;;;;;;;;;;;;;;;18709:12;;18617:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18617:121:26;;-1:-1:-1;18756:9:26;18751:173;18775:14;:21;18771:1;:25;18751:173;;;18836:7;-1:-1:-1;;;;;18836:16:26;;18853:11;18866:8;:27;18875:14;18890:1;18875:17;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;18866:27:26;;;;;;;;;;;;;;-1:-1:-1;18866:27:26;:35;18903:12;;18836:88;;-1:-1:-1;18836:88:26;;;-1:-1:-1;;;;;;18836:88:26;;;;;;;;;;;;;;;;;18903:12;;18836:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18836:88:26;18816:17;;:14;;18831:1;;18816:17;;;;;;;;;;;;;;;:108;18798:3;;18751:173;;;-1:-1:-1;18944:14:26;;-1:-1:-1;;;;18168:798:26;;;;;;:::o;219:29:58:-;;;-1:-1:-1;;;;;219:29:58;;:::o;3041:43:8:-;;;-1:-1:-1;;;3041:43:8;;;;;:::o;14882:112::-;14965:13;:20;14882:112;:::o;31607:332:26:-;31748:14;;31677:7;;;;;31773:90;31797:6;31793:1;:10;31773:90;;;31838:25;31852:7;31860:1;31852:10;;;;;;;;;;;;;;31838:13;:25::i;:::-;31823:40;;;;31805:3;;31773:90;;;;31929:1;31897:29;31906:11;31919:6;31897:8;:29::i;:::-;:33;31889:2;31881:50;;31607:332;-1:-1:-1;;;;31607:332:26:o;4133:848::-;4384:7;4393;6356:9:8;:7;:9::i;:::-;4316:12:26::1;6959:23:8;6973:8;6959:13;:23::i;:::-;4352:12:26::2;6959:23:8;6973:8;6959:13;:23::i;:::-;-1:-1:-1::0;;;;;4453:28:26;;::::3;::::0;;::::3;;;4445:63;;;::::0;;-1:-1:-1;;;4445:63:26;;::::3;;::::0;::::3;::::0;::::3;::::0;;;;-1:-1:-1;;;4445:63:26;;;;;;;;;;;;;::::3;;4521:14;4553:25;-1:-1:-1::0;;;4553:9:26::3;:25::i;:::-;-1:-1:-1::0;;;;;4538:66:26::3;;4619:28;4634:12:::0;4619:14:::3;:28::i;:::-;-1:-1:-1::0;;;;;4662:22:26;::::3;;::::0;;;:8:::3;:22;::::0;;;;-1:-1:-1;4662:29:26::3;::::0;::::3;;4706:28;4721:12:::0;4706:14:::3;:28::i;:::-;-1:-1:-1::0;;;;;4749:22:26;::::3;;::::0;;;:8:::3;:22;::::0;;;;;;;;-1:-1:-1;4749:29:26::3;::::0;4538:273;;-1:-1:-1;4538:273:26;;;-1:-1:-1;;;;;;4538:273:26;;;::::3;::::0;::::3;::::0;;;;4749:29:::3;4538:273:::0;;::::3;::::0;;;;;;;;;;;4749:29;;;::::3;4538:273:::0;;;;;;;;;;;;;;;;;;;;;;;::::3;;::::0;::::3;;;;::::0;::::3;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;::::0;::::3;;-1:-1:-1::0;4538:273:26;;-1:-1:-1;4902:11:26::3;4916:20;4538:273:::0;4916:12:::3;:20::i;:::-;4955:12:::0;;;::::3;::::0;;;-1:-1:-1;4133:848:26;;-1:-1:-1;;;;;;;4133:848:26:o;12623:783::-;12814:16;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;6356:9:8::1;:7;:9::i;:::-;12882:71:26::2;12903:14;12919:24;12945:7;12882:20;:71::i;:::-;13075:6;::::0;;13055:42:::2;::::0;;-1:-1:-1;;;13055:42:26;;;;13033:19:::2;::::0;-1:-1:-1;;;;;13075:6:26;;::::2;::::0;13055:40:::2;::::0;:42;;::::2;::::0;::::2;::::0;;;;;;;;13075:6;13055:42;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;13055:42:26;13166:6:::2;::::0;;13146:57:::2;::::0;;-1:-1:-1;;;13146:57:26;;13183:10:::2;13146:57:::0;;::::2;::::0;;;;;;;;;;;13055:42;;-1:-1:-1;;;;;;13166:6:26::2;::::0;-1:-1:-1;;13146:57:26;;;;;-1:-1:-1;;13146:57:26;;;;;;;;-1:-1:-1;13166:6:26;13146:57;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;13311:87;13335:14;13351:24;13377:11;13390:7;13311:23;:87::i;:::-;639:6:60::0;:14;;-1:-1:-1;;;;639:14:60;;;13304:94:26;;-1:-1:-1;;;;;12623:783:26:o;3304:137:57:-;726:12:58;:10;:12::i;:::-;3421::57::1;::::0;3410:8:::1;:23:::0;;-1:-1:-1;;;;;;3410:23:57::1;-1:-1:-1::0;;;;;3421:12:57;;::::1;3410:23:::0;;;::::1;::::0;;3304:137::o;31208:116:26:-;31271:7;31314:2;31309:1;31314:2;31304:6;31299:2;:11;31298:18;;;;;;;31208:116;-1:-1:-1;;;31208:116:26:o;3417:46:8:-;3459:4;3417:46;:::o;2473:::-;;;-1:-1:-1;;;;;2473:46:8;;:::o;13893:2483:26:-;13994:7;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;14019:21:26::1;:19;:21::i;:::-;-1:-1:-1::0;;;;;;;;;;;14091:29:26::1;::::0;:8:::1;:29;::::0;-1:-1:-1;;;;;;;;;;;14091:37:26;:52:::1;::::0;14133:9:::1;14091:41;:52::i;:::-;-1:-1:-1::0;;;;;;;;;;;14051:29:26::1;::::0;;;:8:::1;:29;::::0;;;-1:-1:-1;;;;;;;;;;;14051:92:26;;;;14193:6:::1;::::0;;14051:29;14173:42;;-1:-1:-1;;;14173:42:26;;;;14051:29;;-1:-1:-1;;;;;14193:6:26;;::::1;::::0;-1:-1:-1;;14173:42:26;;::::1;::::0;14051:92;14173:42;;;;;14193:6;14173:42;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;14173:42:26;;-1:-1:-1;14226:22:26::1;14266:25;-1:-1:-1::0;;;14266:9:26::1;:25::i;:::-;14519:13;:20:::0;14226:66;;-1:-1:-1;14496:20:26::1;14550:1612;14574:12;14570:1;:16;14550:1612;;;14608:24;14635:13;14649:1;14635:16;;;;;;;;;::::0;;;::::1;::::0;;;;;;::::1;::::0;-1:-1:-1;;;;;14635:16:26;;::::1;14687:22:::0;;;:8:::1;:22:::0;;;;;;:30;14793:12:::1;::::0;14756:59;;-1:-1:-1;;;14756:59:26;;::::1;::::0;::::1;::::0;;;;;;;;;14793:12:::1;::::0;;::::1;14756:59:::0;;;;;;;;;;;;14635:16;;-1:-1:-1;14687:30:26;14635:16;14756;;::::1;::::0;::::1;::::0;:59;;;;;;;;;;:16;:59;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;14756:59:26;-1:-1:-1;;;14756:59:26;;-1:-1:-1;;;;;;14904:35:26;::::1;::::0;-1:-1:-1;;;;;;;;14904:35:26::1;14900:616;;;14976:13;14964:9;:25;14960:415;;;15014:46;::::0;:10:::1;::::0;15034:9:::1;:25:::0;;::::1;15014:46:::0;::::1;;;::::0;::::1;::::0;;;15034:25;15014:10;:46;::::1;;;;;;;;;;;;;::::0;::::1;;;;;;14960:415;;;15119:13;15107:9;:25;15103:272;;;15165:9;:14:::0;15157:48:::1;;;::::0;;-1:-1:-1;;;15157:48:26;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;15157:48:26;;;;;;;;;;;;;::::1;;15245:10;::::0;15228:70:::1;::::0;-1:-1:-1;;;15245:10:26;::::1;-1:-1:-1::0;;;;;15245:10:26::1;15257;15277:4;15284:13:::0;15228:16:::1;:70::i;:::-;15321:10;::::0;:34:::1;::::0;;-1:-1:-1;;;15321:34:26;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;15321:10:26;;::::1;-1:-1:-1::0;;;;;15321:10:26::1;::::0;:19:::1;::::0;:34;;;;;-1:-1:-1;;15321:34:26;;;;;;;;-1:-1:-1;15321:10:26;:34;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;15103:272;14900:616;;;15428:72;15445:12;15459:10;15479:4;15486:13;15428:16;:72::i;:::-;15573:25;15601:29;:10:::0;15616:13;15601:14:::1;:29::i;:::-;-1:-1:-1::0;;;;;15645:22:26;::::1;;::::0;;;:8:::1;:22;::::0;;;;:50;;;;;-1:-1:-1;15741:19:26::1;:6:::0;15752:7;15741:10:::1;:19::i;:::-;15851:94;::::0;;;;;::::1;::::0;::::1;::::0;;;;;;;;;;;;;-1:-1:-1;;;;;;15851:94:26;::::1;::::0;15866:10:::1;::::0;15851:94:::1;::::0;;;;;;;;::::1;-1:-1:-1::0;;;;;16120:22:26;::::1;;::::0;;;:8:::1;:22;::::0;;;;-1:-1:-1;16120:29:26::1;::::0;16034:116:::1;::::0;16067:18;;16120:22;;16101:17;;16120:29:::1;;16034:32;:116::i;:::-;-1:-1:-1::0;;14588:3:26::1;::::0;;::::1;::::0;-1:-1:-1;14550:1612:26::1;::::0;-1:-1:-1;;14550:1612:26::1;;-1:-1:-1::0;16254:6:26::1;::::0;;16234:55:::1;::::0;;-1:-1:-1;;;16234:55:26;;16269:10:::1;16234:55:::0;;::::1;::::0;;;;;;;;;;;-1:-1:-1;;;;;16254:6:26;;::::1;::::0;16234:34:::1;::::0;:55;;;;;-1:-1:-1;;16234:55:26;;;;;;;-1:-1:-1;16254:6:26;16234:55;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;639:6:60;:14;;-1:-1:-1;;;;639:14:60;;;-1:-1:-1;16361:7:26;;;-1:-1:-1;;;;;13893:2483:26:o;2918:166::-;726:12:58;:10;:12::i;:::-;2988:29:26::1;:27;:29::i;:::-;3063:6;::::0;3071:4:::1;::::0;-1:-1:-1;;;;;3063:6:26::1;3046:15;:13;:15::i;:::-;3035:41;;;;;;;;;;;;2918:166::o:0;2613:34:8:-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2613:34:8;;-1:-1:-1;2613:34:8;:::o;2387:39::-;;;-1:-1:-1;;;;;2387:39:8;;:::o;255:23:58:-;;;-1:-1:-1;;;;;255:23:58;;:::o;14288:374:8:-;726:12:58;:10;:12::i;:::-;14335:36:8::1;14393:29;-1:-1:-1::0;;;14393:9:8::1;:29::i;:::-;14509:6;::::0;14335:88;;-1:-1:-1;14517:5:8::1;::::0;-1:-1:-1;;;;;14509:6:8::1;14492:15;:13;:15::i;:::-;14481:42;;;;;;;;;;;;14536:45;14562:17;14536;:45::i;:::-;14592:34;::::0;;-1:-1:-1;;;14592:34:8;;2376:2:::1;14592:34;::::0;::::1;::::0;;;-1:-1:-1;;;;;14592:25:8;::::1;::::0;::::1;::::0;:34;;;;;-1:-1:-1;;14592:34:8;;;;;;;-1:-1:-1;14592:25:8;:34;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;14637:17;:15;:17::i;2754:48::-:0;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2754:48:8;;;;;;;;;;;-1:-1:-1;;;2754:48:8;;;;;:::o;23243:154::-;23331:7;23358:31;23373:15;16773:225;16927:7;16894:13;6959:23;6973:8;6959:13;:23::i;:::-;-1:-1:-1;;;;;;;16959:23:8::1;;::::0;;;:8:::1;:23;::::0;;;;:31;;16773:225::o;1068:31:26:-;;;;;;:::o;17872:782:8:-;18123:7;580:12:60;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:60;-1:-1:-1;;;603:13:60;;;-1:-1:-1;;;1627:20:57::1;-1:-1:-1::0;1627:5:57::1;:20::i;:::-;-1:-1:-1::0;;;;;18183:28:8;;::::2;::::0;;::::2;;;18175:63;;;::::0;;-1:-1:-1;;;18175:63:8;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;18175:63:8;;;;;;;;;;;;;::::2;;18366:19;::::0;-1:-1:-1;;;;;18366:19:8::2;18358:42:::0;;:158:::2;;-1:-1:-1::0;18422:19:8::2;::::0;:42:::2;::::0;;-1:-1:-1;;;18422:42:8;;-1:-1:-1;;;;;18422:42:8;;::::2;;::::0;::::2;::::0;;;:19;;;::::2;::::0;-1:-1:-1;;18422:42:8;;;;;::::2;::::0;;;;;;;;:19;:42;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;18422:42:8;:93;::::2;;;-1:-1:-1::0;18468:19:8::2;::::0;:47:::2;::::0;;-1:-1:-1;;;18468:47:8;;-1:-1:-1;;;;;18468:47:8;;::::2;;::::0;::::2;::::0;;;:19;;;::::2;::::0;-1:-1:-1;;18468:47:8;;;;;::::2;::::0;;;;;;;;:19;:47;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;18468:47:8;18422:93:::2;18350:207;;;::::0;;-1:-1:-1;;;18350:207:8;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;18350:207:8;;;;;;;;;;;;;::::2;;18577:69;18587:12;18601;18615:7;18624;18633:12;18577:9;:69::i;:::-;639:6:60::0;:14;;-1:-1:-1;;;;639:14:60;;;18570:76:8;;-1:-1:-1;;;;;;;17872:782:8:o;12580:274::-;726:12:58;:10;:12::i;:::-;12692:16:8::1;::::0;-1:-1:-1;;;12692:16:8;::::1;;::::0;;::::1;12674:34:::0;;::::1;;;12666:73;;;::::0;;-1:-1:-1;;;12666:73:8;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;12775:13;::::0;12755:50:::1;::::0;;-1:-1:-1;;;12775:13:8;;::::1;;::::0;;::::1;12755:50:::0;;;::::1;;::::0;::::1;::::0;;;::::1;::::0;;;;;;;;::::1;12816:13;:30:::0;;::::1;::::0;;;::::1;-1:-1:-1::0;;;12816:30:8::1;-1:-1:-1::0;;12816:30:8;;::::1;::::0;;;::::1;::::0;;12580:274::o;1164:167:58:-;726:12;:10;:12::i;:::-;1268:5:::1;::::0;-1:-1:-1;;;;;1255:18:58;;::::1;1268:5:::0;::::1;1255:18;;1247:45;;;::::0;;-1:-1:-1;;;1247:45:58;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;1247:45:58;;;;;;;;;;;;;::::1;;1303:8;:20:::0;;-1:-1:-1;;;;;;1303:20:58::1;-1:-1:-1::0;;;;;1303:20:58;;;::::1;::::0;;;::::1;::::0;;1164:167::o;21965:97:8:-;22048:6;;-1:-1:-1;;;;;22048:6:8;;21965:97::o;813:104:58:-;882:5;;-1:-1:-1;;;;;882:5:58;868:10;:19;860:49;;;;;-1:-1:-1;;;860:49:58;;;;;;;;;;;;-1:-1:-1;;;860:49:58;;;;;;;;;;;;;;4077:133:57;4169:8;;:33;;;-1:-1:-1;;;4169:33:57;;;;;;;;;;-1:-1:-1;;;;;;;4169:8:57;;:18;;:33;;;;;;;;;;;;;;:8;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4169:33:57;;4077:133;-1:-1:-1;;4077:133:57:o;27252:534:26:-;27441:16;27475:31;27523:14;:21;27509:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;27509:36:26;;27475:70;;27561:9;27556:190;27580:14;:21;27576:1;:25;27556:190;;;27641:8;-1:-1:-1;;;;;27641:31:26;;27673:12;27687:8;:27;27696:14;27711:1;27696:17;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;27687:27:26;;;;;;;;;;;;;;-1:-1:-1;27687:27:26;:35;27724:12;;27641:105;;-1:-1:-1;27641:105:26;;;-1:-1:-1;;;;;;27641:105:26;;;;;;;;;;;;;;;;;27724:12;;27641:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;27641:105:26;27621:17;;:14;;27636:1;;27621:17;;;;;;;;;;;;;;;:125;27603:3;;27556:190;;;-1:-1:-1;27764:14:26;27252:534;-1:-1:-1;;;;;27252:534:26:o;7057:134:8:-;-1:-1:-1;;;;;7135:18:8;;;;;;:8;:18;;;;;-1:-1:-1;7135:24:8;;-1:-1:-1;;;7135:24:8;;;;7127:56;;;;;-1:-1:-1;;;7127:56:8;;;;;;;;;;;;-1:-1:-1;;;7127:56:8;;;;;;;;;;;;;;8436:1703:26;8488:15;;:::i;:::-;8596:19;8627:25;;8618:6;:4;:6::i;:::-;:34;;-1:-1:-1;8757:16:26;8753:71;;-1:-1:-1;;8790:22:26;;;;;;;;;8797:15;8790:22;;;;;;;;;;;8753:71;8890:20;8913:8;:26;8922:13;8936:1;8922:16;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8922:16:26;8913:26;;;;;;;;;;;;:34;8990:13;:16;;8913:34;;-1:-1:-1;8981:8:26;;8922:16;;8990:13;8922:16;;8990;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8990:16:26;8981:26;;;;;;;;;;;;:34;;-1:-1:-1;889:10:26;9147:34;;9143:120;;9205:46;;;;;;;;;;;;;;;;;-1:-1:-1;9198:53:26;;-1:-1:-1;9198:53:26;9143:120;9546:27;;:::i;:::-;-1:-1:-1;9546:45:26;;;;;;;;;9576:15;9546:45;;;;;;;;;;;-1:-1:-1;;9616:31:26;;9634:12;9616:17;:31::i;:::-;9670:13;;9604:43;;-1:-1:-1;9658:9:26;;9670:31;;9688:12;9670:17;:31::i;:::-;9658:43;-1:-1:-1;9809:16:26;9828:64;9873:18;:1;9879:11;9873:5;:18::i;:::-;9828:40;:1;889:10;9834:33;;;9828:5;:40::i;:::-;:44;;:64::i;:::-;9809:83;;9903:16;9922:56;889:10;9922:31;9940:12;9922:11;:13;;;:17;;:31;;;;:::i;:::-;:35;;:56::i;:::-;9903:75;;10014:61;10027:8;10037;738:4;10014:12;:61::i;:::-;10093:38;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;8436:1703:26;:::o;716:89:60:-;772:6;;-1:-1:-1;;;772:6:60;;;;771:7;763:34;;;;;-1:-1:-1;;;763:34:60;;;;;;;;;;;;-1:-1:-1;;;763:34:60;;;;;;;;;;;;;;28249:1695:26;28436:16;28470:21;:19;:21::i;:::-;28504:22;28544:25;-1:-1:-1;;;28544:9:26;:25::i;:::-;28504:66;-1:-1:-1;28581:26:26;28610:25;:12;28627:7;28610:16;:25::i;:::-;28581:54;;28646:31;28680:77;28710:7;28719:14;28735:12;28749:7;28680:29;:77::i;:::-;28646:111;;28775:9;28770:1037;28794:14;:21;28790:1;:25;28770:1037;;;28837:24;28864:14;28879:1;28864:17;;;;;;;;;;;;;;28837:44;;28896:21;28920:14;28935:1;28920:17;;;;;;;;;;;;;;28896:41;;28977:24;29002:1;28977:27;;;;;;;;;;;;;;28960:13;:44;;28952:79;;;;;-1:-1:-1;;;28952:79:26;;;;;;;;;;;;-1:-1:-1;;;28952:79:26;;;;;;;;;;;;;;;-1:-1:-1;;;;;29076:22:26;;29048:25;29076:22;;;:8;:22;;;;;:30;:49;;29111:13;29076:34;:49::i;:::-;-1:-1:-1;;;;;29140:22:26;;;;;;:8;:22;;;;;;;:50;;;;;-1:-1:-1;29140:22:26;;;;-1:-1:-1;29140:22:26;-1:-1:-1;;;;;29294:35:26;29290:182;;;29348:34;;:10;;:34;;;;;29368:13;;29348:34;;;;29368:13;29348:10;:34;;;;;;;;;;;;;;;;;;;;;29290:182;;;29419:53;29432:12;29446:10;29458:13;29419:12;:53::i;:::-;29494:96;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;29494:96:26;;;29511:10;;29494:96;;;;;;;;;-1:-1:-1;;;;;29765:22:26;;;;;;:8;:22;;;;;-1:-1:-1;29765:29:26;;29679:116;;29712:18;;29765:22;;29746:17;;29765:29;;29679:32;:116::i;:::-;-1:-1:-1;;;28817:3:26;;28770:1037;;;-1:-1:-1;29922:14:26;28249:1695;-1:-1:-1;;;;;;;28249:1695:26:o;1041:126:65:-;1130:4;-1:-1:-1;;;;;1110:25:65;;;;1102:57;;;;;-1:-1:-1;;;1102:57:65;;;;;;;;;;;;-1:-1:-1;;;1102:57:65;;;;;;;;;;;;;;1196:290:63;726:12:58;:10;:12::i;:::-;1370:6:63::1;594:23:65;608:8;594:13;:23::i;:::-;1401:3:63::2;594:23:65;608:8;594:13;:23::i;:::-;1423:3:63::3;948:18:65;957:8;948;:18::i;:::-;1444:34:63::4;1457:6;1465:3;1470:7;1444:12;:34::i;20061:322:8:-:0;20138:13;6959:23;6973:8;6959:13;:23::i;:::-;-1:-1:-1;;;;;;;;20168:36:8;::::1;::::0;-1:-1:-1;;;;;;;;;20168:36:8::1;20164:211;;;-1:-1:-1::0;;;;;20219:23:8;::::1;;::::0;;;:8:::1;:23;::::0;;;;20253:21:::1;20219:55:::0;;20164:211:::1;;;20337:38;::::0;;-1:-1:-1;;;20337:38:8;;20369:4:::1;20337:38;::::0;::::1;::::0;;;-1:-1:-1;;;;;20337:23:8;::::1;::::0;-1:-1:-1;;20337:38:8;;;;;::::1;::::0;;;;;;;;:23;:38;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;20337:38:8;-1:-1:-1;;;;;20303:23:8;::::1;;::::0;;;:8:::1;20337:38;20303:23:::0;;;;:72;20164:211:::1;20061:322:::0;;:::o;1722:139:57:-;1807:24;1817:13;1807:9;:24::i;:::-;-1:-1:-1;;;;;1793:38:57;:10;:38;1785:68;;;;;-1:-1:-1;;;1785:68:57;;;;;;;;;;;;-1:-1:-1;;;1785:68:57;;;;;;;;;;;;;;15286:803:8;726:12:58;:10;:12::i;:::-;6615:11:8::1;:9;:11::i;:::-;15460:6:::2;594:23:65;608:8;594:13;:23::i;:::-;15494:6:8::3;948:18:65;957:8;948;:18::i;:::-;15531:7:8::4;7656:28;7676:7;7656:19;:28::i;:::-;15618:6:::5;::::0;-1:-1:-1;;;;;15591:34:8;;::::5;15618:6:::0;::::5;15591:34;::::0;::::5;::::0;:61:::5;;-1:-1:-1::0;;;;;;15630:16:8;::::5;;::::0;;;:8:::5;:16;::::0;;;;-1:-1:-1;15630:22:8::5;::::0;-1:-1:-1;;;15630:22:8;::::5;;;15629:23;15591:61;15583:93;;;::::0;;-1:-1:-1;;;15583:93:8;;::::5;;::::0;::::5;::::0;::::5;::::0;;;;-1:-1:-1;;;15583:93:8;;;;;;;;;;;;;::::5;;15723:12;::::0;::::5;::::0;;::::5;1846:7;15706:29;15695:40:::0;::::5;::::0;;::::5;;;15687:79;;;::::0;;-1:-1:-1;;;15687:79:8;;::::5;;::::0;::::5;::::0;::::5;::::0;;;;::::5;::::0;;;;;;;;;;;;;::::5;;15785:32;:19;:17;:19::i;:::-;:32;;;15777:70;;;::::0;;-1:-1:-1;;;15777:70:8;;::::5;;::::0;::::5;::::0;::::5;::::0;;;;-1:-1:-1;;;15777:70:8;;;;;;;;;;;;;::::5;;-1:-1:-1::0;;;;;;;;15889:16:8;;;::::5;15860:26;15889:16:::0;;;:8:::5;:16;::::0;;;;15916:22;;;-1:-1:-1;15949:17:8;;::::5;:27:::0;;-1:-1:-1;;15949:27:8::5;::::0;;::::5;-1:-1:-1::0;;15949:27:8;;::::5;;15987:23:::0;;;::::5;-1:-1:-1::0;;;15987:23:8::5;::::0;;;:16:::5;16021:26:::0;;;;::::5;::::0;;;;;;;;::::5;::::0;;-1:-1:-1;;;;;;16021:26:8::5;::::0;;::::5;::::0;;;16058:12:::5;:23:::0;;;;::::5;::::0;;::::5;::::0;;::::5;::::0;::::5;::::0;;;::::5;::::0;;15286:803::o;6440:87::-;6492:10;:8;:10::i;:::-;6484:35;;;;;-1:-1:-1;;;6484:35:8;;;;;;;;;;;;-1:-1:-1;;;6484:35:8;;;;;;;;;;;;;;21082:1181:26;21306:13;:20;21355:21;;21247:9;;;;21345:31;;21337:63;;;;;-1:-1:-1;;;21337:63:26;;;;;;;;;;;;-1:-1:-1;;;21337:63:26;;;;;;;;;;;;;;;21429:15;:22;21419:6;:32;21411:63;;;;;-1:-1:-1;;;21411:63:26;;;;;;;;;;;;-1:-1:-1;;;21411:63:26;;;;;;;;;;;;;;;21496:1;21492:5;;21487:650;21503:6;21499:1;:10;21487:650;;;21627:8;:27;21636:14;21651:1;21636:17;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21627:27:26;;;;;;;;;;;-1:-1:-1;21627:27:26;-1:-1:-1;21627:33:26;;-1:-1:-1;;;21627:33:26;;;;21619:65;;;;;-1:-1:-1;;;21619:65:26;;;;;;;;;;;;-1:-1:-1;;;21619:65:26;;;;;;;;;;;;;;;21708:1;21704:5;;21699:133;21715:6;21711:1;:10;21699:133;;;21771:14;21786:1;21771:17;;;;;;;;;;;;;;-1:-1:-1;;;;;21751:37:26;:13;21765:1;21751:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21751:16:26;:37;21747:69;;;21811:5;;21747:69;21723:3;;;;;21699:133;;;21946:6;21942:1;:10;21934:42;;;;;-1:-1:-1;;;21934:42:26;;;;;;;;;;;;-1:-1:-1;;;21934:42:26;;;;;;;;;;;;;;;22101:1;22080:15;22096:1;22080:18;;;;;;;;;;;;;;:22;22072:53;;;;;-1:-1:-1;;;22072:53:26;;;;;;;;;;;;-1:-1:-1;;;22072:53:26;;;;;;;;;;;;;;;21511:3;;;;;21487:650;;;22234:1;22224:7;:11;22216:39;;;;;-1:-1:-1;;;22216:39:26;;;;;;;;;;;;-1:-1:-1;;;22216:39:26;;;;;;;;;;;;;;22580:379;22736:7;22765:17;22761:99;;22804:56;22828:14;22844:15;22804:23;:56::i;:::-;22797:63;;;;22761:99;22878:73;22905:14;22921:15;22938:12;22878:26;:73::i;:::-;22871:80;22580:379;-1:-1:-1;;;;22580:379:26:o;19713:155:8:-;19826:13;;19781:7;;19808:52;;1846:7;;19808:32;;:13;;:52;-1:-1:-1;;;19826:13:8;;;;;;19808:17;:32;:::i;:::-;:36;;:52::i;20456:205::-;20530:13;:20;20507;20561:92;20585:12;20581:1;:16;20561:92;;;20617:36;20636:13;20650:1;20636:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;20636:16:8;20617:18;:36::i;:::-;20599:3;;20561:92;;778:147:61;838:7;872:2;866;:8;;858:34;;;;;-1:-1:-1;;;858:34:61;;;;;;;;;;;;-1:-1:-1;;;858:34:61;;;;;;;;;;;;;;;-1:-1:-1;910:7:61;;;778:147::o;2190:348:62:-;2355:71;;;-1:-1:-1;;;;;2355:71:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2355:71:62;-1:-1:-1;;;2355:71:62;;;2334:93;;;;-1:-1:-1;;2313:17:62;;2334:20;;;;2355:71;2334:93;;;2355:71;2334:93;;2355:71;2334:93;;;;;;;;;;-1:-1:-1;;2334:93:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2298:129;;;;2445:7;:57;;;;-1:-1:-1;2457:11:62;;:16;;:44;;;2488:4;2477:24;;;;;;;;;;;;;;;-1:-1:-1;2477:24:62;2457:44;2437:94;;;;;-1:-1:-1;;;2437:94:62;;;;;;;;;;;;;;;;;;;;;;;;;;;386:169:61;446:7;478;;;504;;;;496:32;;;;;-1:-1:-1;;;496:32:61;;;;;;;;;;;;-1:-1:-1;;;496:32:61;;;;;;;;;;;;;;33843:310:26;34046:6;;-1:-1:-1;;;;;34010:135:26;;;;34046:6;34010:135;34071:35;:15;1846:7:8;34071:19:26;:35::i;:::-;34108:36;:16;:36;;;;;:20;:36;:::i;:::-;34010:135;;;;;;;;;;;;;;;;;;;;;;33843:310;;;;:::o;2501:239:13:-;2661:1;2639:19;:17;:19::i;:::-;:23;;;2631:61;;;;;-1:-1:-1;;;2631:61:13;;;;;;;;;;;;-1:-1:-1;;;2631:61:13;;;;;;;;;;;;;;;2703:29;:27;:29::i;5564:1852:26:-;5753:7;5826:14;5842:11;5857:55;5876:12;5890;5904:7;5857:18;:55::i;:::-;5825:87;;;;5993:6;6003:1;5993:11;;5985:46;;;;;-1:-1:-1;;;5985:46:26;;;;;;;;;;;;-1:-1:-1;;;5985:46:26;;;;;;;;;;;;;;;6128:28;6143:12;6128:14;:28::i;:::-;6119:6;:37;6112:45;;;;-1:-1:-1;;;;;;;;6237:35:26;;;-1:-1:-1;;;;;;;;;6237:35:26;6233:270;;;6308:7;6295:9;:20;6287:56;;;;;-1:-1:-1;;;6287:56:26;;;;;;;;;;;;-1:-1:-1;;;6287:56:26;;;;;;;;;;;;;;;6233:270;;;6380:9;:14;:100;;;;;6473:7;6398:71;6440:28;6455:12;6440:14;:28::i;:::-;6398:37;;;-1:-1:-1;;;6398:37:26;;6429:4;6398:37;;;;;;-1:-1:-1;;;;;6398:22:26;;;-1:-1:-1;;6398:37:26;;;;;;;;;;;;;;:22;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6398:37:26;;:41;:71::i;:::-;:82;;6380:100;6372:131;;;;;-1:-1:-1;;;6372:131:26;;;;;;;;;;;;-1:-1:-1;;;6372:131:26;;;;;;;;;;;;;;;6554:32;6573:12;6554:18;:32::i;:::-;-1:-1:-1;;;;;6630:22:26;;;;;;:8;:22;;;;;:30;:42;;6665:6;6630:34;:42::i;:::-;-1:-1:-1;;;;;6597:22:26;;;;;;:8;:22;;;;;;;:75;;;;:22;;;;-1:-1:-1;6597:22:26;-1:-1:-1;;;;;6759:35:26;6755:160;;;6809:29;;-1:-1:-1;;;;;6809:21:26;;;:29;;;;;;;;;;;;:21;:29;;;;;;;;;;;;;;;;;;;;;6755:160;;;6867:48;6880:12;6894;6908:6;6867:12;:48::i;:::-;6975:14;;;;:52;;;;;7021:6;:4;:6::i;:::-;6993:25;;:34;6975:52;6971:171;;;7062:19;:17;:19::i;:::-;7044:37;;:15;:37;;;;;;7124:6;:4;:6::i;:::-;7096:25;:34;6971:171;7196:82;7220:12;7234;7248:7;7257;7266:6;7274:3;7196:23;:82::i;:::-;7325:57;7355:12;7369;7325:29;:57::i;:::-;-1:-1:-1;7402:6:26;5564:1852;-1:-1:-1;;;;;;5564:1852:26:o;34263:85::-;34337:3;34263:85;:::o;1149:250:61:-;1209:7;1262;1258:34;;-1:-1:-1;1291:1:61;1284:8;;1258:34;1317:7;;;1322:2;1317;:7;:2;1343:6;;;;;:12;1335:37;;;;;-1:-1:-1;;;1335:37:61;;;;;;;;;;;;-1:-1:-1;;;1335:37:61;;;;;;;;;;;;;;34608:223:26;34691:7;34700;34729:4;34724:2;:9;:22;;;;34742:4;34737:2;:9;34724:22;34720:77;;;34768:29;34784:2;34788;34792:4;34768:15;:29::i;:::-;34761:36;;;;;;34720:77;-1:-1:-1;34816:2:26;;34820;;-1:-1:-1;;34608:223:26:o;1485:312:62:-;1631:59;;;-1:-1:-1;;;;;1631:59:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1631:59:62;-1:-1:-1;;;1631:59:62;;;1610:81;;;;-1:-1:-1;;1589:17:62;;1610:20;;;;1631:59;1610:81;;;1631:59;1610:81;;1631:59;1610:81;;;;;;;;;;-1:-1:-1;;1610:81:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1574:117;;;;1709:7;:57;;;;-1:-1:-1;1721:11:62;;:16;;:44;;;1752:4;1741:24;;;;;;;;;;;;;;;-1:-1:-1;1741:24:62;1721:44;1701:89;;;;;-1:-1:-1;;;1701:89:62;;;;;;;;;;;;-1:-1:-1;;;1701:89:62;;;;;;;;;;;;;;;1485:312;;;;;:::o;692:128:65:-;-1:-1:-1;;;;;766:22:65;;758:54;;;;;-1:-1:-1;;;758:54:65;;;;;;;;;;;;-1:-1:-1;;;758:54:65;;;;;;;;;;;;;;6701:88:8;6756:10;:8;:10::i;:::-;6755:11;6747:34;;;;;-1:-1:-1;;;6747:34:8;;;;;;;;;;;;-1:-1:-1;;;6747:34:8;;;;;;;;;;;;;;7759:157;7847:1;7837:7;:11;;;:40;;;;-1:-1:-1;1846:7:8;7852:25;;;;;7837:40;7829:79;;;;;-1:-1:-1;;;7829:79:8;;;;;;;;;;;;;;;;;;;;;;;;;;;23240:1215:26;23379:7;23489:14;23506:30;23520:15;23506:13;:30::i;:::-;23489:47;;23633:9;23628:742;23652:14;:21;23648:1;:25;23628:742;;;23695:24;23722:14;23737:1;23722:17;;;;;;;;;;;;;;23695:44;;23754:21;23778:15;23794:1;23778:18;;;;;;;;;;;;;;23754:42;;-1:-1:-1;;;;;;;;;;;;;;;;23817:35:26;;;;;;23813:193;;23934:72;23951:12;23965:10;23985:4;23992:13;23934:16;:72::i;:::-;-1:-1:-1;;;;;24023:22:26;;;;;;:8;:22;;;;;;;;;:46;;;24091:78;;;;;;;;;;;;;;;;;;;24106:10;;24091:78;;;;;;;;;;-1:-1:-1;;;;;24328:22:26;;;;;;:8;:22;;;;;-1:-1:-1;24328:29:26;;24258:100;;24291:6;;24328:22;;24313:13;;24328:29;;24258:32;:100::i;:::-;-1:-1:-1;;23675:3:26;;23628:742;;;-1:-1:-1;24441:6:26;23240:1215;-1:-1:-1;;;23240:1215:26:o;24792:2004::-;24956:7;24981:21;:19;:21::i;:::-;-1:-1:-1;;;;;;;;;;;25053:29:26;;:8;:29;;-1:-1:-1;;;;;;;;;;;25053:37:26;:52;;25095:9;25053:41;:52::i;:::-;-1:-1:-1;;;;;;;;;;;25013:29:26;;;;:8;:29;;-1:-1:-1;;;;;;;;;;;25013:92:26;;;;25158:25;-1:-1:-1;;;25158:9:26;:25::i;:::-;25118:66;;25195:14;25212:67;25224:7;25233:12;25247:14;25263:15;25212:11;:67::i;:::-;25195:84;-1:-1:-1;25290:26:26;25319:24;:12;25195:84;25319:16;:24::i;:::-;25290:53;;25361:9;25356:1355;25380:14;:21;25376:1;:25;25356:1355;;;25423:24;25450:14;25465:1;25450:17;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;25503:22:26;;;25482:18;25503:22;;;:8;:22;;;;;;:30;25615:12;;25572:64;;-1:-1:-1;;;25572:64:26;;;;;;;;;;;;;;25615:12;;;;25572:64;;;;;;;;;;;;25450:17;;-1:-1:-1;25503:30:26;25482:18;;25572:16;;;;;;:64;;;;;25450:17;;25572:64;;;;;;:16;:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25572:64:26;;-1:-1:-1;25659:17:26;25651:52;;;;;-1:-1:-1;;;25651:52:26;;;;;;;;;;;;-1:-1:-1;;;25651:52:26;;;;;;;;;;;;;;;25742:15;25758:1;25742:18;;;;;;;;;;;;;;25725:13;:35;;25718:43;;;;-1:-1:-1;;;;;;;;25865:35:26;;;-1:-1:-1;;;;;;;;;25865:35:26;25861:378;;25982:72;25999:12;26013:10;26033:4;26040:13;25982:16;:72::i;:::-;25861:378;;;26099:13;26078:15;26094:1;26078:18;;;;;;;;;;;;;;:34;26074:165;;;26204:18;;26184:10;;:55;;26225:13;;26204:15;;26220:1;;26204:18;;;;;;;;;;;;:34;26184:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26074:165;26256:25;26284:29;:10;26299:13;26284:14;:29::i;:::-;-1:-1:-1;;;;;26328:22:26;;;;;;:8;:22;;;;;;;;;:50;;;26400:94;;;;;;;;;;;;;;;;;;;26328:50;;-1:-1:-1;26328:22:26;;26415:10;;26400:94;;;;;;;;;;-1:-1:-1;;;;;26669:22:26;;;;;;:8;:22;;;;;-1:-1:-1;26669:29:26;;26583:116;;26616:18;;26669:22;;26650:17;;26669:29;;26583:32;:116::i;:::-;-1:-1:-1;;25403:3:26;;;;;-1:-1:-1;25356:1355:26;;-1:-1:-1;25356:1355:26;;-1:-1:-1;26782:6:26;;24792:2004;-1:-1:-1;;;;;;24792:2004:26:o;1627:174:61:-;1687:7;1720:1;1715:2;:6;1707:37;;;;;-1:-1:-1;;;1707:37:61;;;;;;;;;;;;-1:-1:-1;;;1707:37:61;;;;;;;;;;;;;;;1755:9;1772:2;1767;:7;;;;;;;1627:174;-1:-1:-1;;;;1627:174:61:o;11633:276:8:-;726:12:58;:10;:12::i;:::-;11803:1:8::1;11781:19;:17;:19::i;:::-;:23;;;11773:61;;;::::0;;-1:-1:-1;;;11773:61:8;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;11773:61:8;;;;;;;;;;;;;::::1;;11845:6;::::0;;:24:::1;::::0;;-1:-1:-1;;;11845:24:8;;;;-1:-1:-1;;;;;11845:6:8;;::::1;::::0;-1:-1:-1;;11845:24:8;;::::1;::::0;:6:::1;::::0;:24;;;;;;:6;;:24;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;11880:21;:19;:21::i;21084:758::-:0;-1:-1:-1;;;21705:21:8;;21698:29;;;;21743:91;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21743:91:8;;;;;;;;;;;;;;;;;;;;;21084:758;;;;;;:::o;32195:1330:26:-;32351:6;;;32331:42;;;-1:-1:-1;;;32331:42:26;;;;32305:23;;-1:-1:-1;;;;;32351:6:26;;;;32331:40;;:42;;;;;;;;;;;;;32351:6;32331:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;32331:42:26;;-1:-1:-1;32384:28:26;32415;32430:12;32415:14;:28::i;:::-;32384:59;;32454:28;32485;32500:12;32485:14;:28::i;:::-;-1:-1:-1;;;;;32553:22:26;;;32524:26;32553:22;;;:8;:22;;;;;;-1:-1:-1;32553:29:26;;;;32622:22;;;;;;;;:29;;32454:59;;-1:-1:-1;32553:29:26;;;;;32622;;;32748:45;;32454:59;;32553:29;;32748:24;:45;:::i;:::-;32732:61;-1:-1:-1;32804:13:26;32820:45;:20;:45;;;;;:24;:45;:::i;:::-;32881:57;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;32881:57:26;;;;;;;;;;;;;;;;33016:106;33049:15;33066:12;33080:20;33102:19;33016:32;:106::i;:::-;33133;33166:15;33183:12;33197:20;33219:19;33133:32;:106::i;:::-;33323:89;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;33323:89:26;;;;;;;;;;;;;33428;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;33428:89:26;;;;;;;;;;;;;32195:1330;;;;;;;;;:::o;34928:345::-;35016:7;35025;35055:2;35049;:8;35045:58;;;-1:-1:-1;;35089:1:26;35080:10;;;35072:31;;35045:58;35123:2;35118;:7;35114:62;;;35147:29;35161:2;35165;35169:6;35147:13;:29::i;35114:62::-;35188:9;35199;35212:29;35226:2;35230;35234:6;35212:13;:29::i;:::-;35187:54;;;-1:-1:-1;34928:345:26;-1:-1:-1;;;;;;34928:345:26:o;29952:608::-;30112:7;;30180:1;30163:249;30187:14;:21;30183:1;:25;30163:249;;;30303:66;30333:8;:27;30342:14;30357:1;30342:17;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;30333:27:26;;;;;;;;;;;-1:-1:-1;30333:27:26;:35;30303:25;;:15;;30319:8;;30303:25;;;;;;;;;;;;:29;;:66;;;;:::i;:::-;30234;30257:8;:34;30266:14;30281:8;30266:24;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;30257:34:26;;;;;;;;;;;-1:-1:-1;30257:34:26;:42;30234:18;;:15;;30250:1;;30234:18;;;;;:66;:135;30230:170;;;30399:1;30388:12;;30230:170;30210:3;;30163:249;;;;30429:7;-1:-1:-1;;;;;30429:24:26;;30454:12;30468:8;:34;30477:14;30492:8;30477:24;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;30468:34:26;;;;;;;;;;;-1:-1:-1;30468:34:26;:42;30512:12;;30526:25;;30512:12;;;;;30526:15;;30542:8;;30526:25;;;;;;;;;;;;30429:123;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30429:123:26;;29952:608;-1:-1:-1;;;;;;29952:608:26:o;35393:404::-;35479:7;;;35539:6;-1:-1:-1;;35539:6:26;35525:20;;;;;35508:37;;35565:6;35560:2;:11;35556:121;;;35588:9;35606:6;35615:1;35606:10;35600:2;:17;;;;;;35620:1;35600:21;35588:33;;35642:1;35636:7;;;;;;;;;35664:1;35658:7;;;;;;;;;35556:121;;35687:9;35699:33;35708:11;;;35721:10;35708:2;35728;35721:6;:10::i;:::-;35699:8;:33::i;:::-;35687:45;35755:10;;;;;-1:-1:-1;35393:404:26;;-1:-1:-1;;;;;35393:404:26:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o",
"source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\r\npragma solidity 0.6.12;\r\nimport \"../../LiquidityPoolConverter.sol\";\r\nimport \"../../../token/interfaces/ISmartToken.sol\";\r\nimport \"../../../utility/Types.sol\";\r\n\r\n/**\r\n * @dev Liquidity Pool v1 Converter\r\n *\r\n * The liquidity pool v1 converter is a specialized version of a converter that manages\r\n * a classic bancor liquidity pool.\r\n *\r\n * Even though pools can have many reserves, the standard pool configuration\r\n * is 2 reserves with 50%/50% weights.\r\n*/\r\ncontract LiquidityPoolV1Converter is LiquidityPoolConverter {\r\n IEtherToken internal etherToken = IEtherToken(0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315);\r\n uint256 internal constant MAX_RATE_FACTOR_LOWER_BOUND = 1e30;\r\n \r\n // the period of time taken into account when calculating the recent averate rate\r\n uint256 private constant AVERAGE_RATE_PERIOD = 10 minutes;\r\n\r\n // true if the pool is a 2 reserves / 50%/50% weights pool, false otherwise\r\n bool public isStandardPool = false;\r\n\r\n // only used in standard pools\r\n Fraction public prevAverageRate; // average rate after the previous conversion (1 reserve token 0 in reserve token 1 units)\r\n uint256 public prevAverageRateUpdateTime; // last time when the previous rate was updated (in seconds)\r\n\r\n /**\r\n * @dev triggered after a conversion with new price data\r\n * deprecated, use `TokenRateUpdate` from version 28 and up\r\n *\r\n * @param _connectorToken reserve token\r\n * @param _tokenSupply smart token supply\r\n * @param _connectorBalance reserve balance\r\n * @param _connectorWeight reserve weight\r\n */\r\n event PriceDataUpdate(\r\n IERC20Token indexed _connectorToken,\r\n uint256 _tokenSupply,\r\n uint256 _connectorBalance,\r\n uint32 _connectorWeight\r\n );\r\n\r\n /**\r\n * @dev initializes a new LiquidityPoolV1Converter instance\r\n *\r\n * @param _token pool token governed by the converter\r\n * @param _registry address of a contract registry contract\r\n * @param _maxConversionFee maximum conversion fee, represented in ppm\r\n */\r\n constructor(\r\n ISmartToken _token,\r\n IContractRegistry _registry,\r\n uint32 _maxConversionFee\r\n )\r\n LiquidityPoolConverter(_token, _registry, _maxConversionFee)\r\n public\r\n {\r\n }\r\n\r\n /**\r\n * @dev returns the converter type\r\n *\r\n * @return see the converter types in the the main contract doc\r\n */\r\n function converterType() public pure override returns (uint16) {\r\n return 1;\r\n }\r\n\r\n /**\r\n * @dev accepts ownership of the anchor after an ownership transfer\r\n * also activates the converter\r\n * can only be called by the contract owner\r\n * note that prior to version 28, you should use 'acceptTokenOwnership' instead\r\n */\r\n function acceptAnchorOwnership() public override ownerOnly {\r\n super.acceptAnchorOwnership();\r\n\r\n emit Activation(converterType(), anchor, true);\r\n }\r\n\r\n /**\r\n * @dev defines a new reserve token for the converter\r\n * can only be called by the owner while the converter is inactive\r\n *\r\n * @param _token address of the reserve token\r\n * @param _weight reserve weight, represented in ppm, 1-1000000\r\n */\r\n function addReserve(IERC20Token _token, uint32 _weight) public override ownerOnly {\r\n super.addReserve(_token, _weight);\r\n\r\n isStandardPool =\r\n reserveTokens.length == 2 &&\r\n reserves[reserveTokens[0]].weight == 500000 &&\r\n reserves[reserveTokens[1]].weight == 500000;\r\n }\r\n\r\n /**\r\n * @dev returns the expected target amount of converting one reserve to another along with the fee\r\n *\r\n * @param _sourceToken contract address of the source reserve token\r\n * @param _targetToken contract address of the target reserve token\r\n * @param _amount amount of tokens received from the user\r\n *\r\n * @return expected target amount\r\n * @return expected fee\r\n */\r\n function targetAmountAndFee(IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount)\r\n public\r\n view\r\n override\r\n active\r\n validReserve(_sourceToken)\r\n validReserve(_targetToken)\r\n returns (uint256, uint256)\r\n {\r\n // validate input\r\n require(_sourceToken != _targetToken, \"ERR_SAME_SOURCE_TARGET\");\r\n\r\n uint256 amount = IBancorFormula(addressOf(BANCOR_FORMULA)).crossReserveTargetAmount(\r\n reserveBalance(_sourceToken),\r\n reserves[_sourceToken].weight,\r\n reserveBalance(_targetToken),\r\n reserves[_targetToken].weight,\r\n _amount\r\n );\r\n\r\n // return the amount minus the conversion fee and the conversion fee\r\n uint256 fee = calculateFee(amount);\r\n return (amount - fee, fee);\r\n }\r\n\r\n /**\r\n * @dev converts a specific amount of source tokens to target tokens\r\n * can only be called by the bancor network contract\r\n *\r\n * @param _sourceToken source ERC20 token\r\n * @param _targetToken target ERC20 token\r\n * @param _amount amount of tokens to convert (in units of the source token)\r\n * @param _trader address of the caller who executed the conversion\r\n * @param _beneficiary wallet to receive the conversion result\r\n *\r\n * @return amount of tokens received (in units of the target token)\r\n */\r\n function doConvert(IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount, address _trader, address payable _beneficiary)\r\n internal\r\n override\r\n returns (uint256)\r\n {\r\n // get expected target amount and fee\r\n (uint256 amount, uint256 fee) = targetAmountAndFee(_sourceToken, _targetToken, _amount);\r\n\r\n // ensure that the trade gives something in return\r\n require(amount != 0, \"ERR_ZERO_TARGET_AMOUNT\");\r\n\r\n // ensure that the trade won't deplete the reserve balance\r\n assert(amount < reserveBalance(_targetToken));\r\n\r\n // ensure that the input amount was already deposited\r\n if (_sourceToken == ETH_RESERVE_ADDRESS)\r\n require(msg.value == _amount, \"ERR_ETH_AMOUNT_MISMATCH\");\r\n else\r\n require(msg.value == 0 && _sourceToken.balanceOf(address(this)).sub(reserveBalance(_sourceToken)) >= _amount, \"ERR_INVALID_AMOUNT\");\r\n\r\n // sync the reserve balances\r\n syncReserveBalance(_sourceToken);\r\n reserves[_targetToken].balance = reserves[_targetToken].balance.sub(amount);\r\n\r\n // transfer funds to the beneficiary in the to reserve token\r\n if (_targetToken == ETH_RESERVE_ADDRESS)\r\n _beneficiary.transfer(amount);\r\n else\r\n safeTransfer(_targetToken, _beneficiary, amount);\r\n\r\n // update the recent average rate\r\n if (isStandardPool && prevAverageRateUpdateTime < time()) {\r\n prevAverageRate = recentAverageRate();\r\n prevAverageRateUpdateTime = time();\r\n }\r\n\r\n // dispatch the conversion event\r\n dispatchConversionEvent(_sourceToken, _targetToken, _trader, _amount, amount, fee);\r\n\r\n // dispatch rate updates\r\n dispatchTokenRateUpdateEvents(_sourceToken, _targetToken);\r\n\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev returns the recent average rate of 1 `_token` in the other reserve token units\r\n * note that the rate can only be queried for reserves in a standard pool\r\n *\r\n * @param _token token to get the rate for\r\n * @return recent average rate between the reserves (numerator)\r\n * @return recent average rate between the reserves (denominator)\r\n */\r\n function recentAverageRate(IERC20Token _token) external view returns (uint256, uint256) {\r\n // verify that the pool is standard\r\n require(isStandardPool, \"ERR_NON_STANDARD_POOL\");\r\n\r\n // get the recent average rate of reserve 0\r\n Fraction memory rate = recentAverageRate();\r\n if (_token == reserveTokens[0]) {\r\n return (rate.n, rate.d);\r\n }\r\n\r\n return (rate.d, rate.n);\r\n }\r\n\r\n /**\r\n * @dev returns the recent average rate of 1 reserve token 0 in reserve token 1 units\r\n *\r\n * @return recent average rate between the reserves\r\n */\r\n function recentAverageRate() internal view returns (Fraction memory) {\r\n // get the elapsed time since the previous average rate was calculated\r\n uint256 timeElapsed = time() - prevAverageRateUpdateTime;\r\n\r\n // if the previous average rate was calculated in the current block, return it\r\n if (timeElapsed == 0) {\r\n return prevAverageRate;\r\n }\r\n\r\n // get the current rate between the reserves\r\n uint256 currentRateN = reserves[reserveTokens[1]].balance;\r\n uint256 currentRateD = reserves[reserveTokens[0]].balance;\r\n\r\n // if the previous average rate was calculated a while ago, the average rate is equal to the current rate\r\n if (timeElapsed >= AVERAGE_RATE_PERIOD) {\r\n return Fraction({ n: currentRateN, d: currentRateD });\r\n }\r\n\r\n // given N as the sampling window, the new rate is calculated according to the following formula:\r\n // newRate = prevAverageRate + timeElapsed * [currentRate - prevAverageRate] / N\r\n\r\n // calculate the numerator and the denumerator of the new rate\r\n Fraction memory prevAverage = prevAverageRate;\r\n\r\n uint256 x = prevAverage.d.mul(currentRateN);\r\n uint256 y = prevAverage.n.mul(currentRateD);\r\n\r\n // since we know that timeElapsed < AVERAGE_RATE_PERIOD, we can avoid using SafeMath:\r\n uint256 newRateN = y.mul(AVERAGE_RATE_PERIOD - timeElapsed).add(x.mul(timeElapsed));\r\n uint256 newRateD = prevAverage.d.mul(currentRateD).mul(AVERAGE_RATE_PERIOD);\r\n\r\n (newRateN, newRateD) = reducedRatio(newRateN, newRateD, MAX_RATE_FACTOR_LOWER_BOUND);\r\n return Fraction({ n: newRateN, d: newRateD });\r\n }\r\n\r\n /**\r\n * @dev increases the pool's liquidity and mints new shares in the pool to the caller\r\n * note that prior to version 28, you should use 'fund' instead\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveAmounts amount of each reserve token\r\n * @param _minReturn token minimum return-amount\r\n *\r\n * @return amount of pool tokens issued\r\n */\r\n function addLiquidity(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts, uint256 _minReturn)\r\n public\r\n payable\r\n protected\r\n active\r\n returns (uint256)\r\n {\r\n // verify the user input\r\n verifyLiquidityInput(_reserveTokens, _reserveAmounts, _minReturn);\r\n\r\n // if one of the reserves is ETH, then verify that the input amount of ETH is equal to the input value of ETH\r\n for (uint256 i = 0; i < _reserveTokens.length; i++)\r\n if (_reserveTokens[i] == ETH_RESERVE_ADDRESS)\r\n require(_reserveAmounts[i] == msg.value, \"ERR_ETH_AMOUNT_MISMATCH\");\r\n\r\n // if the input value of ETH is larger than zero, then verify that one of the reserves is ETH\r\n if (msg.value > 0) {\r\n require(reserves[ETH_RESERVE_ADDRESS].isSet, \"ERR_NO_ETH_RESERVE\");\r\n }\r\n\r\n // get the total supply\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n\r\n // transfer from the user an equally-worth amount of each one of the reserve tokens\r\n uint256 amount = addLiquidityToPool(_reserveTokens, _reserveAmounts, totalSupply);\r\n\r\n // verify that the equivalent amount of tokens is equal to or larger than the user's expectation\r\n require(amount >= _minReturn, \"ERR_RETURN_TOO_LOW\");\r\n\r\n // issue the tokens to the user\r\n ISmartToken(address(anchor)).issue(msg.sender, amount);\r\n\r\n // return the amount of pool tokens issued\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev decreases the pool's liquidity and burns the caller's shares in the pool\r\n * note that prior to version 28, you should use 'liquidate' instead\r\n *\r\n * @param _amount token amount\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveMinReturnAmounts minimum return-amount of each reserve token\r\n *\r\n * @return the amount of each reserve token granted for the given amount of pool tokens\r\n */\r\n function removeLiquidity(uint256 _amount, IERC20Token[] memory _reserveTokens, uint256[] memory _reserveMinReturnAmounts)\r\n public\r\n protected\r\n active\r\n returns (uint256[] memory)\r\n {\r\n // verify the user input\r\n verifyLiquidityInput(_reserveTokens, _reserveMinReturnAmounts, _amount);\r\n\r\n // get the total supply BEFORE destroying the user tokens\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n\r\n // destroy the user tokens\r\n ISmartToken(address(anchor)).destroy(msg.sender, _amount);\r\n\r\n // transfer to the user an equivalent amount of each one of the reserve tokens\r\n return removeLiquidityFromPool(_reserveTokens, _reserveMinReturnAmounts, totalSupply, _amount);\r\n }\r\n\r\n /**\r\n * @dev increases the pool's liquidity and mints new shares in the pool to the caller\r\n * for example, if the caller increases the supply by 10%,\r\n * then it will cost an amount equal to 10% of each reserve token balance\r\n * note that starting from version 28, you should use 'addLiquidity' instead\r\n *\r\n * @param _amount amount to increase the supply by (in the pool token)\r\n *\r\n * @return amount of pool tokens issued\r\n */\r\n function fund(uint256 _amount)\r\n public\r\n payable\r\n protected\r\n returns (uint256)\r\n {\r\n syncReserveBalances();\r\n reserves[ETH_RESERVE_ADDRESS].balance = reserves[ETH_RESERVE_ADDRESS].balance.sub(msg.value);\r\n\r\n uint256 supply = ISmartToken(address(anchor)).totalSupply();\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n\r\n // iterate through the reserve tokens and transfer a percentage equal to the weight between\r\n // _amount and the total supply in each reserve from the caller to the converter\r\n uint256 reserveCount = reserveTokens.length;\r\n for (uint256 i = 0; i < reserveCount; i++) {\r\n IERC20Token reserveToken = reserveTokens[i];\r\n uint256 rsvBalance = reserves[reserveToken].balance;\r\n uint256 reserveAmount = formula.fundCost(supply, rsvBalance, reserveRatio, _amount);\r\n\r\n // transfer funds from the caller in the reserve token\r\n if (reserveToken == ETH_RESERVE_ADDRESS) {\r\n if (msg.value > reserveAmount) {\r\n msg.sender.transfer(msg.value - reserveAmount);\r\n }\r\n else if (msg.value < reserveAmount) {\r\n require(msg.value == 0, \"ERR_INVALID_ETH_VALUE\");\r\n safeTransferFrom(etherToken, msg.sender, address(this), reserveAmount);\r\n etherToken.withdraw(reserveAmount);\r\n }\r\n }\r\n else {\r\n safeTransferFrom(reserveToken, msg.sender, address(this), reserveAmount);\r\n }\r\n\r\n // sync the reserve balance\r\n uint256 newReserveBalance = rsvBalance.add(reserveAmount);\r\n reserves[reserveToken].balance = newReserveBalance;\r\n\r\n uint256 newPoolTokenSupply = supply.add(_amount);\r\n\r\n // dispatch liquidity update for the pool token/reserve\r\n emit LiquidityAdded(msg.sender, reserveToken, reserveAmount, newReserveBalance, newPoolTokenSupply);\r\n\r\n // dispatch the `TokenRateUpdate` event for the pool token\r\n dispatchPoolTokenRateUpdateEvent(newPoolTokenSupply, reserveToken, newReserveBalance, reserves[reserveToken].weight);\r\n }\r\n\r\n // issue new funds to the caller in the pool token\r\n ISmartToken(address(anchor)).issue(msg.sender, _amount);\r\n\r\n // return the amount of pool tokens issued\r\n return _amount;\r\n }\r\n\r\n /**\r\n * @dev decreases the pool's liquidity and burns the caller's shares in the pool\r\n * for example, if the holder sells 10% of the supply,\r\n * then they will receive 10% of each reserve token balance in return\r\n * note that starting from version 28, you should use 'removeLiquidity' instead\r\n *\r\n * @param _amount amount to liquidate (in the pool token)\r\n *\r\n * @return the amount of each reserve token granted for the given amount of pool tokens\r\n */\r\n function liquidate(uint256 _amount)\r\n public\r\n protected\r\n returns (uint256[] memory)\r\n {\r\n require(_amount > 0, \"ERR_ZERO_AMOUNT\");\r\n\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n ISmartToken(address(anchor)).destroy(msg.sender, _amount);\r\n\r\n uint256[] memory reserveMinReturnAmounts = new uint256[](reserveTokens.length);\r\n for (uint256 i = 0; i < reserveMinReturnAmounts.length; i++)\r\n reserveMinReturnAmounts[i] = 1;\r\n\r\n return removeLiquidityFromPool(reserveTokens, reserveMinReturnAmounts, totalSupply, _amount);\r\n }\r\n\r\n /**\r\n * @dev given the amount of one of the reserve tokens to add liquidity of,\r\n * returns the required amount of each one of the other reserve tokens\r\n * since an empty pool can be funded with any list of non-zero input amounts,\r\n * this function assumes that the pool is not empty (has already been funded)\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveTokenIndex index of the relevant reserve token\r\n * @param _reserveAmount amount of the relevant reserve token\r\n *\r\n * @return the required amount of each one of the reserve tokens\r\n */\r\n function addLiquidityCost(IERC20Token[] memory _reserveTokens, uint256 _reserveTokenIndex, uint256 _reserveAmount)\r\n public\r\n view\r\n returns (uint256[] memory)\r\n {\r\n uint256[] memory reserveAmounts = new uint256[](_reserveTokens.length);\r\n\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n uint256 amount = formula.fundSupplyAmount(totalSupply, reserves[_reserveTokens[_reserveTokenIndex]].balance, reserveRatio, _reserveAmount);\r\n\r\n for (uint256 i = 0; i < reserveAmounts.length; i++)\r\n reserveAmounts[i] = formula.fundCost(totalSupply, reserves[_reserveTokens[i]].balance, reserveRatio, amount);\r\n\r\n return reserveAmounts;\r\n }\r\n\r\n /**\r\n * @dev given the amount of one of the reserve tokens to add liquidity of,\r\n * returns the amount of pool tokens entitled for it\r\n * since an empty pool can be funded with any list of non-zero input amounts,\r\n * this function assumes that the pool is not empty (has already been funded)\r\n *\r\n * @param _reserveToken address of the reserve token\r\n * @param _reserveAmount amount of the reserve token\r\n *\r\n * @return the amount of pool tokens entitled\r\n */\r\n function addLiquidityReturn(IERC20Token _reserveToken, uint256 _reserveAmount)\r\n public\r\n view\r\n returns (uint256)\r\n {\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n return formula.fundSupplyAmount(totalSupply, reserves[_reserveToken].balance, reserveRatio, _reserveAmount);\r\n }\r\n\r\n /**\r\n * @dev returns the amount of each reserve token entitled for a given amount of pool tokens\r\n *\r\n * @param _amount amount of pool tokens\r\n * @param _reserveTokens address of each reserve token\r\n *\r\n * @return the amount of each reserve token entitled for the given amount of pool tokens\r\n */\r\n function removeLiquidityReturn(uint256 _amount, IERC20Token[] memory _reserveTokens)\r\n public\r\n view\r\n returns (uint256[] memory)\r\n {\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n return removeLiquidityReserveAmounts(_amount, _reserveTokens, totalSupply, formula);\r\n }\r\n\r\n /**\r\n * @dev verifies that a given array of tokens is identical to the converter's array of reserve tokens\r\n * we take this input in order to allow specifying the corresponding reserve amounts in any order\r\n *\r\n * @param _reserveTokens array of reserve tokens\r\n * @param _reserveAmounts array of reserve amounts\r\n * @param _amount token amount\r\n */\r\n function verifyLiquidityInput(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts, uint256 _amount)\r\n private\r\n view\r\n {\r\n uint256 i;\r\n uint256 j;\r\n\r\n uint256 length = reserveTokens.length;\r\n require(length == _reserveTokens.length, \"ERR_INVALID_RESERVE\");\r\n require(length == _reserveAmounts.length, \"ERR_INVALID_AMOUNT\");\r\n\r\n for (i = 0; i < length; i++) {\r\n // verify that every input reserve token is included in the reserve tokens\r\n require(reserves[_reserveTokens[i]].isSet, \"ERR_INVALID_RESERVE\");\r\n for (j = 0; j < length; j++) {\r\n if (reserveTokens[i] == _reserveTokens[j])\r\n break;\r\n }\r\n // verify that every reserve token is included in the input reserve tokens\r\n require(j < length, \"ERR_INVALID_RESERVE\");\r\n // verify that every input reserve token amount is larger than zero\r\n require(_reserveAmounts[i] > 0, \"ERR_INVALID_AMOUNT\");\r\n }\r\n\r\n // verify that the input token amount is larger than zero\r\n require(_amount > 0, \"ERR_ZERO_AMOUNT\");\r\n }\r\n\r\n /**\r\n * @dev adds liquidity (reserve) to the pool\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveAmounts amount of each reserve token\r\n * @param _totalSupply token total supply\r\n *\r\n * @return amount of pool tokens issued\r\n */\r\n function addLiquidityToPool(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts, uint256 _totalSupply)\r\n private\r\n returns (uint256)\r\n {\r\n if (_totalSupply == 0)\r\n return addLiquidityToEmptyPool(_reserveTokens, _reserveAmounts);\r\n return addLiquidityToNonEmptyPool(_reserveTokens, _reserveAmounts, _totalSupply);\r\n }\r\n\r\n /**\r\n * @dev adds liquidity (reserve) to the pool when it's empty\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveAmounts amount of each reserve token\r\n *\r\n * @return amount of pool tokens issued\r\n */\r\n function addLiquidityToEmptyPool(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts)\r\n private\r\n returns (uint256)\r\n {\r\n // calculate the geometric-mean of the reserve amounts approved by the user\r\n uint256 amount = geometricMean(_reserveAmounts);\r\n\r\n // transfer each one of the reserve amounts from the user to the pool\r\n for (uint256 i = 0; i < _reserveTokens.length; i++) {\r\n IERC20Token reserveToken = _reserveTokens[i];\r\n uint256 reserveAmount = _reserveAmounts[i];\r\n\r\n if (reserveToken != ETH_RESERVE_ADDRESS) // ETH has already been transferred as part of the transaction\r\n safeTransferFrom(reserveToken, msg.sender, address(this), reserveAmount);\r\n\r\n reserves[reserveToken].balance = reserveAmount;\r\n\r\n emit LiquidityAdded(msg.sender, reserveToken, reserveAmount, reserveAmount, amount);\r\n\r\n // dispatch the `TokenRateUpdate` event for the pool token\r\n dispatchPoolTokenRateUpdateEvent(amount, reserveToken, reserveAmount, reserves[reserveToken].weight);\r\n }\r\n\r\n // return the amount of pool tokens issued\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev adds liquidity (reserve) to the pool when it's not empty\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveAmounts amount of each reserve token\r\n * @param _totalSupply token total supply\r\n *\r\n * @return amount of pool tokens issued\r\n */\r\n function addLiquidityToNonEmptyPool(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts, uint256 _totalSupply)\r\n private\r\n returns (uint256)\r\n {\r\n syncReserveBalances();\r\n reserves[ETH_RESERVE_ADDRESS].balance = reserves[ETH_RESERVE_ADDRESS].balance.sub(msg.value);\r\n\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n uint256 amount = getMinShare(formula, _totalSupply, _reserveTokens, _reserveAmounts);\r\n uint256 newPoolTokenSupply = _totalSupply.add(amount);\r\n\r\n for (uint256 i = 0; i < _reserveTokens.length; i++) {\r\n IERC20Token reserveToken = _reserveTokens[i];\r\n uint256 rsvBalance = reserves[reserveToken].balance;\r\n uint256 reserveAmount = formula.fundCost(_totalSupply, rsvBalance, reserveRatio, amount);\r\n require(reserveAmount > 0, \"ERR_ZERO_TARGET_AMOUNT\");\r\n assert(reserveAmount <= _reserveAmounts[i]);\r\n\r\n // transfer each one of the reserve amounts from the user to the pool\r\n if (reserveToken != ETH_RESERVE_ADDRESS) // ETH has already been transferred as part of the transaction\r\n safeTransferFrom(reserveToken, msg.sender, address(this), reserveAmount);\r\n else if (_reserveAmounts[i] > reserveAmount) // transfer the extra amount of ETH back to the user\r\n msg.sender.transfer(_reserveAmounts[i] - reserveAmount);\r\n\r\n uint256 newReserveBalance = rsvBalance.add(reserveAmount);\r\n reserves[reserveToken].balance = newReserveBalance;\r\n\r\n emit LiquidityAdded(msg.sender, reserveToken, reserveAmount, newReserveBalance, newPoolTokenSupply);\r\n\r\n // dispatch the `TokenRateUpdate` event for the pool token\r\n dispatchPoolTokenRateUpdateEvent(newPoolTokenSupply, reserveToken, newReserveBalance, reserves[reserveToken].weight);\r\n }\r\n\r\n // return the amount of pool tokens issued\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev returns the amount of each reserve token entitled for a given amount of pool tokens\r\n *\r\n * @param _amount amount of pool tokens\r\n * @param _reserveTokens address of each reserve token\r\n * @param _totalSupply token total supply\r\n * @param _formula formula contract\r\n *\r\n * @return the amount of each reserve token entitled for the given amount of pool tokens\r\n */\r\n function removeLiquidityReserveAmounts(uint256 _amount, IERC20Token[] memory _reserveTokens, uint256 _totalSupply, IBancorFormula _formula)\r\n private\r\n view\r\n returns (uint256[] memory)\r\n {\r\n uint256[] memory reserveAmounts = new uint256[](_reserveTokens.length);\r\n for (uint256 i = 0; i < reserveAmounts.length; i++)\r\n reserveAmounts[i] = _formula.liquidateReserveAmount(_totalSupply, reserves[_reserveTokens[i]].balance, reserveRatio, _amount);\r\n return reserveAmounts;\r\n }\r\n\r\n /**\r\n * @dev removes liquidity (reserve) from the pool\r\n *\r\n * @param _reserveTokens address of each reserve token\r\n * @param _reserveMinReturnAmounts minimum return-amount of each reserve token\r\n * @param _totalSupply token total supply\r\n * @param _amount token amount\r\n *\r\n * @return the amount of each reserve token granted for the given amount of pool tokens\r\n */\r\n function removeLiquidityFromPool(IERC20Token[] memory _reserveTokens, uint256[] memory _reserveMinReturnAmounts, uint256 _totalSupply, uint256 _amount)\r\n private\r\n returns (uint256[] memory)\r\n {\r\n syncReserveBalances();\r\n\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n uint256 newPoolTokenSupply = _totalSupply.sub(_amount);\r\n uint256[] memory reserveAmounts = removeLiquidityReserveAmounts(_amount, _reserveTokens, _totalSupply, formula);\r\n\r\n for (uint256 i = 0; i < _reserveTokens.length; i++) {\r\n IERC20Token reserveToken = _reserveTokens[i];\r\n uint256 reserveAmount = reserveAmounts[i];\r\n require(reserveAmount >= _reserveMinReturnAmounts[i], \"ERR_ZERO_TARGET_AMOUNT\");\r\n\r\n uint256 newReserveBalance = reserves[reserveToken].balance.sub(reserveAmount);\r\n reserves[reserveToken].balance = newReserveBalance;\r\n\r\n // transfer each one of the reserve amounts from the pool to the user\r\n if (reserveToken == ETH_RESERVE_ADDRESS)\r\n msg.sender.transfer(reserveAmount);\r\n else\r\n safeTransfer(reserveToken, msg.sender, reserveAmount);\r\n\r\n emit LiquidityRemoved(msg.sender, reserveToken, reserveAmount, newReserveBalance, newPoolTokenSupply);\r\n\r\n // dispatch the `TokenRateUpdate` event for the pool token\r\n dispatchPoolTokenRateUpdateEvent(newPoolTokenSupply, reserveToken, newReserveBalance, reserves[reserveToken].weight);\r\n }\r\n\r\n // return the amount of each reserve token granted for the given amount of pool tokens\r\n return reserveAmounts;\r\n }\r\n\r\n function getMinShare(IBancorFormula formula, uint256 _totalSupply, IERC20Token[] memory _reserveTokens, uint256[] memory _reserveAmounts) private view returns (uint256) {\r\n uint256 minIndex = 0;\r\n for (uint256 i = 1; i < _reserveTokens.length; i++) {\r\n if (_reserveAmounts[i].mul(reserves[_reserveTokens[minIndex]].balance) < _reserveAmounts[minIndex].mul(reserves[_reserveTokens[i]].balance))\r\n minIndex = i;\r\n }\r\n return formula.fundSupplyAmount(_totalSupply, reserves[_reserveTokens[minIndex]].balance, reserveRatio, _reserveAmounts[minIndex]);\r\n }\r\n\r\n /**\r\n * @dev returns the number of decimal digits in a given value\r\n *\r\n * @param _x value (assumed positive)\r\n *\r\n * @return the number of decimal digits in the given value\r\n */\r\n function decimalLength(uint256 _x) public pure returns (uint256) {\r\n uint256 y = 0;\r\n for (uint256 x = _x; x > 0; x /= 10)\r\n y++;\r\n return y;\r\n }\r\n\r\n /**\r\n * @dev returns the nearest integer to a given quotient\r\n *\r\n * @param _n quotient numerator\r\n * @param _d quotient denominator\r\n *\r\n * @return the nearest integer to the given quotient\r\n */\r\n function roundDiv(uint256 _n, uint256 _d) public pure returns (uint256) {\r\n return (_n + _d / 2) / _d;\r\n }\r\n\r\n /**\r\n * @dev returns the average number of decimal digits in a given list of values\r\n *\r\n * @param _values list of values (each of which assumed positive)\r\n *\r\n * @return the average number of decimal digits in the given list of values\r\n */\r\n function geometricMean(uint256[] memory _values) public pure returns (uint256) {\r\n uint256 numOfDigits = 0;\r\n uint256 length = _values.length;\r\n for (uint256 i = 0; i < length; i++)\r\n numOfDigits += decimalLength(_values[i]);\r\n return uint256(10) ** (roundDiv(numOfDigits, length) - 1);\r\n }\r\n\r\n /**\r\n * @dev dispatches token rate update events for the reserve tokens and the pool token\r\n *\r\n * @param _sourceToken address of the source reserve token\r\n * @param _targetToken address of the target reserve token\r\n */\r\n function dispatchTokenRateUpdateEvents(IERC20Token _sourceToken, IERC20Token _targetToken) private {\r\n uint256 poolTokenSupply = ISmartToken(address(anchor)).totalSupply();\r\n uint256 sourceReserveBalance = reserveBalance(_sourceToken);\r\n uint256 targetReserveBalance = reserveBalance(_targetToken);\r\n uint32 sourceReserveWeight = reserves[_sourceToken].weight;\r\n uint32 targetReserveWeight = reserves[_targetToken].weight;\r\n\r\n // dispatch token rate update event for the reserve tokens\r\n uint256 rateN = targetReserveBalance.mul(sourceReserveWeight);\r\n uint256 rateD = sourceReserveBalance.mul(targetReserveWeight);\r\n emit TokenRateUpdate(_sourceToken, _targetToken, rateN, rateD);\r\n\r\n // dispatch token rate update events for the pool token\r\n dispatchPoolTokenRateUpdateEvent(poolTokenSupply, _sourceToken, sourceReserveBalance, sourceReserveWeight);\r\n dispatchPoolTokenRateUpdateEvent(poolTokenSupply, _targetToken, targetReserveBalance, targetReserveWeight);\r\n\r\n // dispatch price data update events (deprecated events)\r\n emit PriceDataUpdate(_sourceToken, poolTokenSupply, sourceReserveBalance, sourceReserveWeight);\r\n emit PriceDataUpdate(_targetToken, poolTokenSupply, targetReserveBalance, targetReserveWeight);\r\n }\r\n\r\n /**\r\n * @dev dispatches token rate update event for the pool token\r\n *\r\n * @param _poolTokenSupply total pool token supply\r\n * @param _reserveToken address of the reserve token\r\n * @param _reserveBalance reserve balance\r\n * @param _reserveWeight reserve weight\r\n */\r\n function dispatchPoolTokenRateUpdateEvent(uint256 _poolTokenSupply, IERC20Token _reserveToken, uint256 _reserveBalance, uint32 _reserveWeight) private {\r\n emit TokenRateUpdate(ISmartToken(address(anchor)), _reserveToken, _reserveBalance.mul(PPM_RESOLUTION), _poolTokenSupply.mul(_reserveWeight));\r\n }\r\n\r\n /**\r\n * @dev returns the current time\r\n * utility to allow overrides for tests\r\n */\r\n function time() internal view virtual returns (uint256) {\r\n return now;\r\n }\r\n\r\n /**\r\n * @dev computes a reduced-scalar ratio\r\n *\r\n * @param _n ratio numerator\r\n * @param _d ratio denominator\r\n * @param _max maximum desired scalar\r\n *\r\n * @return ratio's numerator and denominator\r\n */\r\n function reducedRatio(uint256 _n, uint256 _d, uint256 _max) internal pure returns (uint256, uint256) {\r\n if (_n > _max || _d > _max)\r\n return normalizedRatio(_n, _d, _max);\r\n return (_n, _d);\r\n }\r\n\r\n /**\r\n * @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\".\r\n */\r\n function normalizedRatio(uint256 _a, uint256 _b, uint256 _scale) internal pure returns (uint256, uint256) {\r\n if (_a == _b)\r\n return (_scale / 2, _scale / 2);\r\n if (_a < _b)\r\n return accurateRatio(_a, _b, _scale);\r\n (uint256 y, uint256 x) = accurateRatio(_b, _a, _scale);\r\n return (x, y);\r\n }\r\n\r\n /**\r\n * @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\", assuming that \"a < b\".\r\n */\r\n function accurateRatio(uint256 _a, uint256 _b, uint256 _scale) internal pure returns (uint256, uint256) {\r\n uint256 maxVal = uint256(-1) / _scale;\r\n if (_a > maxVal) {\r\n uint256 c = _a / (maxVal + 1) + 1;\r\n _a /= c;\r\n _b /= c;\r\n }\r\n uint256 x = roundDiv(_a * _scale, _a.add(_b));\r\n uint256 y = _scale - x;\r\n return (x, y);\r\n }\r\n}\r\n",
"sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol",
"ast": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol",
"exportedSymbols": {
"LiquidityPoolV1Converter": [
16593
]
},
"id": 16594,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 14420,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:26"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/LiquidityPoolConverter.sol",
"file": "../../LiquidityPoolConverter.sol",
"id": 14421,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 13078,
"src": "77:42:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "../../../token/interfaces/ISmartToken.sol",
"id": 14422,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 21517,
"src": "121:51:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/Types.sol",
"file": "../../../utility/Types.sol",
"id": 14423,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 22917,
"src": "174:36:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 14425,
"name": "LiquidityPoolConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13077,
"src": "556:22:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolConverter_$13077",
"typeString": "contract LiquidityPoolConverter"
}
},
"id": 14426,
"nodeType": "InheritanceSpecifier",
"src": "556:22:26"
}
],
"contractDependencies": [
10039,
13077,
13340,
22053,
22152,
22576,
22860,
22909,
22995,
23181,
23241
],
"contractKind": "contract",
"documentation": {
"id": 14424,
"nodeType": "StructuredDocumentation",
"src": "214:303:26",
"text": " @dev Liquidity Pool v1 Converter\n The liquidity pool v1 converter is a specialized version of a converter that manages\n a classic bancor liquidity pool.\n Even though pools can have many reserves, the standard pool configuration\n is 2 reserves with 50%/50% weights."
},
"fullyImplemented": true,
"id": 16593,
"linearizedBaseContracts": [
16593,
13077,
10039,
22576,
22053,
22909,
22995,
22152,
22860,
23241,
13340,
23181
],
"name": "LiquidityPoolV1Converter",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 14431,
"mutability": "mutable",
"name": "etherToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "586:89:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
},
"typeName": {
"contractScope": null,
"id": 14427,
"name": "IEtherToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21487,
"src": "586:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307863303832393432314331643236304244336342334530463036636645324435326462326345333135",
"id": 14429,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "632:42:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 14428,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21487,
"src": "620:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21487_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 14430,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "620:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"visibility": "internal"
},
{
"constant": true,
"id": 14434,
"mutability": "constant",
"name": "MAX_RATE_FACTOR_LOWER_BOUND",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "682:60:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14432,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "682:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31653330",
"id": 14433,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "738:4:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000000000000000000000000000_by_1",
"typeString": "int_const 1000000000000000000000000000000"
},
"value": "1e30"
},
"visibility": "internal"
},
{
"constant": true,
"id": 14437,
"mutability": "constant",
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "842:57:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14435,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "842:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3130",
"id": 14436,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "889:10:26",
"subdenomination": "minutes",
"typeDescriptions": {
"typeIdentifier": "t_rational_600_by_1",
"typeString": "int_const 600"
},
"value": "10"
},
"visibility": "private"
},
{
"constant": false,
"functionSelector": "38e9f27a",
"id": 14440,
"mutability": "mutable",
"name": "isStandardPool",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "989:34:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 14438,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "989:4:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 14439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1018:5:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "e2c52468",
"id": 14442,
"mutability": "mutable",
"name": "prevAverageRate",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "1068:31:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14441,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "1068:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "1d4db791",
"id": 14444,
"mutability": "mutable",
"name": "prevAverageRateUpdateTime",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "1206:40:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14443,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1206:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 14445,
"nodeType": "StructuredDocumentation",
"src": "1316:361:26",
"text": " @dev triggered after a conversion with new price data\n deprecated, use `TokenRateUpdate` from version 28 and up\n @param _connectorToken reserve token\n @param _tokenSupply smart token supply\n @param _connectorBalance reserve balance\n @param _connectorWeight reserve weight"
},
"id": 14455,
"name": "PriceDataUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 14454,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14447,
"indexed": true,
"mutability": "mutable",
"name": "_connectorToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1715:35:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14446,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "1715:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14449,
"indexed": false,
"mutability": "mutable",
"name": "_tokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1761:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14448,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1761:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14451,
"indexed": false,
"mutability": "mutable",
"name": "_connectorBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1792:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14450,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1792:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14453,
"indexed": false,
"mutability": "mutable",
"name": "_connectorWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1828:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14452,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1828:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1704:154:26"
},
"src": "1683:176:26"
},
{
"body": {
"id": 14470,
"nodeType": "Block",
"src": "2402:8:26",
"statements": []
},
"documentation": {
"id": 14456,
"nodeType": "StructuredDocumentation",
"src": "1867:317:26",
"text": " @dev initializes a new LiquidityPoolV1Converter instance\n @param _token pool token governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 14471,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 14465,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14458,
"src": "2343:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14466,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14460,
"src": "2351:9:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
}
},
{
"argumentTypes": null,
"id": 14467,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14462,
"src": "2362:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 14468,
"modifierName": {
"argumentTypes": null,
"id": 14464,
"name": "LiquidityPoolConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13077,
"src": "2320:22:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_LiquidityPoolConverter_$13077_$",
"typeString": "type(contract LiquidityPoolConverter)"
}
},
"nodeType": "ModifierInvocation",
"src": "2320:60:26"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14463,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14458,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2212:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
},
"typeName": {
"contractScope": null,
"id": 14457,
"name": "ISmartToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21516,
"src": "2212:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14460,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2241:27:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 14459,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 23165,
"src": "2241:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14462,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2279:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14461,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2279:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2201:109:26"
},
"returnParameters": {
"id": 14469,
"nodeType": "ParameterList",
"parameters": [],
"src": "2402:0:26"
},
"scope": 16593,
"src": "2190:220:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9242
],
"body": {
"id": 14480,
"nodeType": "Block",
"src": "2618:27:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14478,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2636:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"functionReturnParameters": 14477,
"id": 14479,
"nodeType": "Return",
"src": "2629:8:26"
}
]
},
"documentation": {
"id": 14472,
"nodeType": "StructuredDocumentation",
"src": "2418:131:26",
"text": " @dev returns the converter type\n @return see the converter types in the the main contract doc"
},
"functionSelector": "3e8ff43f",
"id": 14481,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14474,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2592:8:26"
},
"parameters": {
"id": 14473,
"nodeType": "ParameterList",
"parameters": [],
"src": "2577:2:26"
},
"returnParameters": {
"id": 14477,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14476,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14481,
"src": "2610:6:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 14475,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "2610:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2609:8:26"
},
"scope": 16593,
"src": "2555:90:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13076
],
"body": {
"id": 14500,
"nodeType": "Block",
"src": "2977:107:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 14488,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "2988:5:26",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidityPoolV1Converter_$16593",
"typeString": "contract super LiquidityPoolV1Converter"
}
},
"id": 14490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptAnchorOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 13076,
"src": "2988:27:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 14491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2988:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14492,
"nodeType": "ExpressionStatement",
"src": "2988:29:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14494,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [
14481
],
"referencedDeclaration": 14481,
"src": "3046:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 14495,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3046:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 14496,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3063:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 14497,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3071:4:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14493,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "3035:10:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 14498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3035:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14499,
"nodeType": "EmitStatement",
"src": "3030:46:26"
}
]
},
"documentation": {
"id": 14482,
"nodeType": "StructuredDocumentation",
"src": "2653:259:26",
"text": " @dev accepts ownership of the anchor after an ownership transfer\n also activates the converter\n can only be called by the contract owner\n note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"functionSelector": "cdc91c69",
"id": 14501,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14486,
"modifierName": {
"argumentTypes": null,
"id": 14485,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22088,
"src": "2967:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2967:9:26"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14484,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2958:8:26"
},
"parameters": {
"id": 14483,
"nodeType": "ParameterList",
"parameters": [],
"src": "2948:2:26"
},
"returnParameters": {
"id": 14487,
"nodeType": "ParameterList",
"parameters": [],
"src": "2977:0:26"
},
"scope": 16593,
"src": "2918:166:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9664
],
"body": {
"id": 14544,
"nodeType": "Block",
"src": "3458:240:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14515,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14504,
"src": "3486:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14516,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14506,
"src": "3494:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 14512,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "3469:5:26",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidityPoolV1Converter_$16593",
"typeString": "contract super LiquidityPoolV1Converter"
}
},
"id": 14514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "addReserve",
"nodeType": "MemberAccess",
"referencedDeclaration": 9664,
"src": "3469:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint32)"
}
},
"id": 14517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3469:33:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14518,
"nodeType": "ExpressionStatement",
"src": "3469:33:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14519,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "3515:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14532,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14520,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3545:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3545:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 14522,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3569:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "3545:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 14531,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14524,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3587:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14528,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14525,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3596:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14527,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3610:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3596:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3587:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14529,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "3587:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "353030303030",
"id": 14530,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3624:6:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_500000_by_1",
"typeString": "int_const 500000"
},
"value": "500000"
},
"src": "3587:43:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3545:85:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 14540,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14533,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3647:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14537,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14534,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3656:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14536,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14535,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3670:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3656:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3647:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14538,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "3647:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "353030303030",
"id": 14539,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3684:6:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_500000_by_1",
"typeString": "int_const 500000"
},
"value": "500000"
},
"src": "3647:43:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3545:145:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3515:175:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 14543,
"nodeType": "ExpressionStatement",
"src": "3515:175:26"
}
]
},
"documentation": {
"id": 14502,
"nodeType": "StructuredDocumentation",
"src": "3092:278:26",
"text": " @dev defines a new reserve token for the converter\n can only be called by the owner while the converter is inactive\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 14545,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14510,
"modifierName": {
"argumentTypes": null,
"id": 14509,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22088,
"src": "3448:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3448:9:26"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14508,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3439:8:26"
},
"parameters": {
"id": 14507,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14504,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14545,
"src": "3396:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14503,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "3396:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14506,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14545,
"src": "3416:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14505,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3416:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3395:36:26"
},
"returnParameters": {
"id": 14511,
"nodeType": "ParameterList",
"parameters": [],
"src": "3458:0:26"
},
"scope": 16593,
"src": "3376:322:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9256
],
"body": {
"id": 14612,
"nodeType": "Block",
"src": "4407:574:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14571,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14569,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4453:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 14570,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4469:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "4453:28:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f53414d455f534f555243455f544152474554",
"id": 14572,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4483:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
},
"value": "ERR_SAME_SOURCE_TARGET"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
}
],
"id": 14568,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "4445:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4445:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14574,
"nodeType": "ExpressionStatement",
"src": "4445:63:26"
},
{
"assignments": [
14576
],
"declarations": [
{
"constant": false,
"id": 14576,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14612,
"src": "4521:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14575,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4521:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14599,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14584,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4634:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14583,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4619:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4619:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14586,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4662:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14588,
"indexExpression": {
"argumentTypes": null,
"id": 14587,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4671:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4662:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14589,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4662:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14591,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4721:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14590,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4706:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14592,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4706:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14593,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4749:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14595,
"indexExpression": {
"argumentTypes": null,
"id": 14594,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4758:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4749:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14596,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4749:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14597,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14552,
"src": "4793:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14579,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "4563:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14578,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "4553:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14580,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4553:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14577,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "4538:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14581,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4538:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14582,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "crossReserveTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13120,
"src": "4538:66:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint32_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint32,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 14598,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4538:273:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4521:290:26"
},
{
"assignments": [
14601
],
"declarations": [
{
"constant": false,
"id": 14601,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14612,
"src": "4902:11:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14600,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4902:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14605,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14603,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14576,
"src": "4929:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14602,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "4916:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4916:20:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4902:34:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14608,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14606,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14576,
"src": "4955:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14607,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14601,
"src": "4964:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4955:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14609,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14601,
"src": "4969:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14610,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "4954:19:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14567,
"id": 14611,
"nodeType": "Return",
"src": "4947:26:26"
}
]
},
"documentation": {
"id": 14546,
"nodeType": "StructuredDocumentation",
"src": "3706:421:26",
"text": " @dev returns the expected target amount of converting one reserve to another along with the fee\n @param _sourceToken contract address of the source reserve token\n @param _targetToken contract address of the target reserve token\n @param _amount amount of tokens received from the user\n @return expected target amount\n @return expected fee"
},
"functionSelector": "af94b8d8",
"id": 14613,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14556,
"modifierName": {
"argumentTypes": null,
"id": 14555,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "4287:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4287:6:26"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 14558,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4316:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"id": 14559,
"modifierName": {
"argumentTypes": null,
"id": 14557,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "4303:12:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21461_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "4303:26:26"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 14561,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4352:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"id": 14562,
"modifierName": {
"argumentTypes": null,
"id": 14560,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "4339:12:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21461_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "4339:26:26"
}
],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14554,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "4269:8:26"
},
"parameters": {
"id": 14553,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14548,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4161:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14547,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "4161:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14550,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4187:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14549,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "4187:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14552,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4213:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14551,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4213:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4160:69:26"
},
"returnParameters": {
"id": 14567,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14564,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4384:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14563,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14566,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4393:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14565,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4393:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4383:18:26"
},
"scope": 16593,
"src": "4133:848:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9789
],
"body": {
"id": 14757,
"nodeType": "Block",
"src": "5767:1649:26",
"statements": [
{
"assignments": [
14631,
14633
],
"declarations": [
{
"constant": false,
"id": 14631,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14757,
"src": "5826:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14630,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5826:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14633,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14757,
"src": "5842:11:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14632,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5842:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14639,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14635,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "5876:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14636,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "5890:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14637,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "5904:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14634,
"name": "targetAmountAndFee",
"nodeType": "Identifier",
"overloadedDeclarations": [
14613
],
"referencedDeclaration": 14613,
"src": "5857:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 14638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5857:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5825:87:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14643,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14641,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "5993:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14642,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6003:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5993:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14644,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6006:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 14640,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "5985:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5985:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14646,
"nodeType": "ExpressionStatement",
"src": "5985:46:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14652,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14648,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6119:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14650,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6143:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14649,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6128:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6128:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6119:37:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14647,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "6112:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 14653,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6112:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14654,
"nodeType": "ExpressionStatement",
"src": "6112:45:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14655,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6237:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14656,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "6253:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "6237:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14685,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14670,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14667,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "6380:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14668,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6380:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14669,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6393:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "6380:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14684,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14680,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6455:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14679,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6440:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14681,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6440:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14675,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "6429:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 14674,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6421:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14673,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6421:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6421:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 14671,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6398:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 14672,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21422,
"src": "6398:22:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14677,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6398:37:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14678,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "6398:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14682,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6398:71:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14683,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "6473:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6398:82:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6380:100:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14686,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6482:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 14666,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6372:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14687,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6372:131:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14688,
"nodeType": "ExpressionStatement",
"src": "6372:131:26"
},
"id": 14689,
"nodeType": "IfStatement",
"src": "6233:270:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14662,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14659,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "6295:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14660,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6295:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14661,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "6308:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6295:20:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14663,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6317:25:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
},
"value": "ERR_ETH_AMOUNT_MISMATCH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
}
],
"id": 14658,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6287:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14664,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6287:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14665,
"nodeType": "ExpressionStatement",
"src": "6287:56:26"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14691,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6573:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14690,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "6554:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 14692,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6554:32:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14693,
"nodeType": "ExpressionStatement",
"src": "6554:32:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14694,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6597:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14696,
"indexExpression": {
"argumentTypes": null,
"id": 14695,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6606:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6597:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14697,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "6597:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14703,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6665:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14698,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6630:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14700,
"indexExpression": {
"argumentTypes": null,
"id": 14699,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6639:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6630:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14701,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "6630:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14702,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "6630:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6630:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6597:75:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14706,
"nodeType": "ExpressionStatement",
"src": "6597:75:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14707,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6759:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14708,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "6775:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "6759:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14717,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6880:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14718,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14624,
"src": "6894:12:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14719,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6908:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14716,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22809,
"src": "6867:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 14720,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6867:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14721,
"nodeType": "ExpressionStatement",
"src": "6867:48:26"
},
"id": 14722,
"nodeType": "IfStatement",
"src": "6755:160:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14713,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6831:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14710,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14624,
"src": "6809:12:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 14712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6809:21:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 14714,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6809:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14715,
"nodeType": "ExpressionStatement",
"src": "6809:29:26"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14728,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14723,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "6975:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14727,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14724,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "6993:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14725,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "7021:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14726,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7021:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6993:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6975:52:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14740,
"nodeType": "IfStatement",
"src": "6971:171:26",
"trueBody": {
"id": 14739,
"nodeType": "Block",
"src": "7029:113:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 14732,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14729,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "7044:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14730,
"name": "recentAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14908,
"src": "7062:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_struct$_Fraction_$22916_memory_ptr_$",
"typeString": "function () view returns (struct Fraction memory)"
}
},
"id": 14731,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7062:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"src": "7044:37:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"id": 14733,
"nodeType": "ExpressionStatement",
"src": "7044:37:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14737,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14734,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "7096:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14735,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "7124:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14736,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7124:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7096:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14738,
"nodeType": "ExpressionStatement",
"src": "7096:34:26"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14742,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "7220:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14743,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "7234:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14744,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14622,
"src": "7248:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14745,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "7257:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14746,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "7266:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14747,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14633,
"src": "7274:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14741,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "7196:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7196:82:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14749,
"nodeType": "ExpressionStatement",
"src": "7196:82:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14751,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "7355:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14752,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "7369:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14750,
"name": "dispatchTokenRateUpdateEvents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16397,
"src": "7325:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token)"
}
},
"id": 14753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7325:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14754,
"nodeType": "ExpressionStatement",
"src": "7325:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14755,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "7402:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14629,
"id": 14756,
"nodeType": "Return",
"src": "7395:13:26"
}
]
},
"documentation": {
"id": 14614,
"nodeType": "StructuredDocumentation",
"src": "4989:569:26",
"text": " @dev converts a specific amount of source tokens to target tokens\n can only be called by the bancor network contract\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"id": 14758,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14626,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "5726:8:26"
},
"parameters": {
"id": 14625,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14616,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5583:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14615,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "5583:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14618,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5609:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14617,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "5609:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14620,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5635:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14619,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5635:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14622,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5652:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14621,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5652:7:26",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14624,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5669:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 14623,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5669:15:26",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5582:116:26"
},
"returnParameters": {
"id": 14629,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14628,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5753:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14627,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5753:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5752:9:26"
},
"scope": 16593,
"src": "5564:1852:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14797,
"nodeType": "Block",
"src": "7904:348:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14769,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "7968:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f4e5f5354414e444152445f504f4f4c",
"id": 14770,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7984:23:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_bc9141faf76a54775cecd0a0d87b229f48265d7ddb667bb1d0e384e600638f7c",
"typeString": "literal_string \"ERR_NON_STANDARD_POOL\""
},
"value": "ERR_NON_STANDARD_POOL"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_bc9141faf76a54775cecd0a0d87b229f48265d7ddb667bb1d0e384e600638f7c",
"typeString": "literal_string \"ERR_NON_STANDARD_POOL\""
}
],
"id": 14768,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7960:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14771,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7960:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14772,
"nodeType": "ExpressionStatement",
"src": "7960:48:26"
},
{
"assignments": [
14774
],
"declarations": [
{
"constant": false,
"id": 14774,
"mutability": "mutable",
"name": "rate",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14797,
"src": "8074:20:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14773,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "8074:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14777,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14775,
"name": "recentAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14908,
"src": "8097:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_struct$_Fraction_$22916_memory_ptr_$",
"typeString": "function () view returns (struct Fraction memory)"
}
},
"id": 14776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8097:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8074:42:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14778,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14761,
"src": "8131:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14779,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8141:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14781,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14780,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8155:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8141:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "8131:26:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14790,
"nodeType": "IfStatement",
"src": "8127:82:26",
"trueBody": {
"id": 14789,
"nodeType": "Block",
"src": "8159:50:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14783,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8182:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14784,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "8182:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14785,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8190:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14786,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "8190:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14787,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8181:16:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14767,
"id": 14788,
"nodeType": "Return",
"src": "8174:23:26"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14791,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8229:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14792,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "8229:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14793,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8237:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14794,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "8237:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14795,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8228:16:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14767,
"id": 14796,
"nodeType": "Return",
"src": "8221:23:26"
}
]
},
"documentation": {
"id": 14759,
"nodeType": "StructuredDocumentation",
"src": "7424:386:26",
"text": " @dev returns the recent average rate of 1 `_token` in the other reserve token units\n note that the rate can only be queried for reserves in a standard pool\n @param _token token to get the rate for\n @return recent average rate between the reserves (numerator)\n @return recent average rate between the reserves (denominator)"
},
"functionSelector": "1f0181bc",
"id": 14798,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "recentAverageRate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14762,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14761,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7843:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14760,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "7843:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7842:20:26"
},
"returnParameters": {
"id": 14767,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14764,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7886:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14763,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7886:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14766,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7895:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14765,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7895:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7885:18:26"
},
"scope": 16593,
"src": "7816:436:26",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": {
"id": 14907,
"nodeType": "Block",
"src": "8505:1634:26",
"statements": [
{
"assignments": [
14805
],
"declarations": [
{
"constant": false,
"id": 14805,
"mutability": "mutable",
"name": "timeElapsed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8596:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8596:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14810,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14806,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "8618:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14807,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8618:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14808,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "8627:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8618:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8596:56:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14811,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "8757:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14812,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8772:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8757:16:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14817,
"nodeType": "IfStatement",
"src": "8753:71:26",
"trueBody": {
"id": 14816,
"nodeType": "Block",
"src": "8775:49:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 14814,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "8797:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"functionReturnParameters": 14803,
"id": 14815,
"nodeType": "Return",
"src": "8790:22:26"
}
]
}
},
{
"assignments": [
14819
],
"declarations": [
{
"constant": false,
"id": 14819,
"mutability": "mutable",
"name": "currentRateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8890:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14818,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8890:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14826,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14820,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8913:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14824,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14821,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8922:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14823,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8936:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8922:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8913:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14825,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "8913:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8890:57:26"
},
{
"assignments": [
14828
],
"declarations": [
{
"constant": false,
"id": 14828,
"mutability": "mutable",
"name": "currentRateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8958:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14827,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8958:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14835,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14829,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8981:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14833,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14830,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8990:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14832,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14831,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9004:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8990:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8981:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14834,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "8981:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8958:57:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14836,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9147:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14837,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9162:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9147:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14845,
"nodeType": "IfStatement",
"src": "9143:120:26",
"trueBody": {
"id": 14844,
"nodeType": "Block",
"src": "9183:80:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14840,
"name": "currentRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14819,
"src": "9219:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14841,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9236:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14839,
"name": "Fraction",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22916,
"src": "9205:8:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Fraction_$22916_storage_ptr_$",
"typeString": "type(struct Fraction storage pointer)"
}
},
"id": 14842,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"n",
"d"
],
"nodeType": "FunctionCall",
"src": "9205:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"functionReturnParameters": 14803,
"id": 14843,
"nodeType": "Return",
"src": "9198:53:26"
}
]
}
},
{
"assignments": [
14847
],
"declarations": [
{
"constant": false,
"id": 14847,
"mutability": "mutable",
"name": "prevAverage",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9546:27:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14846,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "9546:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14849,
"initialValue": {
"argumentTypes": null,
"id": 14848,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "9576:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9546:45:26"
},
{
"assignments": [
14851
],
"declarations": [
{
"constant": false,
"id": 14851,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9604:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14850,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9604:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14857,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14855,
"name": "currentRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14819,
"src": "9634:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14852,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9616:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14853,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "9616:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14854,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9616:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14856,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9616:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9604:43:26"
},
{
"assignments": [
14859
],
"declarations": [
{
"constant": false,
"id": 14859,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9658:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14858,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9658:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14865,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14863,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9688:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14860,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9670:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14861,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "9670:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14862,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9670:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14864,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9670:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9658:43:26"
},
{
"assignments": [
14867
],
"declarations": [
{
"constant": false,
"id": 14867,
"mutability": "mutable",
"name": "newRateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9809:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14866,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9809:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14880,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14877,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9879:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14875,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14851,
"src": "9873:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14876,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9873:5:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14878,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9873:18:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14872,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14870,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9834:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14871,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9856:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9834:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14868,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14859,
"src": "9828:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14869,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9828:5:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14873,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9828:40:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "9828:44:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14879,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9828:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9809:83:26"
},
{
"assignments": [
14882
],
"declarations": [
{
"constant": false,
"id": 14882,
"mutability": "mutable",
"name": "newRateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9903:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14881,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9903:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14891,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14889,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9958:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14886,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9940:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14883,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9922:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14884,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "9922:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9922:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14887,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9922:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14888,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9922:35:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14890,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9922:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9903:75:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 14892,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "9992:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14893,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10002:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14894,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "9991:20:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14896,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "10027:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14897,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10037:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14898,
"name": "MAX_RATE_FACTOR_LOWER_BOUND",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14434,
"src": "10047:27:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14895,
"name": "reducedRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16470,
"src": "10014:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 14899,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10014:61:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"src": "9991:84:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14901,
"nodeType": "ExpressionStatement",
"src": "9991:84:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14903,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "10107:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14904,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10120:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14902,
"name": "Fraction",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22916,
"src": "10093:8:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Fraction_$22916_storage_ptr_$",
"typeString": "type(struct Fraction storage pointer)"
}
},
"id": 14905,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"n",
"d"
],
"nodeType": "FunctionCall",
"src": "10093:38:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"functionReturnParameters": 14803,
"id": 14906,
"nodeType": "Return",
"src": "10086:45:26"
}
]
},
"documentation": {
"id": 14799,
"nodeType": "StructuredDocumentation",
"src": "8260:170:26",
"text": " @dev returns the recent average rate of 1 reserve token 0 in reserve token 1 units\n @return recent average rate between the reserves"
},
"id": 14908,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "recentAverageRate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14800,
"nodeType": "ParameterList",
"parameters": [],
"src": "8462:2:26"
},
"returnParameters": {
"id": 14803,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14802,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14908,
"src": "8488:15:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14801,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "8488:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8487:17:26"
},
"scope": 16593,
"src": "8436:1703:26",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 15014,
"nodeType": "Block",
"src": "10789:1325:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14927,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "10855:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 14928,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "10871:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 14929,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14917,
"src": "10888:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14926,
"name": "verifyLiquidityInput",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15634,
"src": "10834:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) view"
}
},
"id": 14930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10834:65:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14931,
"nodeType": "ExpressionStatement",
"src": "10834:65:26"
},
{
"body": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14947,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14943,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11100:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 14945,
"indexExpression": {
"argumentTypes": null,
"id": 14944,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11115:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11100:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14946,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "11121:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "11100:40:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14958,
"nodeType": "IfStatement",
"src": "11096:130:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14954,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14949,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "11167:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 14951,
"indexExpression": {
"argumentTypes": null,
"id": 14950,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11183:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11167:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14952,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "11189:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11189:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11167:31:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14955,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11200:25:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
},
"value": "ERR_ETH_AMOUNT_MISMATCH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
}
],
"id": 14948,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11159:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11159:67:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14957,
"nodeType": "ExpressionStatement",
"src": "11159:67:26"
}
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14939,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14936,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11051:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14937,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11055:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 14938,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11055:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11051:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 14959,
"initializationExpression": {
"assignments": [
14933
],
"declarations": [
{
"constant": false,
"id": 14933,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14959,
"src": "11036:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14932,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11036:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14935,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 14934,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11048:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "11036:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 14941,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "11078:3:26",
"subExpression": {
"argumentTypes": null,
"id": 14940,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11078:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14942,
"nodeType": "ExpressionStatement",
"src": "11078:3:26"
},
"nodeType": "ForStatement",
"src": "11031:195:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14960,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "11346:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11346:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14962,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11358:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "11346:13:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14973,
"nodeType": "IfStatement",
"src": "11342:112:26",
"trueBody": {
"id": 14972,
"nodeType": "Block",
"src": "11361:93:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14965,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "11384:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14967,
"indexExpression": {
"argumentTypes": null,
"id": 14966,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "11393:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11384:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14968,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "11384:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f5f4554485f52455345525645",
"id": 14969,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11421:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_467f328539cc1e1b7e8c0e459b4245a158bd2d844c358525ec924cd65d4df604",
"typeString": "literal_string \"ERR_NO_ETH_RESERVE\""
},
"value": "ERR_NO_ETH_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_467f328539cc1e1b7e8c0e459b4245a158bd2d844c358525ec924cd65d4df604",
"typeString": "literal_string \"ERR_NO_ETH_RESERVE\""
}
],
"id": 14964,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11376:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14970,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11376:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14971,
"nodeType": "ExpressionStatement",
"src": "11376:66:26"
}
]
}
},
{
"assignments": [
14975
],
"declarations": [
{
"constant": false,
"id": 14975,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15014,
"src": "11499:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14974,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11499:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14984,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14979,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11541:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14978,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "11533:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14977,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11533:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11533:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14976,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "11521:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14981,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11521:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 14982,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "11521:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14983,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11521:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11499:64:26"
},
{
"assignments": [
14986
],
"declarations": [
{
"constant": false,
"id": 14986,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15014,
"src": "11669:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14985,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11669:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14992,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14988,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11705:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 14989,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "11721:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 14990,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14975,
"src": "11738:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14987,
"name": "addLiquidityToPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15664,
"src": "11686:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) returns (uint256)"
}
},
"id": 14991,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11686:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11669:81:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14996,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14994,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "11877:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14995,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14917,
"src": "11887:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11877:20:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f52455455524e5f544f4f5f4c4f57",
"id": 14997,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11899:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
},
"value": "ERR_RETURN_TOO_LOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
}
],
"id": 14993,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11869:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14998,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11869:51:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14999,
"nodeType": "ExpressionStatement",
"src": "11869:51:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15007,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "12009:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15008,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "12009:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15009,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "12021:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15003,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11994:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15002,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "11986:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15001,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11986:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11986:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15000,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "11974:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15005,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11974:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15006,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21508,
"src": "11974:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15010,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11974:54:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15011,
"nodeType": "ExpressionStatement",
"src": "11974:54:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15012,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "12100:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14925,
"id": 15013,
"nodeType": "Return",
"src": "12093:13:26"
}
]
},
"documentation": {
"id": 14909,
"nodeType": "StructuredDocumentation",
"src": "10147:423:26",
"text": " @dev increases the pool's liquidity and mints new shares in the pool to the caller\n note that prior to version 28, you should use 'fund' instead\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _minReturn token minimum return-amount\n @return amount of pool tokens issued"
},
"functionSelector": "7d8916bd",
"id": 15015,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14920,
"modifierName": {
"argumentTypes": null,
"id": 14919,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "10731:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10731:9:26"
},
{
"arguments": null,
"id": 14922,
"modifierName": {
"argumentTypes": null,
"id": 14921,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "10750:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10750:6:26"
}
],
"name": "addLiquidity",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14918,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14912,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10598:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 14910,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "10598:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 14911,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10598:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14915,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10635:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 14913,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10635:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14914,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10635:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14917,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10669:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14916,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10669:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10597:91:26"
},
"returnParameters": {
"id": 14925,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14924,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10775:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14923,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10775:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10774:9:26"
},
"scope": 16593,
"src": "10576:1538:26",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15070,
"nodeType": "Block",
"src": "12837:569:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15035,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15021,
"src": "12903:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15036,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15024,
"src": "12919:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15037,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "12945:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15034,
"name": "verifyLiquidityInput",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15634,
"src": "12882:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) view"
}
},
"id": 15038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12882:71:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15039,
"nodeType": "ExpressionStatement",
"src": "12882:71:26"
},
{
"assignments": [
15041
],
"declarations": [
{
"constant": false,
"id": 15041,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15070,
"src": "13033:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15040,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13033:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15050,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15045,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "13075:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15044,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "13067:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15043,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13067:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15046,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13067:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15042,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "13055:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15047,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13055:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15048,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "13055:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15049,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13055:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13033:64:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15058,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "13183:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15059,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "13183:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15060,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "13195:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15054,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "13166:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15053,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "13158:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15052,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13158:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15055,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13158:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15051,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "13146:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13146:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15057,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21515,
"src": "13146:36:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13146:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15062,
"nodeType": "ExpressionStatement",
"src": "13146:57:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15064,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15021,
"src": "13335:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15065,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15024,
"src": "13351:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15066,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15041,
"src": "13377:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15067,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "13390:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15063,
"name": "removeLiquidityFromPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16125,
"src": "13311:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256,uint256) returns (uint256[] memory)"
}
},
"id": 15068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13311:87:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15033,
"id": 15069,
"nodeType": "Return",
"src": "13304:94:26"
}
]
},
"documentation": {
"id": 15016,
"nodeType": "StructuredDocumentation",
"src": "12122:495:26",
"text": " @dev decreases the pool's liquidity and burns the caller's shares in the pool\n note that prior to version 28, you should use 'liquidate' instead\n @param _amount token amount\n @param _reserveTokens address of each reserve token\n @param _reserveMinReturnAmounts minimum return-amount of each reserve token\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"functionSelector": "b127c0a5",
"id": 15071,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15027,
"modifierName": {
"argumentTypes": null,
"id": 15026,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "12770:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12770:9:26"
},
{
"arguments": null,
"id": 15029,
"modifierName": {
"argumentTypes": null,
"id": 15028,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "12789:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12789:6:26"
}
],
"name": "removeLiquidity",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15025,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15018,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12648:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15017,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12648:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15021,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12665:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15019,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "12665:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15020,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12665:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15024,
"mutability": "mutable",
"name": "_reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12702:41:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15022,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12702:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15023,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12702:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12647:97:26"
},
"returnParameters": {
"id": 15033,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15032,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12814:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15030,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12814:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15031,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12814:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12813:18:26"
},
"scope": 16593,
"src": "12623:783:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15276,
"nodeType": "Block",
"src": "14008:2368:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 15081,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "14019:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 15082,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14019:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15083,
"nodeType": "ExpressionStatement",
"src": "14019:21:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15096,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15084,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14051:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15086,
"indexExpression": {
"argumentTypes": null,
"id": 15085,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14060:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14051:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15087,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14051:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15093,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "14133:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15094,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14133:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15088,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14091:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15090,
"indexExpression": {
"argumentTypes": null,
"id": 15089,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14100:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14091:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15091,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14091:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "14091:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15095,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14091:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14051:92:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15097,
"nodeType": "ExpressionStatement",
"src": "14051:92:26"
},
{
"assignments": [
15099
],
"declarations": [
{
"constant": false,
"id": 15099,
"mutability": "mutable",
"name": "supply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14156:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15098,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14156:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15108,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15103,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "14193:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15102,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14185:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15101,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14185:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14185:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15100,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "14173:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15105,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14173:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "14173:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15107,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14173:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14156:59:26"
},
{
"assignments": [
15110
],
"declarations": [
{
"constant": false,
"id": 15110,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14226:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15109,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "14226:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15116,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15113,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "14276:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15112,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "14266:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14266:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15111,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "14251:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15115,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14251:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14226:66:26"
},
{
"assignments": [
15118
],
"declarations": [
{
"constant": false,
"id": 15118,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14496:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15117,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14496:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15121,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15119,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14519:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14519:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14496:43:26"
},
{
"body": {
"id": 15260,
"nodeType": "Block",
"src": "14593:1569:26",
"statements": [
{
"assignments": [
15133
],
"declarations": [
{
"constant": false,
"id": 15133,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14608:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15132,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "14608:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15137,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15134,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14635:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15136,
"indexExpression": {
"argumentTypes": null,
"id": 15135,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14649:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14635:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14608:43:26"
},
{
"assignments": [
15139
],
"declarations": [
{
"constant": false,
"id": 15139,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14666:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15138,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14666:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15144,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15140,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14687:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15142,
"indexExpression": {
"argumentTypes": null,
"id": 15141,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "14696:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14687:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15143,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14687:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14666:51:26"
},
{
"assignments": [
15146
],
"declarations": [
{
"constant": false,
"id": 15146,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14732:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15145,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14732:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15154,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15149,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15099,
"src": "14773:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15150,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15139,
"src": "14781:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15151,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "14793:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15152,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "14807:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15147,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15110,
"src": "14756:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "14756:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14756:59:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14732:83:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15155,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "14904:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 15156,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14920:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "14904:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 15218,
"nodeType": "Block",
"src": "15409:107:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15208,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15445:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15209,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15459:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15459:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15213,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "15479:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15212,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15471:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15211,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15471:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15214,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15471:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15215,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15486:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15207,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "15428:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15216,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15428:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15217,
"nodeType": "ExpressionStatement",
"src": "15428:72:26"
}
]
},
"id": 15219,
"nodeType": "IfStatement",
"src": "14900:616:26",
"trueBody": {
"id": 15206,
"nodeType": "Block",
"src": "14941:449:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15161,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15158,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "14964:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14964:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 15160,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "14976:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14964:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15174,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15107:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15175,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15107:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15176,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15119:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15107:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15204,
"nodeType": "IfStatement",
"src": "15103:272:26",
"trueBody": {
"id": 15203,
"nodeType": "Block",
"src": "15134:241:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15182,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15179,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15165:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15165:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15181,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15178:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "15165:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f4554485f56414c5545",
"id": 15183,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15181:23:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e220b3a28f19681b7484bf734e3fcd080dc85319844b89942d75a3bc56505e89",
"typeString": "literal_string \"ERR_INVALID_ETH_VALUE\""
},
"value": "ERR_INVALID_ETH_VALUE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e220b3a28f19681b7484bf734e3fcd080dc85319844b89942d75a3bc56505e89",
"typeString": "literal_string \"ERR_INVALID_ETH_VALUE\""
}
],
"id": 15178,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15157:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15157:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15185,
"nodeType": "ExpressionStatement",
"src": "15157:48:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15187,
"name": "etherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14431,
"src": "15245:10:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15188,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15257:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15257:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15192,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "15277:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15191,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15269:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15190,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15269:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15193,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15269:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15194,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15284:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15186,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "15228:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15228:70:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15196,
"nodeType": "ExpressionStatement",
"src": "15228:70:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15200,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15341:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15197,
"name": "etherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14431,
"src": "15321:10:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"id": 15199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdraw",
"nodeType": "MemberAccess",
"referencedDeclaration": 21474,
"src": "15321:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 15201,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15321:34:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15202,
"nodeType": "ExpressionStatement",
"src": "15321:34:26"
}
]
}
},
"id": 15205,
"nodeType": "IfStatement",
"src": "14960:415:26",
"trueBody": {
"id": 15173,
"nodeType": "Block",
"src": "14991:89:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15170,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15167,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15034:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15034:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 15169,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15046:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15034:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15162,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15014:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15014:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 15166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15014:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 15171,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15014:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15172,
"nodeType": "ExpressionStatement",
"src": "15014:46:26"
}
]
}
}
]
}
},
{
"assignments": [
15221
],
"declarations": [
{
"constant": false,
"id": 15221,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "15573:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15220,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15573:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15226,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15224,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15616:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15222,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15139,
"src": "15601:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15223,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "15601:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15601:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15573:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15232,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15227,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15645:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15229,
"indexExpression": {
"argumentTypes": null,
"id": 15228,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15654:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15645:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15230,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "15645:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15231,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "15678:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15645:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15233,
"nodeType": "ExpressionStatement",
"src": "15645:50:26"
},
{
"assignments": [
15235
],
"declarations": [
{
"constant": false,
"id": 15235,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "15712:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15234,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15712:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15240,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15238,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "15752:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15236,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15099,
"src": "15741:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15237,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "15741:10:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15239,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15741:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15712:48:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15242,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15866:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15866:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15244,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15878:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15245,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15892:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15246,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "15907:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15247,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15235,
"src": "15926:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15241,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "15851:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15851:94:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15249,
"nodeType": "EmitStatement",
"src": "15846:99:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15251,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15235,
"src": "16067:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15252,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "16087:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15253,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "16101:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15254,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16120:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15256,
"indexExpression": {
"argumentTypes": null,
"id": 15255,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "16129:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16120:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15257,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "16120:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15250,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "16034:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15258,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16034:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15259,
"nodeType": "ExpressionStatement",
"src": "16034:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15128,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15126,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14570:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15127,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15118,
"src": "14574:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14570:16:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15261,
"initializationExpression": {
"assignments": [
15123
],
"declarations": [
{
"constant": false,
"id": 15123,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15261,
"src": "14555:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15122,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14555:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15125,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15124,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14567:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "14555:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "14588:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15129,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14588:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15131,
"nodeType": "ExpressionStatement",
"src": "14588:3:26"
},
"nodeType": "ForStatement",
"src": "14550:1612:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15269,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "16269:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15270,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16269:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15271,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "16281:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15265,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "16254:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15264,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "16246:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15263,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "16246:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16246:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15262,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "16234:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16234:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15268,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21508,
"src": "16234:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15272,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16234:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15273,
"nodeType": "ExpressionStatement",
"src": "16234:55:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15274,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "16361:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15080,
"id": 15275,
"nodeType": "Return",
"src": "16354:14:26"
}
]
},
"documentation": {
"id": 15072,
"nodeType": "StructuredDocumentation",
"src": "13414:473:26",
"text": " @dev increases the pool's liquidity and mints new shares in the pool to the caller\n for example, if the caller increases the supply by 10%,\n then it will cost an amount equal to 10% of each reserve token balance\n note that starting from version 28, you should use 'addLiquidity' instead\n @param _amount amount to increase the supply by (in the pool token)\n @return amount of pool tokens issued"
},
"functionSelector": "ca1d209d",
"id": 15277,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15077,
"modifierName": {
"argumentTypes": null,
"id": 15076,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "13966:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13966:9:26"
}
],
"name": "fund",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15075,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15074,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15277,
"src": "13907:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15073,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13907:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13906:17:26"
},
"returnParameters": {
"id": 15080,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15079,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15277,
"src": "13994:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15078,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13994:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13993:9:26"
},
"scope": 16593,
"src": "13893:2483:26",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15355,
"nodeType": "Block",
"src": "17000:514:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15291,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15289,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17019:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15290,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17029:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "17019:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f414d4f554e54",
"id": 15292,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17032:17:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
},
"value": "ERR_ZERO_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
}
],
"id": 15288,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "17011:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15293,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17011:39:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15294,
"nodeType": "ExpressionStatement",
"src": "17011:39:26"
},
{
"assignments": [
15296
],
"declarations": [
{
"constant": false,
"id": 15296,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15355,
"src": "17063:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15295,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17063:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15305,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15300,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "17105:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15299,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17097:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15298,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17097:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17097:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15297,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "17085:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15302,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17085:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "17085:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15304,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17085:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17063:64:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15313,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "17175:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17175:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15315,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17187:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15309,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "17158:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15308,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17150:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15307,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17150:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15310,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17150:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15306,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "17138:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15311,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17138:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15312,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21515,
"src": "17138:36:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17138:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15317,
"nodeType": "ExpressionStatement",
"src": "17138:57:26"
},
{
"assignments": [
15322
],
"declarations": [
{
"constant": false,
"id": 15322,
"mutability": "mutable",
"name": "reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15355,
"src": "17208:40:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15320,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17208:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15321,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17208:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15329,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15326,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "17265:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15327,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17265:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15325,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "17251:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15323,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17255:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15324,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17255:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15328,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17251:35:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17208:78:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15345,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15341,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17371:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15343,
"indexExpression": {
"argumentTypes": null,
"id": 15342,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17395:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "17371:26:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 15344,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17400:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "17371:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15346,
"nodeType": "ExpressionStatement",
"src": "17371:30:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15337,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15334,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17317:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15335,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17321:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17321:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "17317:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15347,
"initializationExpression": {
"assignments": [
15331
],
"declarations": [
{
"constant": false,
"id": 15331,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15347,
"src": "17302:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15330,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17302:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15333,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15332,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17314:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "17302:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15339,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "17353:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15338,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17353:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15340,
"nodeType": "ExpressionStatement",
"src": "17353:3:26"
},
"nodeType": "ForStatement",
"src": "17297:104:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15349,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "17445:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
{
"argumentTypes": null,
"id": 15350,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17460:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15351,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15296,
"src": "17485:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15352,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17498:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15348,
"name": "removeLiquidityFromPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16125,
"src": "17421:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256,uint256) returns (uint256[] memory)"
}
},
"id": 15353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17421:85:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15287,
"id": 15354,
"nodeType": "Return",
"src": "17414:92:26"
}
]
},
"documentation": {
"id": 15278,
"nodeType": "StructuredDocumentation",
"src": "16384:498:26",
"text": " @dev decreases the pool's liquidity and burns the caller's shares in the pool\n for example, if the holder sells 10% of the supply,\n then they will receive 10% of each reserve token balance in return\n note that starting from version 28, you should use 'removeLiquidity' instead\n @param _amount amount to liquidate (in the pool token)\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"functionSelector": "415f1240",
"id": 15356,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15283,
"modifierName": {
"argumentTypes": null,
"id": 15282,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "16949:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "16949:9:26"
}
],
"name": "liquidate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15281,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15280,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15356,
"src": "16907:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15279,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16907:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16906:17:26"
},
"returnParameters": {
"id": 15287,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15286,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15356,
"src": "16977:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15284,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15285,
"length": null,
"nodeType": "ArrayTypeName",
"src": "16977:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16976:18:26"
},
"scope": 16593,
"src": "16888:626:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15447,
"nodeType": "Block",
"src": "18354:612:26",
"statements": [
{
"assignments": [
15374
],
"declarations": [
{
"constant": false,
"id": 15374,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18365:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15372,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18365:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15373,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18365:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15381,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15378,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18413:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15379,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18413:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15377,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "18399:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15375,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18403:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15376,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18403:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15380,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18399:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18365:70:26"
},
{
"assignments": [
15383
],
"declarations": [
{
"constant": false,
"id": 15383,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18448:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15382,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18448:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15392,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15387,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "18490:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15386,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18482:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18482:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18482:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15384,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "18470:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18470:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "18470:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18470:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18448:64:26"
},
{
"assignments": [
15394
],
"declarations": [
{
"constant": false,
"id": 15394,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18523:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15393,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "18523:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15400,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15397,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "18573:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15396,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "18563:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18563:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15395,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "18548:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18548:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18523:66:26"
},
{
"assignments": [
15402
],
"declarations": [
{
"constant": false,
"id": 15402,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18600:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15401,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18600:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15415,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15405,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15383,
"src": "18642:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15406,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "18655:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15410,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15407,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18664:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15409,
"indexExpression": {
"argumentTypes": null,
"id": 15408,
"name": "_reserveTokenIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15362,
"src": "18679:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18664:34:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18655:44:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15411,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "18655:52:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15412,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "18709:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15413,
"name": "_reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15364,
"src": "18723:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15403,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15394,
"src": "18617:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "18617:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15414,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18617:121:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18600:138:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15427,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18816:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15429,
"indexExpression": {
"argumentTypes": null,
"id": 15428,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18831:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "18816:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15432,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15383,
"src": "18853:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15433,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "18866:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15437,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15434,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18875:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15436,
"indexExpression": {
"argumentTypes": null,
"id": 15435,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18890:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18875:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18866:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15438,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "18866:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15439,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "18903:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15440,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15402,
"src": "18917:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15430,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15394,
"src": "18836:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "18836:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15441,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18836:88:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18816:108:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15443,
"nodeType": "ExpressionStatement",
"src": "18816:108:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15420,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18771:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15421,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18775:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15422,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18775:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18771:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15444,
"initializationExpression": {
"assignments": [
15417
],
"declarations": [
{
"constant": false,
"id": 15417,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15444,
"src": "18756:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15416,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18756:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15419,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18768:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "18756:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "18798:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15424,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18798:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15426,
"nodeType": "ExpressionStatement",
"src": "18798:3:26"
},
"nodeType": "ForStatement",
"src": "18751:173:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15445,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18944:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15369,
"id": 15446,
"nodeType": "Return",
"src": "18937:21:26"
}
]
},
"documentation": {
"id": 15357,
"nodeType": "StructuredDocumentation",
"src": "17522:640:26",
"text": " @dev given the amount of one of the reserve tokens to add liquidity of,\n returns the required amount of each one of the other reserve tokens\n since an empty pool can be funded with any list of non-zero input amounts,\n this function assumes that the pool is not empty (has already been funded)\n @param _reserveTokens address of each reserve token\n @param _reserveTokenIndex index of the relevant reserve token\n @param _reserveAmount amount of the relevant reserve token\n @return the required amount of each one of the reserve tokens"
},
"functionSelector": "80d9416d",
"id": 15448,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityCost",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15365,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15360,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18194:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15358,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "18194:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15359,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18194:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15362,
"mutability": "mutable",
"name": "_reserveTokenIndex",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18231:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15361,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18231:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15364,
"mutability": "mutable",
"name": "_reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18259:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15363,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18259:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18193:89:26"
},
"returnParameters": {
"id": 15369,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15368,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18331:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15366,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18331:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15367,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18331:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18330:18:26"
},
"scope": 16593,
"src": "18168:798:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15488,
"nodeType": "Block",
"src": "19633:278:26",
"statements": [
{
"assignments": [
15459
],
"declarations": [
{
"constant": false,
"id": 15459,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15488,
"src": "19644:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19644:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15468,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15463,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "19686:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15462,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "19678:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15461,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19678:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15464,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19678:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15460,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "19666:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15465,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19666:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15466,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "19666:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15467,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19666:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19644:64:26"
},
{
"assignments": [
15470
],
"declarations": [
{
"constant": false,
"id": 15470,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15488,
"src": "19719:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15469,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "19719:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15476,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15473,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "19769:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15472,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "19759:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15474,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19759:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15471,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "19744:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15475,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19744:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19719:66:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15479,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15459,
"src": "19828:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15480,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "19841:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15482,
"indexExpression": {
"argumentTypes": null,
"id": 15481,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15451,
"src": "19850:13:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "19841:23:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15483,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "19841:31:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15484,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "19874:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15485,
"name": "_reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15453,
"src": "19888:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15477,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15470,
"src": "19803:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15478,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "19803:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19803:100:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15457,
"id": 15487,
"nodeType": "Return",
"src": "19796:107:26"
}
]
},
"documentation": {
"id": 15449,
"nodeType": "StructuredDocumentation",
"src": "18974:512:26",
"text": " @dev given the amount of one of the reserve tokens to add liquidity of,\n returns the amount of pool tokens entitled for it\n since an empty pool can be funded with any list of non-zero input amounts,\n this function assumes that the pool is not empty (has already been funded)\n @param _reserveToken address of the reserve token\n @param _reserveAmount amount of the reserve token\n @return the amount of pool tokens entitled"
},
"functionSelector": "4e40c260",
"id": 15489,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15454,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15451,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19520:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15450,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "19520:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15453,
"mutability": "mutable",
"name": "_reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19547:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15452,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19547:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19519:51:26"
},
"returnParameters": {
"id": 15457,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15456,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19619:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15455,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19619:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19618:9:26"
},
"scope": 16593,
"src": "19492:419:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15527,
"nodeType": "Block",
"src": "20421:254:26",
"statements": [
{
"assignments": [
15502
],
"declarations": [
{
"constant": false,
"id": 15502,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15527,
"src": "20432:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15501,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20432:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15511,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15506,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "20474:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15505,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20466:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15504,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20466:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15507,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20466:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15503,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "20454:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20454:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15509,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "20454:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20454:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20432:64:26"
},
{
"assignments": [
15513
],
"declarations": [
{
"constant": false,
"id": 15513,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15527,
"src": "20507:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15512,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "20507:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15519,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15516,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "20557:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15515,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "20547:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20547:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15514,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "20532:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15518,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20532:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20507:66:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15521,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15492,
"src": "20621:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15522,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15495,
"src": "20630:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15523,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15502,
"src": "20646:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15524,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15513,
"src": "20659:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
],
"id": 15520,
"name": "removeLiquidityReserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15986,
"src": "20591:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_uint256_$_t_contract$_IBancorFormula_$13177_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256,contract IERC20Token[] memory,uint256,contract IBancorFormula) view returns (uint256[] memory)"
}
},
"id": 15525,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20591:76:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15500,
"id": 15526,
"nodeType": "Return",
"src": "20584:83:26"
}
]
},
"documentation": {
"id": 15490,
"nodeType": "StructuredDocumentation",
"src": "19919:340:26",
"text": " @dev returns the amount of each reserve token entitled for a given amount of pool tokens\n @param _amount amount of pool tokens\n @param _reserveTokens address of each reserve token\n @return the amount of each reserve token entitled for the given amount of pool tokens"
},
"functionSelector": "15458837",
"id": 15528,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15496,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15492,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20296:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15491,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20296:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15495,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20313:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15493,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "20313:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15494,
"length": null,
"nodeType": "ArrayTypeName",
"src": "20313:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20295:54:26"
},
"returnParameters": {
"id": 15500,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15499,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20398:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15497,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20398:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15498,
"length": null,
"nodeType": "ArrayTypeName",
"src": "20398:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20397:18:26"
},
"scope": 16593,
"src": "20265:410:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15633,
"nodeType": "Block",
"src": "21236:1027:26",
"statements": [
{
"assignments": [
15541
],
"declarations": [
{
"constant": false,
"id": 15541,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21247:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15540,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21247:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15542,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "21247:9:26"
},
{
"assignments": [
15544
],
"declarations": [
{
"constant": false,
"id": 15544,
"mutability": "mutable",
"name": "j",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21267:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15543,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21267:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15545,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "21267:9:26"
},
{
"assignments": [
15547
],
"declarations": [
{
"constant": false,
"id": 15547,
"mutability": "mutable",
"name": "length",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21289:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15546,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21289:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15550,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15548,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "21306:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15549,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21306:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "21289:37:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15555,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15552,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21345:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15553,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21355:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21355:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21345:31:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21378:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15551,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21337:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21337:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15558,
"nodeType": "ExpressionStatement",
"src": "21337:63:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15560,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21419:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15561,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15535,
"src": "21429:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15562,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21429:22:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21419:32:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 15564,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21453:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 15559,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21411:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15565,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21411:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15566,
"nodeType": "ExpressionStatement",
"src": "21411:63:26"
},
{
"body": {
"id": 15624,
"nodeType": "Block",
"src": "21516:621:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15578,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "21627:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15582,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15579,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21636:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15581,
"indexExpression": {
"argumentTypes": null,
"id": 15580,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21651:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21636:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21627:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15583,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "21627:33:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15584,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21662:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15577,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21619:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21619:65:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15586,
"nodeType": "ExpressionStatement",
"src": "21619:65:26"
},
{
"body": {
"id": 15606,
"nodeType": "Block",
"src": "21728:104:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15603,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15597,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "21751:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15599,
"indexExpression": {
"argumentTypes": null,
"id": 15598,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21765:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21751:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15600,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21771:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15602,
"indexExpression": {
"argumentTypes": null,
"id": 15601,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21786:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21771:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "21751:37:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15605,
"nodeType": "IfStatement",
"src": "21747:69:26",
"trueBody": {
"id": 15604,
"nodeType": "Break",
"src": "21811:5:26"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15591,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21711:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15592,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21715:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21711:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15607,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 15589,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 15587,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21704:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 15588,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21708:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "21704:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15590,
"nodeType": "ExpressionStatement",
"src": "21704:5:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15595,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "21723:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15594,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21723:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15596,
"nodeType": "ExpressionStatement",
"src": "21723:3:26"
},
"nodeType": "ForStatement",
"src": "21699:133:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15611,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15609,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21942:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15610,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21946:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21942:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15612,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21954:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15608,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21934:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15613,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21934:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15614,
"nodeType": "ExpressionStatement",
"src": "21934:42:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15620,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15616,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15535,
"src": "22080:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15618,
"indexExpression": {
"argumentTypes": null,
"id": 15617,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "22096:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22080:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15619,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22101:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22080:22:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 15621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22104:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 15615,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "22072:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22072:53:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15623,
"nodeType": "ExpressionStatement",
"src": "22072:53:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15571,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21499:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15572,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21503:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21499:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15625,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 15569,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 15567,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21492:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 15568,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21496:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "21492:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15570,
"nodeType": "ExpressionStatement",
"src": "21492:5:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15575,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "21511:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15574,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21511:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15576,
"nodeType": "ExpressionStatement",
"src": "21511:3:26"
},
"nodeType": "ForStatement",
"src": "21487:650:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15629,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15627,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15537,
"src": "22224:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15628,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22234:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22224:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f414d4f554e54",
"id": 15630,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22237:17:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
},
"value": "ERR_ZERO_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
}
],
"id": 15626,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "22216:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15631,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22216:39:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15632,
"nodeType": "ExpressionStatement",
"src": "22216:39:26"
}
]
},
"documentation": {
"id": 15529,
"nodeType": "StructuredDocumentation",
"src": "20683:393:26",
"text": " @dev verifies that a given array of tokens is identical to the converter's array of reserve tokens\n we take this input in order to allow specifying the corresponding reserve amounts in any order\n @param _reserveTokens array of reserve tokens\n @param _reserveAmounts array of reserve amounts\n @param _amount token amount"
},
"id": 15634,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "verifyLiquidityInput",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15538,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15532,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21112:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15530,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "21112:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15531,
"length": null,
"nodeType": "ArrayTypeName",
"src": "21112:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15535,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21149:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15533,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21149:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15534,
"length": null,
"nodeType": "ArrayTypeName",
"src": "21149:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15537,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21183:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15536,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21183:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "21111:88:26"
},
"returnParameters": {
"id": 15539,
"nodeType": "ParameterList",
"parameters": [],
"src": "21236:0:26"
},
"scope": 16593,
"src": "21082:1181:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15663,
"nodeType": "Block",
"src": "22750:209:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15650,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15648,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15643,
"src": "22765:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15649,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22781:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22765:17:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15656,
"nodeType": "IfStatement",
"src": "22761:99:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15652,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15638,
"src": "22828:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15653,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15641,
"src": "22844:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15651,
"name": "addLiquidityToEmptyPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15751,
"src": "22804:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory) returns (uint256)"
}
},
"id": 15654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22804:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15647,
"id": 15655,
"nodeType": "Return",
"src": "22797:63:26"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15658,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15638,
"src": "22905:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15659,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15641,
"src": "22921:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15660,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15643,
"src": "22938:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15657,
"name": "addLiquidityToNonEmptyPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15926,
"src": "22878:26:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) returns (uint256)"
}
},
"id": 15661,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22878:73:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15647,
"id": 15662,
"nodeType": "Return",
"src": "22871:80:26"
}
]
},
"documentation": {
"id": 15635,
"nodeType": "StructuredDocumentation",
"src": "22271:303:26",
"text": " @dev adds liquidity (reserve) to the pool\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _totalSupply token total supply\n @return amount of pool tokens issued"
},
"id": 15664,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15644,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15638,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22608:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15636,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "22608:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15637,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22608:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15641,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22645:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15639,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22645:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15640,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22645:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15643,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22679:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15642,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22679:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22607:93:26"
},
"returnParameters": {
"id": 15647,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15646,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22736:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22736:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22735:9:26"
},
"scope": 16593,
"src": "22580:379:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15750,
"nodeType": "Block",
"src": "23393:1062:26",
"statements": [
{
"assignments": [
15677
],
"declarations": [
{
"constant": false,
"id": 15677,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15750,
"src": "23489:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15676,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23489:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15681,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15679,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15671,
"src": "23520:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15678,
"name": "geometricMean",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16302,
"src": "23506:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (uint256[] memory) pure returns (uint256)"
}
},
"id": 15680,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23506:30:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23489:47:26"
},
{
"body": {
"id": 15746,
"nodeType": "Block",
"src": "23680:690:26",
"statements": [
{
"assignments": [
15694
],
"declarations": [
{
"constant": false,
"id": 15694,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15746,
"src": "23695:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15693,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "23695:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15698,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15695,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15668,
"src": "23722:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15697,
"indexExpression": {
"argumentTypes": null,
"id": 15696,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23737:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "23722:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23695:44:26"
},
{
"assignments": [
15700
],
"declarations": [
{
"constant": false,
"id": 15700,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15746,
"src": "23754:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15699,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23754:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15704,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15701,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15671,
"src": "23778:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15703,
"indexExpression": {
"argumentTypes": null,
"id": 15702,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23794:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "23778:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23754:42:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15707,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15705,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "23817:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 15706,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "23833:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "23817:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15719,
"nodeType": "IfStatement",
"src": "23813:193:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15709,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "23951:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15710,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "23965:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15711,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23965:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15714,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "23985:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15713,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "23977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15712,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23977:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15715,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23977:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15716,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "23992:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15708,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "23934:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15717,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23934:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15718,
"nodeType": "ExpressionStatement",
"src": "23934:72:26"
}
},
{
"expression": {
"argumentTypes": null,
"id": 15725,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15720,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "24023:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15722,
"indexExpression": {
"argumentTypes": null,
"id": 15721,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24032:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24023:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15723,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "24023:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15724,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24056:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "24023:46:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15726,
"nodeType": "ExpressionStatement",
"src": "24023:46:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15728,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "24106:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15729,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "24106:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15730,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24118:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15731,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24132:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15732,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24147:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15733,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24162:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15727,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "24091:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15734,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24091:78:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15735,
"nodeType": "EmitStatement",
"src": "24086:83:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15737,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24291:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15738,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24299:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15739,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24313:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15740,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "24328:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15742,
"indexExpression": {
"argumentTypes": null,
"id": 15741,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24337:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24328:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15743,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "24328:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15736,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "24258:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24258:100:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15745,
"nodeType": "ExpressionStatement",
"src": "24258:100:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15689,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15686,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23648:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15687,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15668,
"src": "23652:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15688,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23652:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "23648:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15747,
"initializationExpression": {
"assignments": [
15683
],
"declarations": [
{
"constant": false,
"id": 15683,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15747,
"src": "23633:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15682,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23633:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15685,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23645:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "23633:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15691,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "23675:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15690,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23675:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15692,
"nodeType": "ExpressionStatement",
"src": "23675:3:26"
},
"nodeType": "ForStatement",
"src": "23628:742:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15748,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24441:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15675,
"id": 15749,
"nodeType": "Return",
"src": "24434:13:26"
}
]
},
"documentation": {
"id": 15665,
"nodeType": "StructuredDocumentation",
"src": "22967:267:26",
"text": " @dev adds liquidity (reserve) to the pool when it's empty\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @return amount of pool tokens issued"
},
"id": 15751,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToEmptyPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15672,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15668,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23273:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15666,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "23273:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15667,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23273:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15671,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23310:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15669,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23310:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15670,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23310:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23272:71:26"
},
"returnParameters": {
"id": 15675,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15674,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23379:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15673,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23379:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23378:9:26"
},
"scope": 16593,
"src": "23240:1215:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15925,
"nodeType": "Block",
"src": "24970:1826:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 15765,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "24981:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 15766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24981:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15767,
"nodeType": "ExpressionStatement",
"src": "24981:21:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15768,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25013:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15770,
"indexExpression": {
"argumentTypes": null,
"id": 15769,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25022:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25013:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15771,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25013:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15777,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "25095:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25095:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15772,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25053:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15774,
"indexExpression": {
"argumentTypes": null,
"id": 15773,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25062:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25053:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15775,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25053:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "25053:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15779,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25053:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25013:92:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15781,
"nodeType": "ExpressionStatement",
"src": "25013:92:26"
},
{
"assignments": [
15783
],
"declarations": [
{
"constant": false,
"id": 15783,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25118:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15782,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "25118:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15789,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15786,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "25168:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15785,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "25158:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25158:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15784,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "25143:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15788,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25143:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25118:66:26"
},
{
"assignments": [
15791
],
"declarations": [
{
"constant": false,
"id": 15791,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25195:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15790,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25195:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15798,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15793,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15783,
"src": "25224:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
{
"argumentTypes": null,
"id": 15794,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25233:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15795,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25247:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15796,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "25263:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15792,
"name": "getMinShare",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16201,
"src": "25212:11:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IBancorFormula_$13177_$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (contract IBancorFormula,uint256,contract IERC20Token[] memory,uint256[] memory) view returns (uint256)"
}
},
"id": 15797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25212:67:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25195:84:26"
},
{
"assignments": [
15800
],
"declarations": [
{
"constant": false,
"id": 15800,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25290:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15799,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25290:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15805,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15803,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "25336:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15801,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25319:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15802,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "25319:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25319:24:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25290:53:26"
},
{
"body": {
"id": 15921,
"nodeType": "Block",
"src": "25408:1303:26",
"statements": [
{
"assignments": [
15818
],
"declarations": [
{
"constant": false,
"id": 15818,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25423:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15817,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "25423:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15822,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15819,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25450:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15821,
"indexExpression": {
"argumentTypes": null,
"id": 15820,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25465:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25450:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25423:44:26"
},
{
"assignments": [
15824
],
"declarations": [
{
"constant": false,
"id": 15824,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25482:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15823,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25482:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15829,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15825,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25503:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15827,
"indexExpression": {
"argumentTypes": null,
"id": 15826,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25512:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25503:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15828,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25503:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25482:51:26"
},
{
"assignments": [
15831
],
"declarations": [
{
"constant": false,
"id": 15831,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25548:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15830,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25548:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15839,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15834,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25589:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15835,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15824,
"src": "25603:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15836,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "25615:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15837,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "25629:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15832,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15783,
"src": "25572:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "25572:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25572:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25548:88:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15841,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "25659:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15842,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25675:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "25659:17:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 15844,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25678:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 15840,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "25651:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15845,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25651:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15846,
"nodeType": "ExpressionStatement",
"src": "25651:52:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15852,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15848,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "25725:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15849,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "25742:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15851,
"indexExpression": {
"argumentTypes": null,
"id": 15850,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25758:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25742:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25725:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 15847,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "25718:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 15853,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25718:43:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15854,
"nodeType": "ExpressionStatement",
"src": "25718:43:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15855,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25865:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 15856,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25881:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "25865:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15873,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15869,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "26078:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15871,
"indexExpression": {
"argumentTypes": null,
"id": 15870,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "26094:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26078:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 15872,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26099:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26078:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15886,
"nodeType": "IfStatement",
"src": "26074:165:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15883,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15879,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "26204:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15881,
"indexExpression": {
"argumentTypes": null,
"id": 15880,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "26220:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26204:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 15882,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26225:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26204:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15874,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26184:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15877,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26184:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 15878,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26184:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 15884,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26184:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15885,
"nodeType": "ExpressionStatement",
"src": "26184:55:26"
}
},
"id": 15887,
"nodeType": "IfStatement",
"src": "25861:378:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15859,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25999:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15860,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26013:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15861,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26013:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15864,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "26033:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15863,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26025:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15862,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26025:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15865,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26025:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15866,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26040:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15858,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "25982:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25982:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15868,
"nodeType": "ExpressionStatement",
"src": "25982:72:26"
}
},
{
"assignments": [
15889
],
"declarations": [
{
"constant": false,
"id": 15889,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "26256:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15888,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "26256:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15894,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15892,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26299:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15890,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15824,
"src": "26284:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15891,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "26284:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26284:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "26256:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15895,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "26328:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15897,
"indexExpression": {
"argumentTypes": null,
"id": 15896,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26337:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26328:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15898,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "26328:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15899,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26361:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26328:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15901,
"nodeType": "ExpressionStatement",
"src": "26328:50:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15903,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26415:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15904,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26415:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15905,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26427:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15906,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26441:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15907,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26456:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15908,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15800,
"src": "26475:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15902,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "26400:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15909,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26400:94:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15910,
"nodeType": "EmitStatement",
"src": "26395:99:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15912,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15800,
"src": "26616:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15913,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26636:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15914,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26650:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15915,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "26669:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15917,
"indexExpression": {
"argumentTypes": null,
"id": 15916,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26678:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26669:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15918,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "26669:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15911,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "26583:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26583:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15920,
"nodeType": "ExpressionStatement",
"src": "26583:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15810,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25376:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15811,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25380:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25380:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25376:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15922,
"initializationExpression": {
"assignments": [
15807
],
"declarations": [
{
"constant": false,
"id": 15807,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15922,
"src": "25361:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15806,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25361:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15809,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15808,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25373:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "25361:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15815,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "25403:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15814,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25403:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15816,
"nodeType": "ExpressionStatement",
"src": "25403:3:26"
},
"nodeType": "ForStatement",
"src": "25356:1355:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15923,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "26782:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15764,
"id": 15924,
"nodeType": "Return",
"src": "26775:13:26"
}
]
},
"documentation": {
"id": 15752,
"nodeType": "StructuredDocumentation",
"src": "24463:323:26",
"text": " @dev adds liquidity (reserve) to the pool when it's not empty\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _totalSupply token total supply\n @return amount of pool tokens issued"
},
"id": 15926,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToNonEmptyPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15761,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15755,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24828:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15753,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "24828:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15754,
"length": null,
"nodeType": "ArrayTypeName",
"src": "24828:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15758,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24865:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15756,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24865:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15757,
"length": null,
"nodeType": "ArrayTypeName",
"src": "24865:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15760,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24899:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15759,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24899:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "24827:93:26"
},
"returnParameters": {
"id": 15764,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15763,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24956:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15762,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24956:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "24955:9:26"
},
"scope": 16593,
"src": "24792:2004:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15985,
"nodeType": "Block",
"src": "27464:322:26",
"statements": [
{
"assignments": [
15946
],
"declarations": [
{
"constant": false,
"id": 15946,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15985,
"src": "27475:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15944,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27475:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15945,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27475:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15953,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15950,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15932,
"src": "27523:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27523:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "27509:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15947,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27513:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15948,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27513:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27509:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "27475:70:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15965,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27621:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15967,
"indexExpression": {
"argumentTypes": null,
"id": 15966,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27636:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "27621:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15970,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15934,
"src": "27673:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15971,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "27687:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15975,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15972,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15932,
"src": "27696:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15974,
"indexExpression": {
"argumentTypes": null,
"id": 15973,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27711:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27696:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27687:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15976,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "27687:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15977,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "27724:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15978,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15929,
"src": "27738:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15968,
"name": "_formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15936,
"src": "27641:8:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15969,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "liquidateReserveAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13159,
"src": "27641:31:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15979,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27641:105:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27621:125:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15981,
"nodeType": "ExpressionStatement",
"src": "27621:125:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15958,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27576:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15959,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27580:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15960,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27580:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27576:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15982,
"initializationExpression": {
"assignments": [
15955
],
"declarations": [
{
"constant": false,
"id": 15955,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15982,
"src": "27561:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15954,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27561:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15957,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15956,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27573:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "27561:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "27603:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15962,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27603:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15964,
"nodeType": "ExpressionStatement",
"src": "27603:3:26"
},
"nodeType": "ForStatement",
"src": "27556:190:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15983,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27764:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15941,
"id": 15984,
"nodeType": "Return",
"src": "27757:21:26"
}
]
},
"documentation": {
"id": 15927,
"nodeType": "StructuredDocumentation",
"src": "26804:442:26",
"text": " @dev returns the amount of each reserve token entitled for a given amount of pool tokens\n @param _amount amount of pool tokens\n @param _reserveTokens address of each reserve token\n @param _totalSupply token total supply\n @param _formula formula contract\n @return the amount of each reserve token entitled for the given amount of pool tokens"
},
"id": 15986,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityReserveAmounts",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15937,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15929,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27291:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15928,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27291:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15932,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27308:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15930,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "27308:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15931,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27308:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15934,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27345:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15933,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27345:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15936,
"mutability": "mutable",
"name": "_formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27367:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15935,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "27367:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "27290:101:26"
},
"returnParameters": {
"id": 15941,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15940,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27441:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15938,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27441:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15939,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27441:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "27440:18:26"
},
"scope": 16593,
"src": "27252:534:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16124,
"nodeType": "Block",
"src": "28459:1485:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 16003,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "28470:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 16004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28470:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16005,
"nodeType": "ExpressionStatement",
"src": "28470:21:26"
},
{
"assignments": [
16007
],
"declarations": [
{
"constant": false,
"id": 16007,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28504:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 16006,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "28504:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16013,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16010,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "28554:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 16009,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "28544:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 16011,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28544:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16008,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "28529:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 16012,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28529:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28504:66:26"
},
{
"assignments": [
16015
],
"declarations": [
{
"constant": false,
"id": 16015,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28581:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16014,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28581:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16020,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16018,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15997,
"src": "28627:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16016,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15995,
"src": "28610:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16017,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "28610:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16019,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28610:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28581:54:26"
},
{
"assignments": [
16025
],
"declarations": [
{
"constant": false,
"id": 16025,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28646:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16023,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28646:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16024,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28646:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16032,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16027,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15997,
"src": "28710:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16028,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28719:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 16029,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15995,
"src": "28735:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16030,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16007,
"src": "28749:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
],
"id": 16026,
"name": "removeLiquidityReserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15986,
"src": "28680:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_uint256_$_t_contract$_IBancorFormula_$13177_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256,contract IERC20Token[] memory,uint256,contract IBancorFormula) view returns (uint256[] memory)"
}
},
"id": 16031,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28680:77:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28646:111:26"
},
{
"body": {
"id": 16120,
"nodeType": "Block",
"src": "28822:985:26",
"statements": [
{
"assignments": [
16045
],
"declarations": [
{
"constant": false,
"id": 16045,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "28837:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16044,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "28837:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16049,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16046,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28864:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16048,
"indexExpression": {
"argumentTypes": null,
"id": 16047,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28879:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28864:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28837:44:26"
},
{
"assignments": [
16051
],
"declarations": [
{
"constant": false,
"id": 16051,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "28896:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16050,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28896:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16055,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16052,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16025,
"src": "28920:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16054,
"indexExpression": {
"argumentTypes": null,
"id": 16053,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28935:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28920:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28896:41:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16057,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "28960:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16058,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15993,
"src": "28977:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16060,
"indexExpression": {
"argumentTypes": null,
"id": 16059,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "29002:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28977:27:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28960:44:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 16062,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "29006:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 16056,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "28952:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 16063,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28952:79:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16064,
"nodeType": "ExpressionStatement",
"src": "28952:79:26"
},
{
"assignments": [
16066
],
"declarations": [
{
"constant": false,
"id": 16066,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "29048:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16065,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29048:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16074,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16072,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29111:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16067,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29076:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16069,
"indexExpression": {
"argumentTypes": null,
"id": 16068,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29085:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29076:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16070,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "29076:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16071,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "29076:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16073,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29076:49:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "29048:77:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16080,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16075,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29140:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16077,
"indexExpression": {
"argumentTypes": null,
"id": 16076,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29149:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29140:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16078,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "29140:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 16079,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29173:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "29140:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16081,
"nodeType": "ExpressionStatement",
"src": "29140:50:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 16084,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16082,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29294:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 16083,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "29310:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "29294:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16094,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29432:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16095,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29446:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16096,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29446:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 16097,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29458:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16093,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22809,
"src": "29419:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 16098,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29419:53:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16099,
"nodeType": "ExpressionStatement",
"src": "29419:53:26"
},
"id": 16100,
"nodeType": "IfStatement",
"src": "29290:182:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16090,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29368:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29348:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16088,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29348:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 16089,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29348:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 16091,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29348:34:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16092,
"nodeType": "ExpressionStatement",
"src": "29348:34:26"
}
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16102,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29511:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29511:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 16104,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29523:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16105,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29537:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16106,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29552:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16107,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16015,
"src": "29571:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16101,
"name": "LiquidityRemoved",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13041,
"src": "29494:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 16108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29494:96:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16109,
"nodeType": "EmitStatement",
"src": "29489:101:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16111,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16015,
"src": "29712:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16112,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29732:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16113,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29746:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16114,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29765:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16116,
"indexExpression": {
"argumentTypes": null,
"id": 16115,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29774:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29765:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16117,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "29765:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16110,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "29679:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29679:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16119,
"nodeType": "ExpressionStatement",
"src": "29679:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16040,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16037,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28790:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16038,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28794:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16039,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "28794:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28790:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16121,
"initializationExpression": {
"assignments": [
16034
],
"declarations": [
{
"constant": false,
"id": 16034,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16121,
"src": "28775:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16033,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28775:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16036,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16035,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28787:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "28775:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16042,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "28817:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16041,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28817:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16043,
"nodeType": "ExpressionStatement",
"src": "28817:3:26"
},
"nodeType": "ForStatement",
"src": "28770:1037:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16122,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16025,
"src": "29922:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 16002,
"id": 16123,
"nodeType": "Return",
"src": "29915:21:26"
}
]
},
"documentation": {
"id": 15987,
"nodeType": "StructuredDocumentation",
"src": "27794:449:26",
"text": " @dev removes liquidity (reserve) from the pool\n @param _reserveTokens address of each reserve token\n @param _reserveMinReturnAmounts minimum return-amount of each reserve token\n @param _totalSupply token total supply\n @param _amount token amount\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"id": 16125,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityFromPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15998,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15990,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28282:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15988,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "28282:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15989,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28282:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15993,
"mutability": "mutable",
"name": "_reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28319:41:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15991,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28319:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15992,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28319:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15995,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28362:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15994,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28362:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15997,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28384:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15996,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28281:119:26"
},
"returnParameters": {
"id": 16002,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16001,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28436:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15999,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28436:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16000,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28436:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28435:18:26"
},
"scope": 16593,
"src": "28249:1695:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16200,
"nodeType": "Block",
"src": "30121:439:26",
"statements": [
{
"assignments": [
16141
],
"declarations": [
{
"constant": false,
"id": 16141,
"mutability": "mutable",
"name": "minIndex",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16200,
"src": "30132:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16140,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30132:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16143,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16142,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30151:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "30132:20:26"
},
{
"body": {
"id": 16183,
"nodeType": "Block",
"src": "30215:197:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16159,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30257:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16163,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16160,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30266:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16162,
"indexExpression": {
"argumentTypes": null,
"id": 16161,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30281:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30266:24:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30257:34:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16164,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30257:42:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16155,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30234:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16157,
"indexExpression": {
"argumentTypes": null,
"id": 16156,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30250:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30234:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "30234:22:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30234:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16170,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30333:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16174,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16171,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30342:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16173,
"indexExpression": {
"argumentTypes": null,
"id": 16172,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30357:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30342:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30333:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16175,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30333:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16166,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30303:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16168,
"indexExpression": {
"argumentTypes": null,
"id": 16167,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30319:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30303:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "30303:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16176,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30303:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30234:135:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16182,
"nodeType": "IfStatement",
"src": "30230:170:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 16180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16178,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30388:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 16179,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30399:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30388:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16181,
"nodeType": "ExpressionStatement",
"src": "30388:12:26"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16151,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16148,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30183:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16149,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30187:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30187:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30183:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16184,
"initializationExpression": {
"assignments": [
16145
],
"declarations": [
{
"constant": false,
"id": 16145,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16184,
"src": "30168:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16144,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30168:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16147,
"initialValue": {
"argumentTypes": null,
"hexValue": "31",
"id": 16146,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30180:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"nodeType": "VariableDeclarationStatement",
"src": "30168:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "30210:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16152,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30210:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16154,
"nodeType": "ExpressionStatement",
"src": "30210:3:26"
},
"nodeType": "ForStatement",
"src": "30163:249:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16187,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16129,
"src": "30454:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16188,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30468:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16192,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16189,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30477:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16191,
"indexExpression": {
"argumentTypes": null,
"id": 16190,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30492:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30477:24:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30468:34:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16193,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30468:42:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16194,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "30512:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16195,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30526:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16197,
"indexExpression": {
"argumentTypes": null,
"id": 16196,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30542:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30526:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16185,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16127,
"src": "30429:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 16186,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "30429:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 16198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30429:123:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16139,
"id": 16199,
"nodeType": "Return",
"src": "30422:130:26"
}
]
},
"documentation": null,
"id": 16201,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getMinShare",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16136,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16127,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "29973:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 16126,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "29973:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16129,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "29997:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16128,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29997:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16132,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30019:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 16130,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "30019:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 16131,
"length": null,
"nodeType": "ArrayTypeName",
"src": "30019:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16135,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30056:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16133,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30056:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16134,
"length": null,
"nodeType": "ArrayTypeName",
"src": "30056:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29972:117:26"
},
"returnParameters": {
"id": 16139,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16138,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30112:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16137,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30112:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30111:9:26"
},
"scope": 16593,
"src": "29952:608:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16230,
"nodeType": "Block",
"src": "30847:115:26",
"statements": [
{
"assignments": [
16210
],
"declarations": [
{
"constant": false,
"id": 16210,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16230,
"src": "30858:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16209,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30858:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16212,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30870:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "30858:13:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 16225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "30932:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16224,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16210,
"src": "30932:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16226,
"nodeType": "ExpressionStatement",
"src": "30932:3:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16217,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16214,
"src": "30903:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 16218,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30907:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "30903:5:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16227,
"initializationExpression": {
"assignments": [
16214
],
"declarations": [
{
"constant": false,
"id": 16214,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16227,
"src": "30887:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16213,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30887:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16216,
"initialValue": {
"argumentTypes": null,
"id": 16215,
"name": "_x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16204,
"src": "30899:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30887:14:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16220,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16214,
"src": "30910:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3130",
"id": 16221,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30915:2:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"src": "30910:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16223,
"nodeType": "ExpressionStatement",
"src": "30910:7:26"
},
"nodeType": "ForStatement",
"src": "30882:53:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16228,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16210,
"src": "30953:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16208,
"id": 16229,
"nodeType": "Return",
"src": "30946:8:26"
}
]
},
"documentation": {
"id": 16202,
"nodeType": "StructuredDocumentation",
"src": "30568:208:26",
"text": " @dev returns the number of decimal digits in a given value\n @param _x value (assumed positive)\n @return the number of decimal digits in the given value"
},
"functionSelector": "6aa5332c",
"id": 16231,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "decimalLength",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16205,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16204,
"mutability": "mutable",
"name": "_x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16231,
"src": "30805:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16203,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30805:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30804:12:26"
},
"returnParameters": {
"id": 16208,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16207,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16231,
"src": "30838:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16206,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30838:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30837:9:26"
},
"scope": 16593,
"src": "30782:180:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16250,
"nodeType": "Block",
"src": "31280:44:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16245,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16241,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16234,
"src": "31299:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16242,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16236,
"src": "31304:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16243,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31309:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "31304:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31299:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16246,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31298:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 16247,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16236,
"src": "31314:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31298:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16240,
"id": 16249,
"nodeType": "Return",
"src": "31291:25:26"
}
]
},
"documentation": {
"id": 16232,
"nodeType": "StructuredDocumentation",
"src": "30970:232:26",
"text": " @dev returns the nearest integer to a given quotient\n @param _n quotient numerator\n @param _d quotient denominator\n @return the nearest integer to the given quotient"
},
"functionSelector": "bbb7e5d8",
"id": 16251,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "roundDiv",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16237,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16234,
"mutability": "mutable",
"name": "_n",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31226:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16233,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31226:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16236,
"mutability": "mutable",
"name": "_d",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31238:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16235,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31238:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31225:24:26"
},
"returnParameters": {
"id": 16240,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16239,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31271:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16238,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31271:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31270:9:26"
},
"scope": 16593,
"src": "31208:116:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16301,
"nodeType": "Block",
"src": "31686:253:26",
"statements": [
{
"assignments": [
16261
],
"declarations": [
{
"constant": false,
"id": 16261,
"mutability": "mutable",
"name": "numOfDigits",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16301,
"src": "31697:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16260,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31697:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16263,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16262,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31719:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "31697:23:26"
},
{
"assignments": [
16265
],
"declarations": [
{
"constant": false,
"id": 16265,
"mutability": "mutable",
"name": "length",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16301,
"src": "31731:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16264,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31731:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16268,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16266,
"name": "_values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16255,
"src": "31748:7:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31748:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "31731:31:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 16285,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16279,
"name": "numOfDigits",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16261,
"src": "31823:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16281,
"name": "_values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16255,
"src": "31852:7:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16283,
"indexExpression": {
"argumentTypes": null,
"id": 16282,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31860:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "31852:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16280,
"name": "decimalLength",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16231,
"src": "31838:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) pure returns (uint256)"
}
},
"id": 16284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31838:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31823:40:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16286,
"nodeType": "ExpressionStatement",
"src": "31823:40:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16273,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31793:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 16274,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16265,
"src": "31797:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31793:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16287,
"initializationExpression": {
"assignments": [
16270
],
"declarations": [
{
"constant": false,
"id": 16270,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16287,
"src": "31778:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16269,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31778:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16272,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16271,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31790:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "31778:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "31805:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16276,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31805:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16278,
"nodeType": "ExpressionStatement",
"src": "31805:3:26"
},
"nodeType": "ForStatement",
"src": "31773:90:26"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "3130",
"id": 16290,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31889:2:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
}
],
"id": 16289,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31881:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 16288,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31881:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16291,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31881:11:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16297,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16293,
"name": "numOfDigits",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16261,
"src": "31906:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16294,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16265,
"src": "31919:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16292,
"name": "roundDiv",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16251,
"src": "31897:8:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16295,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31897:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16296,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31929:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "31897:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16298,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31896:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31881:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16259,
"id": 16300,
"nodeType": "Return",
"src": "31874:57:26"
}
]
},
"documentation": {
"id": 16252,
"nodeType": "StructuredDocumentation",
"src": "31332:269:26",
"text": " @dev returns the average number of decimal digits in a given list of values\n @param _values list of values (each of which assumed positive)\n @return the average number of decimal digits in the given list of values"
},
"functionSelector": "a60e7724",
"id": 16302,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "geometricMean",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16256,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16255,
"mutability": "mutable",
"name": "_values",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16302,
"src": "31630:24:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16253,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31630:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16254,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31630:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31629:26:26"
},
"returnParameters": {
"id": 16259,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16258,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16302,
"src": "31677:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16257,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31677:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31676:9:26"
},
"scope": 16593,
"src": "31607:332:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16396,
"nodeType": "Block",
"src": "32294:1231:26",
"statements": [
{
"assignments": [
16311
],
"declarations": [
{
"constant": false,
"id": 16311,
"mutability": "mutable",
"name": "poolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32305:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16310,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32305:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16320,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16315,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "32351:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 16314,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32343:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 16313,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32343:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32343:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16312,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "32331:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 16317,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32331:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 16318,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "32331:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 16319,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32331:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32305:68:26"
},
{
"assignments": [
16322
],
"declarations": [
{
"constant": false,
"id": 16322,
"mutability": "mutable",
"name": "sourceReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32384:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16321,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16326,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16324,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32430:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 16323,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "32415:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 16325,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32415:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32384:59:26"
},
{
"assignments": [
16328
],
"declarations": [
{
"constant": false,
"id": 16328,
"mutability": "mutable",
"name": "targetReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32454:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16327,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32454:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16332,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16330,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32500:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 16329,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "32485:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 16331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32485:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32454:59:26"
},
{
"assignments": [
16334
],
"declarations": [
{
"constant": false,
"id": 16334,
"mutability": "mutable",
"name": "sourceReserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32524:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16333,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "32524:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16339,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16335,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "32553:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16337,
"indexExpression": {
"argumentTypes": null,
"id": 16336,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32562:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "32553:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16338,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "32553:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32524:58:26"
},
{
"assignments": [
16341
],
"declarations": [
{
"constant": false,
"id": 16341,
"mutability": "mutable",
"name": "targetReserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32593:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16340,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "32593:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16346,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16342,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "32622:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16344,
"indexExpression": {
"argumentTypes": null,
"id": 16343,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32631:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "32622:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16345,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "32622:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32593:58:26"
},
{
"assignments": [
16348
],
"declarations": [
{
"constant": false,
"id": 16348,
"mutability": "mutable",
"name": "rateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32732:13:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16347,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32732:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16353,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16351,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "32773:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16349,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "32748:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "32748:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16352,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32748:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32732:61:26"
},
{
"assignments": [
16355
],
"declarations": [
{
"constant": false,
"id": 16355,
"mutability": "mutable",
"name": "rateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32804:13:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16354,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32804:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16360,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16358,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "32845:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16356,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "32820:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "32820:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32820:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32804:61:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16362,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32897:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16363,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32911:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16364,
"name": "rateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16348,
"src": "32925:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16365,
"name": "rateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16355,
"src": "32932:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16361,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "32881:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 16366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32881:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16367,
"nodeType": "EmitStatement",
"src": "32876:62:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16369,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33049:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16370,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "33066:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16371,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "33080:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16372,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "33102:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16368,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "33016:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16373,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33016:106:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16374,
"nodeType": "ExpressionStatement",
"src": "33016:106:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16376,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33166:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16377,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "33183:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16378,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "33197:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16379,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "33219:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16375,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "33133:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16380,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33133:106:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16381,
"nodeType": "ExpressionStatement",
"src": "33133:106:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16383,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "33339:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16384,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33353:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16385,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "33370:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16386,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "33392:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16382,
"name": "PriceDataUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14455,
"src": "33323:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint256,uint256,uint32)"
}
},
"id": 16387,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33323:89:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16388,
"nodeType": "EmitStatement",
"src": "33318:94:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16390,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "33444:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16391,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33458:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16392,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "33475:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16393,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "33497:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16389,
"name": "PriceDataUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14455,
"src": "33428:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint256,uint256,uint32)"
}
},
"id": 16394,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33428:89:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16395,
"nodeType": "EmitStatement",
"src": "33423:94:26"
}
]
},
"documentation": {
"id": 16303,
"nodeType": "StructuredDocumentation",
"src": "31947:242:26",
"text": " @dev dispatches token rate update events for the reserve tokens and the pool token\n @param _sourceToken address of the source reserve token\n @param _targetToken address of the target reserve token"
},
"id": 16397,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchTokenRateUpdateEvents",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16308,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16305,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16397,
"src": "32234:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16304,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "32234:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16307,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16397,
"src": "32260:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16306,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "32260:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32233:52:26"
},
"returnParameters": {
"id": 16309,
"nodeType": "ParameterList",
"parameters": [],
"src": "32294:0:26"
},
"scope": 16593,
"src": "32195:1330:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16427,
"nodeType": "Block",
"src": "33994:159:26",
"statements": [
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16413,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "34046:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 16412,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "34038:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 16411,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34038:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16414,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34038:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16410,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "34026:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 16415,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34026:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 16416,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16402,
"src": "34056:13:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16419,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "34091:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16417,
"name": "_reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16404,
"src": "34071:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16418,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "34071:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34071:35:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16423,
"name": "_reserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16406,
"src": "34129:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16421,
"name": "_poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16400,
"src": "34108:16:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16422,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "34108:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16424,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34108:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16409,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "34010:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 16425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34010:135:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16426,
"nodeType": "EmitStatement",
"src": "34005:140:26"
}
]
},
"documentation": {
"id": 16398,
"nodeType": "StructuredDocumentation",
"src": "33533:304:26",
"text": " @dev dispatches token rate update event for the pool token\n @param _poolTokenSupply total pool token supply\n @param _reserveToken address of the reserve token\n @param _reserveBalance reserve balance\n @param _reserveWeight reserve weight"
},
"id": 16428,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16407,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16400,
"mutability": "mutable",
"name": "_poolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33885:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16399,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33885:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16402,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33911:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16401,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "33911:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16404,
"mutability": "mutable",
"name": "_reserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33938:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16403,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33938:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16406,
"mutability": "mutable",
"name": "_reserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33963:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16405,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "33963:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33884:101:26"
},
"returnParameters": {
"id": 16408,
"nodeType": "ParameterList",
"parameters": [],
"src": "33994:0:26"
},
"scope": 16593,
"src": "33843:310:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16436,
"nodeType": "Block",
"src": "34319:29:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 16434,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -17,
"src": "34337:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16433,
"id": 16435,
"nodeType": "Return",
"src": "34330:10:26"
}
]
},
"documentation": {
"id": 16429,
"nodeType": "StructuredDocumentation",
"src": "34161:96:26",
"text": " @dev returns the current time\n utility to allow overrides for tests"
},
"id": 16437,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "time",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16430,
"nodeType": "ParameterList",
"parameters": [],
"src": "34276:2:26"
},
"returnParameters": {
"id": 16433,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16432,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16437,
"src": "34310:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16431,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34310:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34309:9:26"
},
"scope": 16593,
"src": "34263:85:26",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 16469,
"nodeType": "Block",
"src": "34709:122:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 16457,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16453,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16451,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34724:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16452,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34729:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "34724:9:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16456,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16454,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34737:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16455,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34742:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "34737:9:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "34724:22:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16464,
"nodeType": "IfStatement",
"src": "34720:77:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16459,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34784:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16460,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34788:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16461,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34792:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16458,
"name": "normalizedRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16521,
"src": "34768:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16462,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34768:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16450,
"id": 16463,
"nodeType": "Return",
"src": "34761:36:26"
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16465,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34816:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16466,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34820:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16467,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "34815:8:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16450,
"id": 16468,
"nodeType": "Return",
"src": "34808:15:26"
}
]
},
"documentation": {
"id": 16438,
"nodeType": "StructuredDocumentation",
"src": "34356:246:26",
"text": " @dev computes a reduced-scalar ratio\n @param _n ratio numerator\n @param _d ratio denominator\n @param _max maximum desired scalar\n @return ratio's numerator and denominator"
},
"id": 16470,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "reducedRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16445,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16440,
"mutability": "mutable",
"name": "_n",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34630:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16439,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34630:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16442,
"mutability": "mutable",
"name": "_d",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34642:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16441,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34642:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16444,
"mutability": "mutable",
"name": "_max",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34654:12:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16443,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34654:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34629:38:26"
},
"returnParameters": {
"id": 16450,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16447,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34691:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16446,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34691:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16449,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34700:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16448,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34700:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34690:18:26"
},
"scope": 16593,
"src": "34608:223:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 16520,
"nodeType": "Block",
"src": "35034:239:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16484,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35049:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 16485,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35055:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35049:8:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16495,
"nodeType": "IfStatement",
"src": "35045:58:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16487,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35080:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16488,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35089:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "35080:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16492,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16490,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35092:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16491,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35101:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "35092:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16493,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35079:24:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16494,
"nodeType": "Return",
"src": "35072:31:26"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16496,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35118:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 16497,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35123:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35118:7:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16505,
"nodeType": "IfStatement",
"src": "35114:62:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16500,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35161:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16501,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35165:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16502,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35169:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16499,
"name": "accurateRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16592,
"src": "35147:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16503,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35147:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16504,
"nodeType": "Return",
"src": "35140:36:26"
}
},
{
"assignments": [
16507,
16509
],
"declarations": [
{
"constant": false,
"id": 16507,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16520,
"src": "35188:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16506,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35188:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16509,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16520,
"src": "35199:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16508,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35199:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16515,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16511,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35226:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16512,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35230:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16513,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35234:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16510,
"name": "accurateRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16592,
"src": "35212:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35212:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35187:54:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16516,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16509,
"src": "35260:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16517,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16507,
"src": "35263:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16518,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35259:6:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16519,
"nodeType": "Return",
"src": "35252:13:26"
}
]
},
"documentation": {
"id": 16471,
"nodeType": "StructuredDocumentation",
"src": "34839:83:26",
"text": " @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\"."
},
"id": 16521,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "normalizedRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16478,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16473,
"mutability": "mutable",
"name": "_a",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34953:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16472,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34953:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16475,
"mutability": "mutable",
"name": "_b",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34965:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16474,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34965:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16477,
"mutability": "mutable",
"name": "_scale",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34977:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16476,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34952:40:26"
},
"returnParameters": {
"id": 16483,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16480,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "35016:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16479,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35016:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16482,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "35025:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16481,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35025:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35015:18:26"
},
"scope": 16593,
"src": "34928:345:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 16591,
"nodeType": "Block",
"src": "35497:300:26",
"statements": [
{
"assignments": [
16536
],
"declarations": [
{
"constant": false,
"id": 16536,
"mutability": "mutable",
"name": "maxVal",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35508:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16535,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35508:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16544,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16543,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16540,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "35533:2:26",
"subExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16539,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35534:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
],
"id": 16538,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "35525:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 16537,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35525:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16541,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35525:11:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 16542,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35539:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35525:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35508:37:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16547,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16545,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35560:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16546,
"name": "maxVal",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16536,
"src": "35565:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35560:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16568,
"nodeType": "IfStatement",
"src": "35556:121:26",
"trueBody": {
"id": 16567,
"nodeType": "Block",
"src": "35573:104:26",
"statements": [
{
"assignments": [
16549
],
"declarations": [
{
"constant": false,
"id": 16549,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16567,
"src": "35588:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16548,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35588:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16558,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16555,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16550,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35600:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16553,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16551,
"name": "maxVal",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16536,
"src": "35606:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16552,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35615:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "35606:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16554,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35605:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35600:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35620:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "35600:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35588:33:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16561,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16559,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35636:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 16560,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16549,
"src": "35642:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35636:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16562,
"nodeType": "ExpressionStatement",
"src": "35636:7:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16565,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16563,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16526,
"src": "35658:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 16564,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16549,
"src": "35664:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35658:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16566,
"nodeType": "ExpressionStatement",
"src": "35658:7:26"
}
]
}
},
{
"assignments": [
16570
],
"declarations": [
{
"constant": false,
"id": 16570,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35687:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16569,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35687:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16580,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16574,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16572,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35708:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 16573,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35713:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35708:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16577,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16526,
"src": "35728:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16575,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35721:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "35721:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16578,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35721:10:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16571,
"name": "roundDiv",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16251,
"src": "35699:8:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16579,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35699:33:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35687:45:26"
},
{
"assignments": [
16582
],
"declarations": [
{
"constant": false,
"id": 16582,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35743:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16581,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35743:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16586,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16583,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35755:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 16584,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16570,
"src": "35764:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35755:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35743:22:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16587,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16570,
"src": "35784:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16588,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16582,
"src": "35787:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16589,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35783:6:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16534,
"id": 16590,
"nodeType": "Return",
"src": "35776:13:26"
}
]
},
"documentation": {
"id": 16522,
"nodeType": "StructuredDocumentation",
"src": "35281:106:26",
"text": " @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\", assuming that \"a < b\"."
},
"id": 16592,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "accurateRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16529,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16524,
"mutability": "mutable",
"name": "_a",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35416:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16523,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35416:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16526,
"mutability": "mutable",
"name": "_b",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35428:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16525,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35428:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16528,
"mutability": "mutable",
"name": "_scale",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35440:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16527,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35440:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35415:40:26"
},
"returnParameters": {
"id": 16534,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16531,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35479:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16530,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35479:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16533,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35488:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16532,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35488:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35478:18:26"
},
"scope": 16593,
"src": "35393:404:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 16594,
"src": "519:35281:26"
}
],
"src": "52:35750:26"
},
"legacyAST": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol",
"exportedSymbols": {
"LiquidityPoolV1Converter": [
16593
]
},
"id": 16594,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 14420,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:26"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/LiquidityPoolConverter.sol",
"file": "../../LiquidityPoolConverter.sol",
"id": 14421,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 13078,
"src": "77:42:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "../../../token/interfaces/ISmartToken.sol",
"id": 14422,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 21517,
"src": "121:51:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/Types.sol",
"file": "../../../utility/Types.sol",
"id": 14423,
"nodeType": "ImportDirective",
"scope": 16594,
"sourceUnit": 22917,
"src": "174:36:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 14425,
"name": "LiquidityPoolConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13077,
"src": "556:22:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolConverter_$13077",
"typeString": "contract LiquidityPoolConverter"
}
},
"id": 14426,
"nodeType": "InheritanceSpecifier",
"src": "556:22:26"
}
],
"contractDependencies": [
10039,
13077,
13340,
22053,
22152,
22576,
22860,
22909,
22995,
23181,
23241
],
"contractKind": "contract",
"documentation": {
"id": 14424,
"nodeType": "StructuredDocumentation",
"src": "214:303:26",
"text": " @dev Liquidity Pool v1 Converter\n The liquidity pool v1 converter is a specialized version of a converter that manages\n a classic bancor liquidity pool.\n Even though pools can have many reserves, the standard pool configuration\n is 2 reserves with 50%/50% weights."
},
"fullyImplemented": true,
"id": 16593,
"linearizedBaseContracts": [
16593,
13077,
10039,
22576,
22053,
22909,
22995,
22152,
22860,
23241,
13340,
23181
],
"name": "LiquidityPoolV1Converter",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 14431,
"mutability": "mutable",
"name": "etherToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "586:89:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
},
"typeName": {
"contractScope": null,
"id": 14427,
"name": "IEtherToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21487,
"src": "586:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307863303832393432314331643236304244336342334530463036636645324435326462326345333135",
"id": 14429,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "632:42:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 14428,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21487,
"src": "620:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21487_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 14430,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "620:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"visibility": "internal"
},
{
"constant": true,
"id": 14434,
"mutability": "constant",
"name": "MAX_RATE_FACTOR_LOWER_BOUND",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "682:60:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14432,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "682:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31653330",
"id": 14433,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "738:4:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000000000000000000000000000_by_1",
"typeString": "int_const 1000000000000000000000000000000"
},
"value": "1e30"
},
"visibility": "internal"
},
{
"constant": true,
"id": 14437,
"mutability": "constant",
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "842:57:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14435,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "842:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3130",
"id": 14436,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "889:10:26",
"subdenomination": "minutes",
"typeDescriptions": {
"typeIdentifier": "t_rational_600_by_1",
"typeString": "int_const 600"
},
"value": "10"
},
"visibility": "private"
},
{
"constant": false,
"functionSelector": "38e9f27a",
"id": 14440,
"mutability": "mutable",
"name": "isStandardPool",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "989:34:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 14438,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "989:4:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 14439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1018:5:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "e2c52468",
"id": 14442,
"mutability": "mutable",
"name": "prevAverageRate",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "1068:31:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14441,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "1068:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "1d4db791",
"id": 14444,
"mutability": "mutable",
"name": "prevAverageRateUpdateTime",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16593,
"src": "1206:40:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14443,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1206:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 14445,
"nodeType": "StructuredDocumentation",
"src": "1316:361:26",
"text": " @dev triggered after a conversion with new price data\n deprecated, use `TokenRateUpdate` from version 28 and up\n @param _connectorToken reserve token\n @param _tokenSupply smart token supply\n @param _connectorBalance reserve balance\n @param _connectorWeight reserve weight"
},
"id": 14455,
"name": "PriceDataUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 14454,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14447,
"indexed": true,
"mutability": "mutable",
"name": "_connectorToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1715:35:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14446,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "1715:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14449,
"indexed": false,
"mutability": "mutable",
"name": "_tokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1761:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14448,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1761:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14451,
"indexed": false,
"mutability": "mutable",
"name": "_connectorBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1792:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14450,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1792:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14453,
"indexed": false,
"mutability": "mutable",
"name": "_connectorWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14455,
"src": "1828:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14452,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1828:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1704:154:26"
},
"src": "1683:176:26"
},
{
"body": {
"id": 14470,
"nodeType": "Block",
"src": "2402:8:26",
"statements": []
},
"documentation": {
"id": 14456,
"nodeType": "StructuredDocumentation",
"src": "1867:317:26",
"text": " @dev initializes a new LiquidityPoolV1Converter instance\n @param _token pool token governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 14471,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 14465,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14458,
"src": "2343:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14466,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14460,
"src": "2351:9:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
}
},
{
"argumentTypes": null,
"id": 14467,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14462,
"src": "2362:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 14468,
"modifierName": {
"argumentTypes": null,
"id": 14464,
"name": "LiquidityPoolConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13077,
"src": "2320:22:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_LiquidityPoolConverter_$13077_$",
"typeString": "type(contract LiquidityPoolConverter)"
}
},
"nodeType": "ModifierInvocation",
"src": "2320:60:26"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14463,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14458,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2212:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
},
"typeName": {
"contractScope": null,
"id": 14457,
"name": "ISmartToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21516,
"src": "2212:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14460,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2241:27:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 14459,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 23165,
"src": "2241:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$23165",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14462,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14471,
"src": "2279:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14461,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2279:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2201:109:26"
},
"returnParameters": {
"id": 14469,
"nodeType": "ParameterList",
"parameters": [],
"src": "2402:0:26"
},
"scope": 16593,
"src": "2190:220:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9242
],
"body": {
"id": 14480,
"nodeType": "Block",
"src": "2618:27:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14478,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2636:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"functionReturnParameters": 14477,
"id": 14479,
"nodeType": "Return",
"src": "2629:8:26"
}
]
},
"documentation": {
"id": 14472,
"nodeType": "StructuredDocumentation",
"src": "2418:131:26",
"text": " @dev returns the converter type\n @return see the converter types in the the main contract doc"
},
"functionSelector": "3e8ff43f",
"id": 14481,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14474,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2592:8:26"
},
"parameters": {
"id": 14473,
"nodeType": "ParameterList",
"parameters": [],
"src": "2577:2:26"
},
"returnParameters": {
"id": 14477,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14476,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14481,
"src": "2610:6:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 14475,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "2610:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2609:8:26"
},
"scope": 16593,
"src": "2555:90:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13076
],
"body": {
"id": 14500,
"nodeType": "Block",
"src": "2977:107:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 14488,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "2988:5:26",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidityPoolV1Converter_$16593",
"typeString": "contract super LiquidityPoolV1Converter"
}
},
"id": 14490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptAnchorOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 13076,
"src": "2988:27:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 14491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2988:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14492,
"nodeType": "ExpressionStatement",
"src": "2988:29:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14494,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [
14481
],
"referencedDeclaration": 14481,
"src": "3046:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 14495,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3046:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 14496,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3063:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 14497,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3071:4:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14493,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "3035:10:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 14498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3035:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14499,
"nodeType": "EmitStatement",
"src": "3030:46:26"
}
]
},
"documentation": {
"id": 14482,
"nodeType": "StructuredDocumentation",
"src": "2653:259:26",
"text": " @dev accepts ownership of the anchor after an ownership transfer\n also activates the converter\n can only be called by the contract owner\n note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"functionSelector": "cdc91c69",
"id": 14501,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14486,
"modifierName": {
"argumentTypes": null,
"id": 14485,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22088,
"src": "2967:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2967:9:26"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14484,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2958:8:26"
},
"parameters": {
"id": 14483,
"nodeType": "ParameterList",
"parameters": [],
"src": "2948:2:26"
},
"returnParameters": {
"id": 14487,
"nodeType": "ParameterList",
"parameters": [],
"src": "2977:0:26"
},
"scope": 16593,
"src": "2918:166:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9664
],
"body": {
"id": 14544,
"nodeType": "Block",
"src": "3458:240:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14515,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14504,
"src": "3486:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14516,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14506,
"src": "3494:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 14512,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "3469:5:26",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidityPoolV1Converter_$16593",
"typeString": "contract super LiquidityPoolV1Converter"
}
},
"id": 14514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "addReserve",
"nodeType": "MemberAccess",
"referencedDeclaration": 9664,
"src": "3469:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint32)"
}
},
"id": 14517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3469:33:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14518,
"nodeType": "ExpressionStatement",
"src": "3469:33:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14519,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "3515:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14532,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14520,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3545:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3545:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 14522,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3569:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "3545:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 14531,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14524,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3587:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14528,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14525,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3596:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14527,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3610:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3596:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3587:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14529,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "3587:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "353030303030",
"id": 14530,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3624:6:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_500000_by_1",
"typeString": "int_const 500000"
},
"value": "500000"
},
"src": "3587:43:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3545:85:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 14540,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14533,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3647:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14537,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14534,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "3656:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14536,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14535,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3670:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3656:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3647:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14538,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "3647:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "353030303030",
"id": 14539,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3684:6:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_500000_by_1",
"typeString": "int_const 500000"
},
"value": "500000"
},
"src": "3647:43:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3545:145:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3515:175:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 14543,
"nodeType": "ExpressionStatement",
"src": "3515:175:26"
}
]
},
"documentation": {
"id": 14502,
"nodeType": "StructuredDocumentation",
"src": "3092:278:26",
"text": " @dev defines a new reserve token for the converter\n can only be called by the owner while the converter is inactive\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 14545,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14510,
"modifierName": {
"argumentTypes": null,
"id": 14509,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22088,
"src": "3448:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3448:9:26"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14508,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3439:8:26"
},
"parameters": {
"id": 14507,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14504,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14545,
"src": "3396:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14503,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "3396:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14506,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14545,
"src": "3416:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 14505,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3416:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3395:36:26"
},
"returnParameters": {
"id": 14511,
"nodeType": "ParameterList",
"parameters": [],
"src": "3458:0:26"
},
"scope": 16593,
"src": "3376:322:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9256
],
"body": {
"id": 14612,
"nodeType": "Block",
"src": "4407:574:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14571,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14569,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4453:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 14570,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4469:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "4453:28:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f53414d455f534f555243455f544152474554",
"id": 14572,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4483:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
},
"value": "ERR_SAME_SOURCE_TARGET"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
}
],
"id": 14568,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "4445:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4445:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14574,
"nodeType": "ExpressionStatement",
"src": "4445:63:26"
},
{
"assignments": [
14576
],
"declarations": [
{
"constant": false,
"id": 14576,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14612,
"src": "4521:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14575,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4521:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14599,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14584,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4634:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14583,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4619:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4619:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14586,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4662:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14588,
"indexExpression": {
"argumentTypes": null,
"id": 14587,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4671:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4662:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14589,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4662:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14591,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4721:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14590,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4706:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14592,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4706:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14593,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4749:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14595,
"indexExpression": {
"argumentTypes": null,
"id": 14594,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4758:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4749:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14596,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4749:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14597,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14552,
"src": "4793:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14579,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "4563:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14578,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "4553:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14580,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4553:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14577,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "4538:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14581,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4538:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14582,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "crossReserveTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13120,
"src": "4538:66:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint32_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint32,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 14598,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4538:273:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4521:290:26"
},
{
"assignments": [
14601
],
"declarations": [
{
"constant": false,
"id": 14601,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14612,
"src": "4902:11:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14600,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4902:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14605,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14603,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14576,
"src": "4929:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14602,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "4916:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4916:20:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4902:34:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14608,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14606,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14576,
"src": "4955:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14607,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14601,
"src": "4964:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4955:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14609,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14601,
"src": "4969:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14610,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "4954:19:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14567,
"id": 14611,
"nodeType": "Return",
"src": "4947:26:26"
}
]
},
"documentation": {
"id": 14546,
"nodeType": "StructuredDocumentation",
"src": "3706:421:26",
"text": " @dev returns the expected target amount of converting one reserve to another along with the fee\n @param _sourceToken contract address of the source reserve token\n @param _targetToken contract address of the target reserve token\n @param _amount amount of tokens received from the user\n @return expected target amount\n @return expected fee"
},
"functionSelector": "af94b8d8",
"id": 14613,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14556,
"modifierName": {
"argumentTypes": null,
"id": 14555,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "4287:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4287:6:26"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 14558,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14548,
"src": "4316:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"id": 14559,
"modifierName": {
"argumentTypes": null,
"id": 14557,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "4303:12:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21461_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "4303:26:26"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 14561,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14550,
"src": "4352:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"id": 14562,
"modifierName": {
"argumentTypes": null,
"id": 14560,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "4339:12:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21461_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "4339:26:26"
}
],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14554,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "4269:8:26"
},
"parameters": {
"id": 14553,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14548,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4161:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14547,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "4161:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14550,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4187:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14549,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "4187:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14552,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4213:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14551,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4213:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4160:69:26"
},
"returnParameters": {
"id": 14567,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14564,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4384:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14563,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14566,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14613,
"src": "4393:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14565,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4393:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4383:18:26"
},
"scope": 16593,
"src": "4133:848:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9789
],
"body": {
"id": 14757,
"nodeType": "Block",
"src": "5767:1649:26",
"statements": [
{
"assignments": [
14631,
14633
],
"declarations": [
{
"constant": false,
"id": 14631,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14757,
"src": "5826:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14630,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5826:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14633,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14757,
"src": "5842:11:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14632,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5842:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14639,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14635,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "5876:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14636,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "5890:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14637,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "5904:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14634,
"name": "targetAmountAndFee",
"nodeType": "Identifier",
"overloadedDeclarations": [
14613
],
"referencedDeclaration": 14613,
"src": "5857:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 14638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5857:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5825:87:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14643,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14641,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "5993:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14642,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6003:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5993:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14644,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6006:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 14640,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "5985:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5985:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14646,
"nodeType": "ExpressionStatement",
"src": "5985:46:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14652,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14648,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6119:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14650,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6143:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14649,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6128:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6128:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6119:37:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14647,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "6112:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 14653,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6112:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14654,
"nodeType": "ExpressionStatement",
"src": "6112:45:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14655,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6237:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14656,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "6253:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "6237:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14685,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14670,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14667,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "6380:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14668,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6380:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14669,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6393:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "6380:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14684,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14680,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6455:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14679,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6440:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14681,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6440:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14675,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "6429:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 14674,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6421:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14673,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6421:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6421:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 14671,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6398:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 14672,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21422,
"src": "6398:22:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14677,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6398:37:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14678,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "6398:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14682,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6398:71:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14683,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "6473:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6398:82:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6380:100:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14686,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6482:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 14666,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6372:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14687,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6372:131:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14688,
"nodeType": "ExpressionStatement",
"src": "6372:131:26"
},
"id": 14689,
"nodeType": "IfStatement",
"src": "6233:270:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14662,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14659,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "6295:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14660,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6295:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14661,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "6308:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6295:20:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14663,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6317:25:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
},
"value": "ERR_ETH_AMOUNT_MISMATCH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
}
],
"id": 14658,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6287:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14664,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6287:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14665,
"nodeType": "ExpressionStatement",
"src": "6287:56:26"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14691,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "6573:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14690,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "6554:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 14692,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6554:32:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14693,
"nodeType": "ExpressionStatement",
"src": "6554:32:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14694,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6597:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14696,
"indexExpression": {
"argumentTypes": null,
"id": 14695,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6606:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6597:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14697,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "6597:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14703,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6665:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14698,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6630:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14700,
"indexExpression": {
"argumentTypes": null,
"id": 14699,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6639:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6630:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14701,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "6630:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14702,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "6630:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6630:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6597:75:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14706,
"nodeType": "ExpressionStatement",
"src": "6597:75:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14707,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6759:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14708,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "6775:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "6759:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14717,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "6880:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14718,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14624,
"src": "6894:12:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14719,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6908:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14716,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22809,
"src": "6867:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 14720,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6867:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14721,
"nodeType": "ExpressionStatement",
"src": "6867:48:26"
},
"id": 14722,
"nodeType": "IfStatement",
"src": "6755:160:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14713,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "6831:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14710,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14624,
"src": "6809:12:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 14712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6809:21:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 14714,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6809:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14715,
"nodeType": "ExpressionStatement",
"src": "6809:29:26"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14728,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14723,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "6975:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14727,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14724,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "6993:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14725,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "7021:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14726,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7021:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6993:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6975:52:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14740,
"nodeType": "IfStatement",
"src": "6971:171:26",
"trueBody": {
"id": 14739,
"nodeType": "Block",
"src": "7029:113:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 14732,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14729,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "7044:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14730,
"name": "recentAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14908,
"src": "7062:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_struct$_Fraction_$22916_memory_ptr_$",
"typeString": "function () view returns (struct Fraction memory)"
}
},
"id": 14731,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7062:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"src": "7044:37:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"id": 14733,
"nodeType": "ExpressionStatement",
"src": "7044:37:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14737,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 14734,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "7096:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14735,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "7124:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14736,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7124:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7096:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14738,
"nodeType": "ExpressionStatement",
"src": "7096:34:26"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14742,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "7220:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14743,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "7234:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14744,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14622,
"src": "7248:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14745,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14620,
"src": "7257:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14746,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "7266:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14747,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14633,
"src": "7274:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14741,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "7196:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7196:82:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14749,
"nodeType": "ExpressionStatement",
"src": "7196:82:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14751,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14616,
"src": "7355:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14752,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14618,
"src": "7369:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 14750,
"name": "dispatchTokenRateUpdateEvents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16397,
"src": "7325:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token)"
}
},
"id": 14753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7325:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14754,
"nodeType": "ExpressionStatement",
"src": "7325:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14755,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14631,
"src": "7402:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14629,
"id": 14756,
"nodeType": "Return",
"src": "7395:13:26"
}
]
},
"documentation": {
"id": 14614,
"nodeType": "StructuredDocumentation",
"src": "4989:569:26",
"text": " @dev converts a specific amount of source tokens to target tokens\n can only be called by the bancor network contract\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"id": 14758,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 14626,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "5726:8:26"
},
"parameters": {
"id": 14625,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14616,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5583:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14615,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "5583:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14618,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5609:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14617,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "5609:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14620,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5635:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14619,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5635:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14622,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5652:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14621,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5652:7:26",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14624,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5669:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 14623,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5669:15:26",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5582:116:26"
},
"returnParameters": {
"id": 14629,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14628,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14758,
"src": "5753:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14627,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5753:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5752:9:26"
},
"scope": 16593,
"src": "5564:1852:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14797,
"nodeType": "Block",
"src": "7904:348:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14769,
"name": "isStandardPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14440,
"src": "7968:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f4e5f5354414e444152445f504f4f4c",
"id": 14770,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7984:23:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_bc9141faf76a54775cecd0a0d87b229f48265d7ddb667bb1d0e384e600638f7c",
"typeString": "literal_string \"ERR_NON_STANDARD_POOL\""
},
"value": "ERR_NON_STANDARD_POOL"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_bc9141faf76a54775cecd0a0d87b229f48265d7ddb667bb1d0e384e600638f7c",
"typeString": "literal_string \"ERR_NON_STANDARD_POOL\""
}
],
"id": 14768,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7960:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14771,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7960:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14772,
"nodeType": "ExpressionStatement",
"src": "7960:48:26"
},
{
"assignments": [
14774
],
"declarations": [
{
"constant": false,
"id": 14774,
"mutability": "mutable",
"name": "rate",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14797,
"src": "8074:20:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14773,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "8074:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14777,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14775,
"name": "recentAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14908,
"src": "8097:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_struct$_Fraction_$22916_memory_ptr_$",
"typeString": "function () view returns (struct Fraction memory)"
}
},
"id": 14776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8097:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8074:42:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14778,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14761,
"src": "8131:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14779,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8141:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14781,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14780,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8155:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8141:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "8131:26:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14790,
"nodeType": "IfStatement",
"src": "8127:82:26",
"trueBody": {
"id": 14789,
"nodeType": "Block",
"src": "8159:50:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14783,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8182:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14784,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "8182:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14785,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8190:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14786,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "8190:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14787,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8181:16:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14767,
"id": 14788,
"nodeType": "Return",
"src": "8174:23:26"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14791,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8229:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14792,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "8229:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14793,
"name": "rate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14774,
"src": "8237:4:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14794,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "8237:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14795,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8228:16:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14767,
"id": 14796,
"nodeType": "Return",
"src": "8221:23:26"
}
]
},
"documentation": {
"id": 14759,
"nodeType": "StructuredDocumentation",
"src": "7424:386:26",
"text": " @dev returns the recent average rate of 1 `_token` in the other reserve token units\n note that the rate can only be queried for reserves in a standard pool\n @param _token token to get the rate for\n @return recent average rate between the reserves (numerator)\n @return recent average rate between the reserves (denominator)"
},
"functionSelector": "1f0181bc",
"id": 14798,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "recentAverageRate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14762,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14761,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7843:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14760,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "7843:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7842:20:26"
},
"returnParameters": {
"id": 14767,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14764,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7886:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14763,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7886:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14766,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14798,
"src": "7895:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14765,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7895:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7885:18:26"
},
"scope": 16593,
"src": "7816:436:26",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": {
"id": 14907,
"nodeType": "Block",
"src": "8505:1634:26",
"statements": [
{
"assignments": [
14805
],
"declarations": [
{
"constant": false,
"id": 14805,
"mutability": "mutable",
"name": "timeElapsed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8596:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8596:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14810,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 14806,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16437,
"src": "8618:4:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 14807,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8618:6:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14808,
"name": "prevAverageRateUpdateTime",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14444,
"src": "8627:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8618:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8596:56:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14811,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "8757:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14812,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8772:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8757:16:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14817,
"nodeType": "IfStatement",
"src": "8753:71:26",
"trueBody": {
"id": 14816,
"nodeType": "Block",
"src": "8775:49:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 14814,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "8797:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"functionReturnParameters": 14803,
"id": 14815,
"nodeType": "Return",
"src": "8790:22:26"
}
]
}
},
{
"assignments": [
14819
],
"declarations": [
{
"constant": false,
"id": 14819,
"mutability": "mutable",
"name": "currentRateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8890:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14818,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8890:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14826,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14820,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8913:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14824,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14821,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8922:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14823,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 14822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8936:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8922:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8913:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14825,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "8913:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8890:57:26"
},
{
"assignments": [
14828
],
"declarations": [
{
"constant": false,
"id": 14828,
"mutability": "mutable",
"name": "currentRateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "8958:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14827,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8958:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14835,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14829,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8981:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14833,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14830,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8990:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14832,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14831,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9004:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8990:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8981:26:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14834,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "8981:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8958:57:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14836,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9147:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14837,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9162:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9147:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14845,
"nodeType": "IfStatement",
"src": "9143:120:26",
"trueBody": {
"id": 14844,
"nodeType": "Block",
"src": "9183:80:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14840,
"name": "currentRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14819,
"src": "9219:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14841,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9236:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14839,
"name": "Fraction",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22916,
"src": "9205:8:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Fraction_$22916_storage_ptr_$",
"typeString": "type(struct Fraction storage pointer)"
}
},
"id": 14842,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"n",
"d"
],
"nodeType": "FunctionCall",
"src": "9205:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"functionReturnParameters": 14803,
"id": 14843,
"nodeType": "Return",
"src": "9198:53:26"
}
]
}
},
{
"assignments": [
14847
],
"declarations": [
{
"constant": false,
"id": 14847,
"mutability": "mutable",
"name": "prevAverage",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9546:27:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14846,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "9546:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14849,
"initialValue": {
"argumentTypes": null,
"id": 14848,
"name": "prevAverageRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14442,
"src": "9576:15:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage",
"typeString": "struct Fraction storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9546:45:26"
},
{
"assignments": [
14851
],
"declarations": [
{
"constant": false,
"id": 14851,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9604:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14850,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9604:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14857,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14855,
"name": "currentRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14819,
"src": "9634:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14852,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9616:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14853,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "9616:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14854,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9616:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14856,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9616:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9604:43:26"
},
{
"assignments": [
14859
],
"declarations": [
{
"constant": false,
"id": 14859,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9658:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14858,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9658:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14865,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14863,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9688:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14860,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9670:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14861,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "n",
"nodeType": "MemberAccess",
"referencedDeclaration": 22913,
"src": "9670:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14862,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9670:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14864,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9670:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9658:43:26"
},
{
"assignments": [
14867
],
"declarations": [
{
"constant": false,
"id": 14867,
"mutability": "mutable",
"name": "newRateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9809:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14866,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9809:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14880,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14877,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9879:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14875,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14851,
"src": "9873:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14876,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9873:5:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14878,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9873:18:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14872,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14870,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9834:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14871,
"name": "timeElapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14805,
"src": "9856:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9834:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14868,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14859,
"src": "9828:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14869,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9828:5:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14873,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9828:40:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "9828:44:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14879,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9828:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9809:83:26"
},
{
"assignments": [
14882
],
"declarations": [
{
"constant": false,
"id": 14882,
"mutability": "mutable",
"name": "newRateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14907,
"src": "9903:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14881,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9903:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14891,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14889,
"name": "AVERAGE_RATE_PERIOD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14437,
"src": "9958:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14886,
"name": "currentRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14828,
"src": "9940:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14883,
"name": "prevAverage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14847,
"src": "9922:11:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"id": 14884,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "d",
"nodeType": "MemberAccess",
"referencedDeclaration": 22915,
"src": "9922:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9922:17:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14887,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9922:31:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14888,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "9922:35:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 14890,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9922:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9903:75:26"
},
{
"expression": {
"argumentTypes": null,
"id": 14900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 14892,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "9992:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14893,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10002:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14894,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "9991:20:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14896,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "10027:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14897,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10037:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14898,
"name": "MAX_RATE_FACTOR_LOWER_BOUND",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14434,
"src": "10047:27:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14895,
"name": "reducedRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16470,
"src": "10014:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 14899,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10014:61:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"src": "9991:84:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14901,
"nodeType": "ExpressionStatement",
"src": "9991:84:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14903,
"name": "newRateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14867,
"src": "10107:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14904,
"name": "newRateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14882,
"src": "10120:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14902,
"name": "Fraction",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22916,
"src": "10093:8:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Fraction_$22916_storage_ptr_$",
"typeString": "type(struct Fraction storage pointer)"
}
},
"id": 14905,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"n",
"d"
],
"nodeType": "FunctionCall",
"src": "10093:38:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction memory"
}
},
"functionReturnParameters": 14803,
"id": 14906,
"nodeType": "Return",
"src": "10086:45:26"
}
]
},
"documentation": {
"id": 14799,
"nodeType": "StructuredDocumentation",
"src": "8260:170:26",
"text": " @dev returns the recent average rate of 1 reserve token 0 in reserve token 1 units\n @return recent average rate between the reserves"
},
"id": 14908,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "recentAverageRate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14800,
"nodeType": "ParameterList",
"parameters": [],
"src": "8462:2:26"
},
"returnParameters": {
"id": 14803,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14802,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14908,
"src": "8488:15:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_memory_ptr",
"typeString": "struct Fraction"
},
"typeName": {
"contractScope": null,
"id": 14801,
"name": "Fraction",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22916,
"src": "8488:8:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Fraction_$22916_storage_ptr",
"typeString": "struct Fraction"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8487:17:26"
},
"scope": 16593,
"src": "8436:1703:26",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 15014,
"nodeType": "Block",
"src": "10789:1325:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14927,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "10855:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 14928,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "10871:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 14929,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14917,
"src": "10888:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14926,
"name": "verifyLiquidityInput",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15634,
"src": "10834:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) view"
}
},
"id": 14930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10834:65:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14931,
"nodeType": "ExpressionStatement",
"src": "10834:65:26"
},
{
"body": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 14947,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14943,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11100:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 14945,
"indexExpression": {
"argumentTypes": null,
"id": 14944,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11115:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11100:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14946,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "11121:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "11100:40:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14958,
"nodeType": "IfStatement",
"src": "11096:130:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14954,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14949,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "11167:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 14951,
"indexExpression": {
"argumentTypes": null,
"id": 14950,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11183:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11167:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14952,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "11189:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11189:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11167:31:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14955,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11200:25:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
},
"value": "ERR_ETH_AMOUNT_MISMATCH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b27c160ac497b67c4fef6b5554e0b1a41f3c9b44e4bd8482662df760b76c093b",
"typeString": "literal_string \"ERR_ETH_AMOUNT_MISMATCH\""
}
],
"id": 14948,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11159:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11159:67:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14957,
"nodeType": "ExpressionStatement",
"src": "11159:67:26"
}
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14939,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14936,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11051:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14937,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11055:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 14938,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11055:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11051:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 14959,
"initializationExpression": {
"assignments": [
14933
],
"declarations": [
{
"constant": false,
"id": 14933,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14959,
"src": "11036:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14932,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11036:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14935,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 14934,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11048:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "11036:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 14941,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "11078:3:26",
"subExpression": {
"argumentTypes": null,
"id": 14940,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14933,
"src": "11078:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14942,
"nodeType": "ExpressionStatement",
"src": "11078:3:26"
},
"nodeType": "ForStatement",
"src": "11031:195:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14960,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "11346:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "11346:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14962,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11358:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "11346:13:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14973,
"nodeType": "IfStatement",
"src": "11342:112:26",
"trueBody": {
"id": 14972,
"nodeType": "Block",
"src": "11361:93:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14965,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "11384:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14967,
"indexExpression": {
"argumentTypes": null,
"id": 14966,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "11393:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11384:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14968,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "11384:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f5f4554485f52455345525645",
"id": 14969,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11421:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_467f328539cc1e1b7e8c0e459b4245a158bd2d844c358525ec924cd65d4df604",
"typeString": "literal_string \"ERR_NO_ETH_RESERVE\""
},
"value": "ERR_NO_ETH_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_467f328539cc1e1b7e8c0e459b4245a158bd2d844c358525ec924cd65d4df604",
"typeString": "literal_string \"ERR_NO_ETH_RESERVE\""
}
],
"id": 14964,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11376:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14970,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11376:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14971,
"nodeType": "ExpressionStatement",
"src": "11376:66:26"
}
]
}
},
{
"assignments": [
14975
],
"declarations": [
{
"constant": false,
"id": 14975,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15014,
"src": "11499:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14974,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11499:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14984,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14979,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11541:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14978,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "11533:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14977,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11533:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11533:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14976,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "11521:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14981,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11521:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 14982,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "11521:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14983,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11521:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11499:64:26"
},
{
"assignments": [
14986
],
"declarations": [
{
"constant": false,
"id": 14986,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15014,
"src": "11669:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14985,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11669:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14992,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14988,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14912,
"src": "11705:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 14989,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14915,
"src": "11721:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 14990,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14975,
"src": "11738:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14987,
"name": "addLiquidityToPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15664,
"src": "11686:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) returns (uint256)"
}
},
"id": 14991,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11686:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11669:81:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14996,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14994,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "11877:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14995,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14917,
"src": "11887:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "11877:20:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f52455455524e5f544f4f5f4c4f57",
"id": 14997,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11899:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
},
"value": "ERR_RETURN_TOO_LOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
}
],
"id": 14993,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11869:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14998,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11869:51:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14999,
"nodeType": "ExpressionStatement",
"src": "11869:51:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15007,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "12009:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15008,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "12009:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15009,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "12021:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15003,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11994:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15002,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "11986:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15001,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11986:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11986:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15000,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "11974:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15005,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11974:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15006,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21508,
"src": "11974:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15010,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11974:54:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15011,
"nodeType": "ExpressionStatement",
"src": "11974:54:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15012,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14986,
"src": "12100:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14925,
"id": 15013,
"nodeType": "Return",
"src": "12093:13:26"
}
]
},
"documentation": {
"id": 14909,
"nodeType": "StructuredDocumentation",
"src": "10147:423:26",
"text": " @dev increases the pool's liquidity and mints new shares in the pool to the caller\n note that prior to version 28, you should use 'fund' instead\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _minReturn token minimum return-amount\n @return amount of pool tokens issued"
},
"functionSelector": "7d8916bd",
"id": 15015,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14920,
"modifierName": {
"argumentTypes": null,
"id": 14919,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "10731:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10731:9:26"
},
{
"arguments": null,
"id": 14922,
"modifierName": {
"argumentTypes": null,
"id": 14921,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "10750:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10750:6:26"
}
],
"name": "addLiquidity",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14918,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14912,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10598:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 14910,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "10598:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 14911,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10598:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14915,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10635:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 14913,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10635:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14914,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10635:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14917,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10669:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14916,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10669:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10597:91:26"
},
"returnParameters": {
"id": 14925,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14924,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15015,
"src": "10775:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14923,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10775:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10774:9:26"
},
"scope": 16593,
"src": "10576:1538:26",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15070,
"nodeType": "Block",
"src": "12837:569:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15035,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15021,
"src": "12903:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15036,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15024,
"src": "12919:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15037,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "12945:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15034,
"name": "verifyLiquidityInput",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15634,
"src": "12882:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) view"
}
},
"id": 15038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12882:71:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15039,
"nodeType": "ExpressionStatement",
"src": "12882:71:26"
},
{
"assignments": [
15041
],
"declarations": [
{
"constant": false,
"id": 15041,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15070,
"src": "13033:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15040,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13033:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15050,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15045,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "13075:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15044,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "13067:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15043,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13067:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15046,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13067:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15042,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "13055:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15047,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13055:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15048,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "13055:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15049,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13055:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13033:64:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15058,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "13183:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15059,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "13183:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15060,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "13195:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15054,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "13166:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15053,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "13158:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15052,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13158:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15055,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13158:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15051,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "13146:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13146:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15057,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21515,
"src": "13146:36:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13146:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15062,
"nodeType": "ExpressionStatement",
"src": "13146:57:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15064,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15021,
"src": "13335:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15065,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15024,
"src": "13351:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15066,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15041,
"src": "13377:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15067,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15018,
"src": "13390:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15063,
"name": "removeLiquidityFromPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16125,
"src": "13311:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256,uint256) returns (uint256[] memory)"
}
},
"id": 15068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13311:87:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15033,
"id": 15069,
"nodeType": "Return",
"src": "13304:94:26"
}
]
},
"documentation": {
"id": 15016,
"nodeType": "StructuredDocumentation",
"src": "12122:495:26",
"text": " @dev decreases the pool's liquidity and burns the caller's shares in the pool\n note that prior to version 28, you should use 'liquidate' instead\n @param _amount token amount\n @param _reserveTokens address of each reserve token\n @param _reserveMinReturnAmounts minimum return-amount of each reserve token\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"functionSelector": "b127c0a5",
"id": 15071,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15027,
"modifierName": {
"argumentTypes": null,
"id": 15026,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "12770:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12770:9:26"
},
{
"arguments": null,
"id": 15029,
"modifierName": {
"argumentTypes": null,
"id": 15028,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "12789:6:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12789:6:26"
}
],
"name": "removeLiquidity",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15025,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15018,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12648:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15017,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12648:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15021,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12665:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15019,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "12665:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15020,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12665:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15024,
"mutability": "mutable",
"name": "_reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12702:41:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15022,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12702:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15023,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12702:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12647:97:26"
},
"returnParameters": {
"id": 15033,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15032,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15071,
"src": "12814:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15030,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12814:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15031,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12814:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12813:18:26"
},
"scope": 16593,
"src": "12623:783:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15276,
"nodeType": "Block",
"src": "14008:2368:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 15081,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "14019:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 15082,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14019:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15083,
"nodeType": "ExpressionStatement",
"src": "14019:21:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15096,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15084,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14051:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15086,
"indexExpression": {
"argumentTypes": null,
"id": 15085,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14060:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14051:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15087,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14051:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15093,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "14133:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15094,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14133:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15088,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14091:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15090,
"indexExpression": {
"argumentTypes": null,
"id": 15089,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14100:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14091:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15091,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14091:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "14091:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15095,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14091:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14051:92:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15097,
"nodeType": "ExpressionStatement",
"src": "14051:92:26"
},
{
"assignments": [
15099
],
"declarations": [
{
"constant": false,
"id": 15099,
"mutability": "mutable",
"name": "supply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14156:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15098,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14156:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15108,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15103,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "14193:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15102,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14185:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15101,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14185:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14185:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15100,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "14173:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15105,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14173:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "14173:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15107,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14173:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14156:59:26"
},
{
"assignments": [
15110
],
"declarations": [
{
"constant": false,
"id": 15110,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14226:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15109,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "14226:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15116,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15113,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "14276:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15112,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "14266:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14266:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15111,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "14251:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15115,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14251:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14226:66:26"
},
{
"assignments": [
15118
],
"declarations": [
{
"constant": false,
"id": 15118,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15276,
"src": "14496:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15117,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14496:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15121,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15119,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14519:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14519:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14496:43:26"
},
{
"body": {
"id": 15260,
"nodeType": "Block",
"src": "14593:1569:26",
"statements": [
{
"assignments": [
15133
],
"declarations": [
{
"constant": false,
"id": 15133,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14608:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15132,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "14608:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15137,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15134,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14635:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15136,
"indexExpression": {
"argumentTypes": null,
"id": 15135,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14649:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14635:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14608:43:26"
},
{
"assignments": [
15139
],
"declarations": [
{
"constant": false,
"id": 15139,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14666:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15138,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14666:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15144,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15140,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "14687:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15142,
"indexExpression": {
"argumentTypes": null,
"id": 15141,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "14696:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14687:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15143,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "14687:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14666:51:26"
},
{
"assignments": [
15146
],
"declarations": [
{
"constant": false,
"id": 15146,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "14732:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15145,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14732:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15154,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15149,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15099,
"src": "14773:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15150,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15139,
"src": "14781:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15151,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "14793:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15152,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "14807:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15147,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15110,
"src": "14756:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "14756:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14756:59:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14732:83:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15155,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "14904:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 15156,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "14920:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "14904:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 15218,
"nodeType": "Block",
"src": "15409:107:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15208,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15445:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15209,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15459:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15459:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15213,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "15479:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15212,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15471:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15211,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15471:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15214,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15471:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15215,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15486:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15207,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "15428:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15216,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15428:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15217,
"nodeType": "ExpressionStatement",
"src": "15428:72:26"
}
]
},
"id": 15219,
"nodeType": "IfStatement",
"src": "14900:616:26",
"trueBody": {
"id": 15206,
"nodeType": "Block",
"src": "14941:449:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15161,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15158,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "14964:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14964:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 15160,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "14976:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14964:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15174,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15107:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15175,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15107:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15176,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15119:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15107:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15204,
"nodeType": "IfStatement",
"src": "15103:272:26",
"trueBody": {
"id": 15203,
"nodeType": "Block",
"src": "15134:241:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15182,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15179,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15165:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15165:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15181,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15178:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "15165:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f4554485f56414c5545",
"id": 15183,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15181:23:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e220b3a28f19681b7484bf734e3fcd080dc85319844b89942d75a3bc56505e89",
"typeString": "literal_string \"ERR_INVALID_ETH_VALUE\""
},
"value": "ERR_INVALID_ETH_VALUE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e220b3a28f19681b7484bf734e3fcd080dc85319844b89942d75a3bc56505e89",
"typeString": "literal_string \"ERR_INVALID_ETH_VALUE\""
}
],
"id": 15178,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15157:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15157:48:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15185,
"nodeType": "ExpressionStatement",
"src": "15157:48:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15187,
"name": "etherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14431,
"src": "15245:10:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15188,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15257:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15257:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15192,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "15277:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15191,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15269:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15190,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15269:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15193,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15269:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15194,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15284:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15186,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "15228:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15228:70:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15196,
"nodeType": "ExpressionStatement",
"src": "15228:70:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15200,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15341:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15197,
"name": "etherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14431,
"src": "15321:10:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21487",
"typeString": "contract IEtherToken"
}
},
"id": 15199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdraw",
"nodeType": "MemberAccess",
"referencedDeclaration": 21474,
"src": "15321:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 15201,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15321:34:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15202,
"nodeType": "ExpressionStatement",
"src": "15321:34:26"
}
]
}
},
"id": 15205,
"nodeType": "IfStatement",
"src": "14960:415:26",
"trueBody": {
"id": 15173,
"nodeType": "Block",
"src": "14991:89:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15170,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15167,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15034:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15034:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 15169,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15046:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15034:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15162,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15014:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15014:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 15166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15014:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 15171,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15014:46:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15172,
"nodeType": "ExpressionStatement",
"src": "15014:46:26"
}
]
}
}
]
}
},
{
"assignments": [
15221
],
"declarations": [
{
"constant": false,
"id": 15221,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "15573:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15220,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15573:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15226,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15224,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15616:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15222,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15139,
"src": "15601:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15223,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "15601:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15601:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15573:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15232,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15227,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15645:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15229,
"indexExpression": {
"argumentTypes": null,
"id": 15228,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15654:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15645:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15230,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "15645:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15231,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "15678:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "15645:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15233,
"nodeType": "ExpressionStatement",
"src": "15645:50:26"
},
{
"assignments": [
15235
],
"declarations": [
{
"constant": false,
"id": 15235,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15260,
"src": "15712:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15234,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15712:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15240,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15238,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "15752:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15236,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15099,
"src": "15741:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15237,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "15741:10:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15239,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15741:19:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15712:48:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15242,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "15866:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "15866:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15244,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "15878:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15245,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15146,
"src": "15892:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15246,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "15907:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15247,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15235,
"src": "15926:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15241,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "15851:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15851:94:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15249,
"nodeType": "EmitStatement",
"src": "15846:99:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15251,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15235,
"src": "16067:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15252,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "16087:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15253,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15221,
"src": "16101:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15254,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16120:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15256,
"indexExpression": {
"argumentTypes": null,
"id": 15255,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15133,
"src": "16129:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16120:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15257,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "16120:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15250,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "16034:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15258,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16034:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15259,
"nodeType": "ExpressionStatement",
"src": "16034:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15128,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15126,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14570:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15127,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15118,
"src": "14574:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "14570:16:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15261,
"initializationExpression": {
"assignments": [
15123
],
"declarations": [
{
"constant": false,
"id": 15123,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15261,
"src": "14555:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15122,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14555:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15125,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15124,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14567:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "14555:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "14588:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15129,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15123,
"src": "14588:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15131,
"nodeType": "ExpressionStatement",
"src": "14588:3:26"
},
"nodeType": "ForStatement",
"src": "14550:1612:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15269,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "16269:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15270,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16269:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15271,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "16281:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15265,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "16254:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15264,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "16246:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15263,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "16246:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16246:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15262,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "16234:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16234:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15268,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21508,
"src": "16234:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15272,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16234:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15273,
"nodeType": "ExpressionStatement",
"src": "16234:55:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15274,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15074,
"src": "16361:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15080,
"id": 15275,
"nodeType": "Return",
"src": "16354:14:26"
}
]
},
"documentation": {
"id": 15072,
"nodeType": "StructuredDocumentation",
"src": "13414:473:26",
"text": " @dev increases the pool's liquidity and mints new shares in the pool to the caller\n for example, if the caller increases the supply by 10%,\n then it will cost an amount equal to 10% of each reserve token balance\n note that starting from version 28, you should use 'addLiquidity' instead\n @param _amount amount to increase the supply by (in the pool token)\n @return amount of pool tokens issued"
},
"functionSelector": "ca1d209d",
"id": 15277,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15077,
"modifierName": {
"argumentTypes": null,
"id": 15076,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "13966:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13966:9:26"
}
],
"name": "fund",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15075,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15074,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15277,
"src": "13907:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15073,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13907:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13906:17:26"
},
"returnParameters": {
"id": 15080,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15079,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15277,
"src": "13994:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15078,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13994:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13993:9:26"
},
"scope": 16593,
"src": "13893:2483:26",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15355,
"nodeType": "Block",
"src": "17000:514:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15291,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15289,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17019:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15290,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17029:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "17019:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f414d4f554e54",
"id": 15292,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17032:17:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
},
"value": "ERR_ZERO_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
}
],
"id": 15288,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "17011:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15293,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17011:39:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15294,
"nodeType": "ExpressionStatement",
"src": "17011:39:26"
},
{
"assignments": [
15296
],
"declarations": [
{
"constant": false,
"id": 15296,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15355,
"src": "17063:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15295,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17063:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15305,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15300,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "17105:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15299,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17097:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15298,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17097:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17097:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15297,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "17085:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15302,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17085:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "17085:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15304,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17085:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17063:64:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15313,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "17175:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17175:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15315,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17187:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15309,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "17158:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15308,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17150:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15307,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17150:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15310,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17150:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15306,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "17138:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15311,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17138:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15312,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21515,
"src": "17138:36:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 15316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17138:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15317,
"nodeType": "ExpressionStatement",
"src": "17138:57:26"
},
{
"assignments": [
15322
],
"declarations": [
{
"constant": false,
"id": 15322,
"mutability": "mutable",
"name": "reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15355,
"src": "17208:40:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15320,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17208:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15321,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17208:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15329,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15326,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "17265:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15327,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17265:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15325,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "17251:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15323,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17255:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15324,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17255:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15328,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17251:35:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17208:78:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15345,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15341,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17371:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15343,
"indexExpression": {
"argumentTypes": null,
"id": 15342,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17395:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "17371:26:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 15344,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17400:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "17371:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15346,
"nodeType": "ExpressionStatement",
"src": "17371:30:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15337,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15334,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17317:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15335,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17321:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17321:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "17317:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15347,
"initializationExpression": {
"assignments": [
15331
],
"declarations": [
{
"constant": false,
"id": 15331,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15347,
"src": "17302:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15330,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17302:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15333,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15332,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17314:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "17302:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15339,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "17353:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15338,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15331,
"src": "17353:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15340,
"nodeType": "ExpressionStatement",
"src": "17353:3:26"
},
"nodeType": "ForStatement",
"src": "17297:104:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15349,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "17445:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
{
"argumentTypes": null,
"id": 15350,
"name": "reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15322,
"src": "17460:23:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15351,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15296,
"src": "17485:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15352,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15280,
"src": "17498:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15348,
"name": "removeLiquidityFromPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16125,
"src": "17421:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256,uint256) returns (uint256[] memory)"
}
},
"id": 15353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17421:85:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15287,
"id": 15354,
"nodeType": "Return",
"src": "17414:92:26"
}
]
},
"documentation": {
"id": 15278,
"nodeType": "StructuredDocumentation",
"src": "16384:498:26",
"text": " @dev decreases the pool's liquidity and burns the caller's shares in the pool\n for example, if the holder sells 10% of the supply,\n then they will receive 10% of each reserve token balance in return\n note that starting from version 28, you should use 'removeLiquidity' instead\n @param _amount amount to liquidate (in the pool token)\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"functionSelector": "415f1240",
"id": 15356,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 15283,
"modifierName": {
"argumentTypes": null,
"id": 15282,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22565,
"src": "16949:9:26",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "16949:9:26"
}
],
"name": "liquidate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15281,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15280,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15356,
"src": "16907:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15279,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16907:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16906:17:26"
},
"returnParameters": {
"id": 15287,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15286,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15356,
"src": "16977:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15284,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15285,
"length": null,
"nodeType": "ArrayTypeName",
"src": "16977:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16976:18:26"
},
"scope": 16593,
"src": "16888:626:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15447,
"nodeType": "Block",
"src": "18354:612:26",
"statements": [
{
"assignments": [
15374
],
"declarations": [
{
"constant": false,
"id": 15374,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18365:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15372,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18365:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15373,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18365:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15381,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15378,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18413:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15379,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18413:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15377,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "18399:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15375,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18403:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15376,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18403:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15380,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18399:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18365:70:26"
},
{
"assignments": [
15383
],
"declarations": [
{
"constant": false,
"id": 15383,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18448:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15382,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18448:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15392,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15387,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "18490:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15386,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18482:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18482:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18482:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15384,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "18470:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18470:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "18470:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18470:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18448:64:26"
},
{
"assignments": [
15394
],
"declarations": [
{
"constant": false,
"id": 15394,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18523:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15393,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "18523:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15400,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15397,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "18573:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15396,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "18563:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18563:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15395,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "18548:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18548:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18523:66:26"
},
{
"assignments": [
15402
],
"declarations": [
{
"constant": false,
"id": 15402,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15447,
"src": "18600:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15401,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18600:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15415,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15405,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15383,
"src": "18642:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15406,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "18655:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15410,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15407,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18664:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15409,
"indexExpression": {
"argumentTypes": null,
"id": 15408,
"name": "_reserveTokenIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15362,
"src": "18679:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18664:34:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18655:44:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15411,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "18655:52:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15412,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "18709:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15413,
"name": "_reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15364,
"src": "18723:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15403,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15394,
"src": "18617:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "18617:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15414,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18617:121:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "18600:138:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15427,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18816:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15429,
"indexExpression": {
"argumentTypes": null,
"id": 15428,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18831:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "18816:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15432,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15383,
"src": "18853:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15433,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "18866:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15437,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15434,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15360,
"src": "18875:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15436,
"indexExpression": {
"argumentTypes": null,
"id": 15435,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18890:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18875:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18866:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15438,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "18866:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15439,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "18903:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15440,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15402,
"src": "18917:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15430,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15394,
"src": "18836:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "18836:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15441,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18836:88:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18816:108:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15443,
"nodeType": "ExpressionStatement",
"src": "18816:108:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15420,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18771:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15421,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18775:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15422,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18775:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18771:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15444,
"initializationExpression": {
"assignments": [
15417
],
"declarations": [
{
"constant": false,
"id": 15417,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15444,
"src": "18756:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15416,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18756:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15419,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18768:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "18756:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "18798:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15424,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15417,
"src": "18798:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15426,
"nodeType": "ExpressionStatement",
"src": "18798:3:26"
},
"nodeType": "ForStatement",
"src": "18751:173:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15445,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15374,
"src": "18944:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15369,
"id": 15446,
"nodeType": "Return",
"src": "18937:21:26"
}
]
},
"documentation": {
"id": 15357,
"nodeType": "StructuredDocumentation",
"src": "17522:640:26",
"text": " @dev given the amount of one of the reserve tokens to add liquidity of,\n returns the required amount of each one of the other reserve tokens\n since an empty pool can be funded with any list of non-zero input amounts,\n this function assumes that the pool is not empty (has already been funded)\n @param _reserveTokens address of each reserve token\n @param _reserveTokenIndex index of the relevant reserve token\n @param _reserveAmount amount of the relevant reserve token\n @return the required amount of each one of the reserve tokens"
},
"functionSelector": "80d9416d",
"id": 15448,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityCost",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15365,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15360,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18194:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15358,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "18194:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15359,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18194:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15362,
"mutability": "mutable",
"name": "_reserveTokenIndex",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18231:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15361,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18231:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15364,
"mutability": "mutable",
"name": "_reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18259:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15363,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18259:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18193:89:26"
},
"returnParameters": {
"id": 15369,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15368,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15448,
"src": "18331:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15366,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18331:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15367,
"length": null,
"nodeType": "ArrayTypeName",
"src": "18331:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18330:18:26"
},
"scope": 16593,
"src": "18168:798:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15488,
"nodeType": "Block",
"src": "19633:278:26",
"statements": [
{
"assignments": [
15459
],
"declarations": [
{
"constant": false,
"id": 15459,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15488,
"src": "19644:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19644:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15468,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15463,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "19686:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15462,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "19678:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15461,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19678:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15464,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19678:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15460,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "19666:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15465,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19666:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15466,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "19666:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15467,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19666:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19644:64:26"
},
{
"assignments": [
15470
],
"declarations": [
{
"constant": false,
"id": 15470,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15488,
"src": "19719:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15469,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "19719:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15476,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15473,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "19769:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15472,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "19759:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15474,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19759:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15471,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "19744:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15475,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19744:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19719:66:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15479,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15459,
"src": "19828:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15480,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "19841:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15482,
"indexExpression": {
"argumentTypes": null,
"id": 15481,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15451,
"src": "19850:13:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "19841:23:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15483,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "19841:31:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15484,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "19874:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15485,
"name": "_reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15453,
"src": "19888:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15477,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15470,
"src": "19803:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15478,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "19803:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19803:100:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15457,
"id": 15487,
"nodeType": "Return",
"src": "19796:107:26"
}
]
},
"documentation": {
"id": 15449,
"nodeType": "StructuredDocumentation",
"src": "18974:512:26",
"text": " @dev given the amount of one of the reserve tokens to add liquidity of,\n returns the amount of pool tokens entitled for it\n since an empty pool can be funded with any list of non-zero input amounts,\n this function assumes that the pool is not empty (has already been funded)\n @param _reserveToken address of the reserve token\n @param _reserveAmount amount of the reserve token\n @return the amount of pool tokens entitled"
},
"functionSelector": "4e40c260",
"id": 15489,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15454,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15451,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19520:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15450,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "19520:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15453,
"mutability": "mutable",
"name": "_reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19547:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15452,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19547:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19519:51:26"
},
"returnParameters": {
"id": 15457,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15456,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15489,
"src": "19619:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15455,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19619:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19618:9:26"
},
"scope": 16593,
"src": "19492:419:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15527,
"nodeType": "Block",
"src": "20421:254:26",
"statements": [
{
"assignments": [
15502
],
"declarations": [
{
"constant": false,
"id": 15502,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15527,
"src": "20432:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15501,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20432:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15511,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15506,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "20474:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 15505,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20466:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15504,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20466:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15507,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20466:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15503,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "20454:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 15508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20454:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 15509,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "20454:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 15510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20454:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20432:64:26"
},
{
"assignments": [
15513
],
"declarations": [
{
"constant": false,
"id": 15513,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15527,
"src": "20507:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15512,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "20507:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15519,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15516,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "20557:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15515,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "20547:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20547:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15514,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "20532:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15518,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20532:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20507:66:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15521,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15492,
"src": "20621:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15522,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15495,
"src": "20630:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15523,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15502,
"src": "20646:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15524,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15513,
"src": "20659:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
],
"id": 15520,
"name": "removeLiquidityReserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15986,
"src": "20591:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_uint256_$_t_contract$_IBancorFormula_$13177_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256,contract IERC20Token[] memory,uint256,contract IBancorFormula) view returns (uint256[] memory)"
}
},
"id": 15525,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20591:76:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15500,
"id": 15526,
"nodeType": "Return",
"src": "20584:83:26"
}
]
},
"documentation": {
"id": 15490,
"nodeType": "StructuredDocumentation",
"src": "19919:340:26",
"text": " @dev returns the amount of each reserve token entitled for a given amount of pool tokens\n @param _amount amount of pool tokens\n @param _reserveTokens address of each reserve token\n @return the amount of each reserve token entitled for the given amount of pool tokens"
},
"functionSelector": "15458837",
"id": 15528,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15496,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15492,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20296:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15491,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20296:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15495,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20313:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15493,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "20313:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15494,
"length": null,
"nodeType": "ArrayTypeName",
"src": "20313:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20295:54:26"
},
"returnParameters": {
"id": 15500,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15499,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15528,
"src": "20398:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15497,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20398:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15498,
"length": null,
"nodeType": "ArrayTypeName",
"src": "20398:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20397:18:26"
},
"scope": 16593,
"src": "20265:410:26",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 15633,
"nodeType": "Block",
"src": "21236:1027:26",
"statements": [
{
"assignments": [
15541
],
"declarations": [
{
"constant": false,
"id": 15541,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21247:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15540,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21247:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15542,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "21247:9:26"
},
{
"assignments": [
15544
],
"declarations": [
{
"constant": false,
"id": 15544,
"mutability": "mutable",
"name": "j",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21267:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15543,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21267:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15545,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "21267:9:26"
},
{
"assignments": [
15547
],
"declarations": [
{
"constant": false,
"id": 15547,
"mutability": "mutable",
"name": "length",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15633,
"src": "21289:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15546,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21289:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15550,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15548,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "21306:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15549,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21306:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "21289:37:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15555,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15552,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21345:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15553,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21355:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21355:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21345:31:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21378:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15551,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21337:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21337:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15558,
"nodeType": "ExpressionStatement",
"src": "21337:63:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15560,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21419:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15561,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15535,
"src": "21429:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15562,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21429:22:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21419:32:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 15564,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21453:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 15559,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21411:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15565,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21411:63:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15566,
"nodeType": "ExpressionStatement",
"src": "21411:63:26"
},
{
"body": {
"id": 15624,
"nodeType": "Block",
"src": "21516:621:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15578,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "21627:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15582,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15579,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21636:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15581,
"indexExpression": {
"argumentTypes": null,
"id": 15580,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21651:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21636:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21627:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15583,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "21627:33:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15584,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21662:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15577,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21619:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21619:65:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15586,
"nodeType": "ExpressionStatement",
"src": "21619:65:26"
},
{
"body": {
"id": 15606,
"nodeType": "Block",
"src": "21728:104:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15603,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15597,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "21751:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 15599,
"indexExpression": {
"argumentTypes": null,
"id": 15598,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21765:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21751:16:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15600,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15532,
"src": "21771:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15602,
"indexExpression": {
"argumentTypes": null,
"id": 15601,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21786:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "21771:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "21751:37:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15605,
"nodeType": "IfStatement",
"src": "21747:69:26",
"trueBody": {
"id": 15604,
"nodeType": "Break",
"src": "21811:5:26"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15591,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21711:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15592,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21715:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21711:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15607,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 15589,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 15587,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21704:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 15588,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21708:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "21704:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15590,
"nodeType": "ExpressionStatement",
"src": "21704:5:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15595,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "21723:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15594,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21723:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15596,
"nodeType": "ExpressionStatement",
"src": "21723:3:26"
},
"nodeType": "ForStatement",
"src": "21699:133:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15611,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15609,
"name": "j",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15544,
"src": "21942:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15610,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21946:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21942:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 15612,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21954:21:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 15608,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "21934:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15613,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21934:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15614,
"nodeType": "ExpressionStatement",
"src": "21934:42:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15620,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15616,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15535,
"src": "22080:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15618,
"indexExpression": {
"argumentTypes": null,
"id": 15617,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "22096:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22080:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15619,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22101:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22080:22:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 15621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22104:20:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
},
"value": "ERR_INVALID_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c44007bfe4e704be0ed1393660a827b4f88825f4b6fe1bc10cd38fc3fcb7d839",
"typeString": "literal_string \"ERR_INVALID_AMOUNT\""
}
],
"id": 15615,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "22072:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22072:53:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15623,
"nodeType": "ExpressionStatement",
"src": "22072:53:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15571,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21499:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 15572,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15547,
"src": "21503:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "21499:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15625,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 15569,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 15567,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21492:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 15568,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21496:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "21492:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15570,
"nodeType": "ExpressionStatement",
"src": "21492:5:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15575,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "21511:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15574,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15541,
"src": "21511:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15576,
"nodeType": "ExpressionStatement",
"src": "21511:3:26"
},
"nodeType": "ForStatement",
"src": "21487:650:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15629,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15627,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15537,
"src": "22224:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15628,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22234:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22224:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f414d4f554e54",
"id": 15630,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22237:17:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
},
"value": "ERR_ZERO_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_7361098e42735bca910fe31e755673f84106720004757c7a37e5f52f92430b9e",
"typeString": "literal_string \"ERR_ZERO_AMOUNT\""
}
],
"id": 15626,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "22216:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15631,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22216:39:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15632,
"nodeType": "ExpressionStatement",
"src": "22216:39:26"
}
]
},
"documentation": {
"id": 15529,
"nodeType": "StructuredDocumentation",
"src": "20683:393:26",
"text": " @dev verifies that a given array of tokens is identical to the converter's array of reserve tokens\n we take this input in order to allow specifying the corresponding reserve amounts in any order\n @param _reserveTokens array of reserve tokens\n @param _reserveAmounts array of reserve amounts\n @param _amount token amount"
},
"id": 15634,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "verifyLiquidityInput",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15538,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15532,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21112:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15530,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "21112:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15531,
"length": null,
"nodeType": "ArrayTypeName",
"src": "21112:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15535,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21149:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15533,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21149:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15534,
"length": null,
"nodeType": "ArrayTypeName",
"src": "21149:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15537,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15634,
"src": "21183:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15536,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21183:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "21111:88:26"
},
"returnParameters": {
"id": 15539,
"nodeType": "ParameterList",
"parameters": [],
"src": "21236:0:26"
},
"scope": 16593,
"src": "21082:1181:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15663,
"nodeType": "Block",
"src": "22750:209:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15650,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15648,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15643,
"src": "22765:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15649,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22781:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "22765:17:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15656,
"nodeType": "IfStatement",
"src": "22761:99:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15652,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15638,
"src": "22828:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15653,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15641,
"src": "22844:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15651,
"name": "addLiquidityToEmptyPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15751,
"src": "22804:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory) returns (uint256)"
}
},
"id": 15654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22804:56:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15647,
"id": 15655,
"nodeType": "Return",
"src": "22797:63:26"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15658,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15638,
"src": "22905:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15659,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15641,
"src": "22921:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 15660,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15643,
"src": "22938:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15657,
"name": "addLiquidityToNonEmptyPool",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15926,
"src": "22878:26:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token[] memory,uint256[] memory,uint256) returns (uint256)"
}
},
"id": 15661,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22878:73:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15647,
"id": 15662,
"nodeType": "Return",
"src": "22871:80:26"
}
]
},
"documentation": {
"id": 15635,
"nodeType": "StructuredDocumentation",
"src": "22271:303:26",
"text": " @dev adds liquidity (reserve) to the pool\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _totalSupply token total supply\n @return amount of pool tokens issued"
},
"id": 15664,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15644,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15638,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22608:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15636,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "22608:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15637,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22608:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15641,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22645:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15639,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22645:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15640,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22645:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15643,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22679:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15642,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22679:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22607:93:26"
},
"returnParameters": {
"id": 15647,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15646,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15664,
"src": "22736:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22736:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22735:9:26"
},
"scope": 16593,
"src": "22580:379:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15750,
"nodeType": "Block",
"src": "23393:1062:26",
"statements": [
{
"assignments": [
15677
],
"declarations": [
{
"constant": false,
"id": 15677,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15750,
"src": "23489:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15676,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23489:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15681,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15679,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15671,
"src": "23520:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15678,
"name": "geometricMean",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16302,
"src": "23506:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (uint256[] memory) pure returns (uint256)"
}
},
"id": 15680,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23506:30:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23489:47:26"
},
{
"body": {
"id": 15746,
"nodeType": "Block",
"src": "23680:690:26",
"statements": [
{
"assignments": [
15694
],
"declarations": [
{
"constant": false,
"id": 15694,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15746,
"src": "23695:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15693,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "23695:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15698,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15695,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15668,
"src": "23722:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15697,
"indexExpression": {
"argumentTypes": null,
"id": 15696,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23737:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "23722:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23695:44:26"
},
{
"assignments": [
15700
],
"declarations": [
{
"constant": false,
"id": 15700,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15746,
"src": "23754:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15699,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23754:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15704,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15701,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15671,
"src": "23778:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15703,
"indexExpression": {
"argumentTypes": null,
"id": 15702,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23794:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "23778:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23754:42:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15707,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15705,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "23817:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 15706,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "23833:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "23817:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15719,
"nodeType": "IfStatement",
"src": "23813:193:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15709,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "23951:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15710,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "23965:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15711,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23965:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15714,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "23985:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15713,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "23977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15712,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23977:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15715,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23977:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15716,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "23992:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15708,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "23934:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15717,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23934:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15718,
"nodeType": "ExpressionStatement",
"src": "23934:72:26"
}
},
{
"expression": {
"argumentTypes": null,
"id": 15725,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15720,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "24023:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15722,
"indexExpression": {
"argumentTypes": null,
"id": 15721,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24032:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24023:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15723,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "24023:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15724,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24056:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "24023:46:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15726,
"nodeType": "ExpressionStatement",
"src": "24023:46:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15728,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "24106:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15729,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "24106:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15730,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24118:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15731,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24132:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15732,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24147:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15733,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24162:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15727,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "24091:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15734,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24091:78:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15735,
"nodeType": "EmitStatement",
"src": "24086:83:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15737,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24291:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15738,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24299:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15739,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15700,
"src": "24313:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15740,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "24328:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15742,
"indexExpression": {
"argumentTypes": null,
"id": 15741,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15694,
"src": "24337:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24328:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15743,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "24328:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15736,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "24258:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24258:100:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15745,
"nodeType": "ExpressionStatement",
"src": "24258:100:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15689,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15686,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23648:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15687,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15668,
"src": "23652:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15688,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23652:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "23648:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15747,
"initializationExpression": {
"assignments": [
15683
],
"declarations": [
{
"constant": false,
"id": 15683,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15747,
"src": "23633:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15682,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23633:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15685,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23645:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "23633:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15691,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "23675:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15690,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15683,
"src": "23675:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15692,
"nodeType": "ExpressionStatement",
"src": "23675:3:26"
},
"nodeType": "ForStatement",
"src": "23628:742:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15748,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15677,
"src": "24441:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15675,
"id": 15749,
"nodeType": "Return",
"src": "24434:13:26"
}
]
},
"documentation": {
"id": 15665,
"nodeType": "StructuredDocumentation",
"src": "22967:267:26",
"text": " @dev adds liquidity (reserve) to the pool when it's empty\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @return amount of pool tokens issued"
},
"id": 15751,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToEmptyPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15672,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15668,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23273:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15666,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "23273:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15667,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23273:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15671,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23310:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15669,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23310:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15670,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23310:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23272:71:26"
},
"returnParameters": {
"id": 15675,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15674,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15751,
"src": "23379:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15673,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23379:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23378:9:26"
},
"scope": 16593,
"src": "23240:1215:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15925,
"nodeType": "Block",
"src": "24970:1826:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 15765,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "24981:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 15766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24981:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15767,
"nodeType": "ExpressionStatement",
"src": "24981:21:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15768,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25013:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15770,
"indexExpression": {
"argumentTypes": null,
"id": 15769,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25022:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25013:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15771,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25013:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15777,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "25095:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25095:9:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15772,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25053:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15774,
"indexExpression": {
"argumentTypes": null,
"id": 15773,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25062:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25053:29:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15775,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25053:37:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "25053:41:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15779,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25053:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25013:92:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15781,
"nodeType": "ExpressionStatement",
"src": "25013:92:26"
},
{
"assignments": [
15783
],
"declarations": [
{
"constant": false,
"id": 15783,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25118:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15782,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "25118:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15789,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15786,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "25168:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 15785,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "25158:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 15787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25158:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 15784,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "25143:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 15788,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25143:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25118:66:26"
},
{
"assignments": [
15791
],
"declarations": [
{
"constant": false,
"id": 15791,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25195:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15790,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25195:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15798,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15793,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15783,
"src": "25224:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
{
"argumentTypes": null,
"id": 15794,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25233:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15795,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25247:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 15796,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "25263:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
],
"id": 15792,
"name": "getMinShare",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16201,
"src": "25212:11:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IBancorFormula_$13177_$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$_t_uint256_$",
"typeString": "function (contract IBancorFormula,uint256,contract IERC20Token[] memory,uint256[] memory) view returns (uint256)"
}
},
"id": 15797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25212:67:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25195:84:26"
},
{
"assignments": [
15800
],
"declarations": [
{
"constant": false,
"id": 15800,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15925,
"src": "25290:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15799,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25290:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15805,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15803,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "25336:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15801,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25319:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15802,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "25319:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25319:24:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25290:53:26"
},
{
"body": {
"id": 15921,
"nodeType": "Block",
"src": "25408:1303:26",
"statements": [
{
"assignments": [
15818
],
"declarations": [
{
"constant": false,
"id": 15818,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25423:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15817,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "25423:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15822,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15819,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25450:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15821,
"indexExpression": {
"argumentTypes": null,
"id": 15820,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25465:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25450:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25423:44:26"
},
{
"assignments": [
15824
],
"declarations": [
{
"constant": false,
"id": 15824,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25482:18:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15823,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25482:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15829,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15825,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "25503:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15827,
"indexExpression": {
"argumentTypes": null,
"id": 15826,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25512:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25503:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15828,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "25503:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25482:51:26"
},
{
"assignments": [
15831
],
"declarations": [
{
"constant": false,
"id": 15831,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "25548:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15830,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25548:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15839,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15834,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15760,
"src": "25589:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15835,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15824,
"src": "25603:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15836,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "25615:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15837,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "25629:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15832,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15783,
"src": "25572:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundCost",
"nodeType": "MemberAccess",
"referencedDeclaration": 13133,
"src": "25572:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25572:64:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25548:88:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15841,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "25659:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 15842,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25675:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "25659:17:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 15844,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25678:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 15840,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "25651:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 15845,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25651:52:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15846,
"nodeType": "ExpressionStatement",
"src": "25651:52:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15852,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15848,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "25725:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15849,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "25742:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15851,
"indexExpression": {
"argumentTypes": null,
"id": 15850,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25758:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25742:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25725:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 15847,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "25718:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 15853,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25718:43:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15854,
"nodeType": "ExpressionStatement",
"src": "25718:43:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 15857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15855,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25865:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 15856,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "25881:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "25865:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15873,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15869,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "26078:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15871,
"indexExpression": {
"argumentTypes": null,
"id": 15870,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "26094:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26078:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 15872,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26099:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26078:34:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 15886,
"nodeType": "IfStatement",
"src": "26074:165:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15883,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15879,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15758,
"src": "26204:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15881,
"indexExpression": {
"argumentTypes": null,
"id": 15880,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "26220:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26204:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 15882,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26225:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26204:34:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15874,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26184:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15877,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26184:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 15878,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26184:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 15884,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26184:55:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15885,
"nodeType": "ExpressionStatement",
"src": "26184:55:26"
}
},
"id": 15887,
"nodeType": "IfStatement",
"src": "25861:378:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15859,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "25999:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15860,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26013:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15861,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26013:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15864,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "26033:4:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidityPoolV1Converter_$16593",
"typeString": "contract LiquidityPoolV1Converter"
}
],
"id": 15863,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26025:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 15862,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26025:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 15865,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26025:13:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15866,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26040:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15858,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22859,
"src": "25982:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 15867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25982:72:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15868,
"nodeType": "ExpressionStatement",
"src": "25982:72:26"
}
},
{
"assignments": [
15889
],
"declarations": [
{
"constant": false,
"id": 15889,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15921,
"src": "26256:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15888,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "26256:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15894,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15892,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26299:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15890,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15824,
"src": "26284:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15891,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "26284:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 15893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26284:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "26256:57:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15895,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "26328:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15897,
"indexExpression": {
"argumentTypes": null,
"id": 15896,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26337:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26328:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15898,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "26328:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 15899,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26361:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26328:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15901,
"nodeType": "ExpressionStatement",
"src": "26328:50:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15903,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "26415:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 15904,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26415:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 15905,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26427:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15906,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15831,
"src": "26441:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15907,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26456:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15908,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15800,
"src": "26475:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15902,
"name": "LiquidityAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13028,
"src": "26400:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 15909,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26400:94:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15910,
"nodeType": "EmitStatement",
"src": "26395:99:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15912,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15800,
"src": "26616:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15913,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26636:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 15914,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15889,
"src": "26650:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15915,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "26669:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15917,
"indexExpression": {
"argumentTypes": null,
"id": 15916,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15818,
"src": "26678:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26669:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15918,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "26669:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 15911,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "26583:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 15919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26583:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 15920,
"nodeType": "ExpressionStatement",
"src": "26583:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15810,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25376:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15811,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15755,
"src": "25380:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25380:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "25376:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15922,
"initializationExpression": {
"assignments": [
15807
],
"declarations": [
{
"constant": false,
"id": 15807,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15922,
"src": "25361:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15806,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "25361:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15809,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15808,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25373:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "25361:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15815,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "25403:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15814,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15807,
"src": "25403:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15816,
"nodeType": "ExpressionStatement",
"src": "25403:3:26"
},
"nodeType": "ForStatement",
"src": "25356:1355:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15923,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15791,
"src": "26782:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15764,
"id": 15924,
"nodeType": "Return",
"src": "26775:13:26"
}
]
},
"documentation": {
"id": 15752,
"nodeType": "StructuredDocumentation",
"src": "24463:323:26",
"text": " @dev adds liquidity (reserve) to the pool when it's not empty\n @param _reserveTokens address of each reserve token\n @param _reserveAmounts amount of each reserve token\n @param _totalSupply token total supply\n @return amount of pool tokens issued"
},
"id": 15926,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "addLiquidityToNonEmptyPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15761,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15755,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24828:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15753,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "24828:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15754,
"length": null,
"nodeType": "ArrayTypeName",
"src": "24828:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15758,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24865:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15756,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24865:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15757,
"length": null,
"nodeType": "ArrayTypeName",
"src": "24865:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15760,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24899:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15759,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24899:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "24827:93:26"
},
"returnParameters": {
"id": 15764,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15763,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15926,
"src": "24956:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15762,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24956:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "24955:9:26"
},
"scope": 16593,
"src": "24792:2004:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 15985,
"nodeType": "Block",
"src": "27464:322:26",
"statements": [
{
"assignments": [
15946
],
"declarations": [
{
"constant": false,
"id": 15946,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15985,
"src": "27475:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15944,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27475:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15945,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27475:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15953,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15950,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15932,
"src": "27523:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27523:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 15949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "27509:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 15947,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27513:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15948,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27513:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 15952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27509:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "27475:70:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 15980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15965,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27621:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15967,
"indexExpression": {
"argumentTypes": null,
"id": 15966,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27636:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "27621:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 15970,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15934,
"src": "27673:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15971,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "27687:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 15975,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 15972,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15932,
"src": "27696:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 15974,
"indexExpression": {
"argumentTypes": null,
"id": 15973,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27711:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27696:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27687:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 15976,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "27687:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 15977,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "27724:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 15978,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15929,
"src": "27738:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 15968,
"name": "_formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15936,
"src": "27641:8:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 15969,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "liquidateReserveAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13159,
"src": "27641:31:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 15979,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27641:105:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27621:125:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15981,
"nodeType": "ExpressionStatement",
"src": "27621:125:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 15958,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27576:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 15959,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27580:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 15960,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27580:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27576:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 15982,
"initializationExpression": {
"assignments": [
15955
],
"declarations": [
{
"constant": false,
"id": 15955,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15982,
"src": "27561:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15954,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27561:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 15957,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 15956,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27573:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "27561:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 15963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "27603:3:26",
"subExpression": {
"argumentTypes": null,
"id": 15962,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15955,
"src": "27603:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15964,
"nodeType": "ExpressionStatement",
"src": "27603:3:26"
},
"nodeType": "ForStatement",
"src": "27556:190:26"
},
{
"expression": {
"argumentTypes": null,
"id": 15983,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15946,
"src": "27764:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 15941,
"id": 15984,
"nodeType": "Return",
"src": "27757:21:26"
}
]
},
"documentation": {
"id": 15927,
"nodeType": "StructuredDocumentation",
"src": "26804:442:26",
"text": " @dev returns the amount of each reserve token entitled for a given amount of pool tokens\n @param _amount amount of pool tokens\n @param _reserveTokens address of each reserve token\n @param _totalSupply token total supply\n @param _formula formula contract\n @return the amount of each reserve token entitled for the given amount of pool tokens"
},
"id": 15986,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityReserveAmounts",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15937,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15929,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27291:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15928,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27291:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15932,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27308:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15930,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "27308:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15931,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27308:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15934,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27345:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15933,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27345:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15936,
"mutability": "mutable",
"name": "_formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27367:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 15935,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "27367:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "27290:101:26"
},
"returnParameters": {
"id": 15941,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15940,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 15986,
"src": "27441:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15938,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "27441:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15939,
"length": null,
"nodeType": "ArrayTypeName",
"src": "27441:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "27440:18:26"
},
"scope": 16593,
"src": "27252:534:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16124,
"nodeType": "Block",
"src": "28459:1485:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 16003,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "28470:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 16004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28470:21:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16005,
"nodeType": "ExpressionStatement",
"src": "28470:21:26"
},
{
"assignments": [
16007
],
"declarations": [
{
"constant": false,
"id": 16007,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28504:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 16006,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "28504:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16013,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16010,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21867,
"src": "28554:14:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 16009,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22052,
"src": "28544:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 16011,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28544:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16008,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "28529:14:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 16012,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28529:41:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28504:66:26"
},
{
"assignments": [
16015
],
"declarations": [
{
"constant": false,
"id": 16015,
"mutability": "mutable",
"name": "newPoolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28581:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16014,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28581:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16020,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16018,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15997,
"src": "28627:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16016,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15995,
"src": "28610:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16017,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "28610:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16019,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28610:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28581:54:26"
},
{
"assignments": [
16025
],
"declarations": [
{
"constant": false,
"id": 16025,
"mutability": "mutable",
"name": "reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16124,
"src": "28646:31:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16023,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28646:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16024,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28646:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16032,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16027,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15997,
"src": "28710:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16028,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28719:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
{
"argumentTypes": null,
"id": 16029,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15995,
"src": "28735:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16030,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16007,
"src": "28749:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
],
"id": 16026,
"name": "removeLiquidityReserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15986,
"src": "28680:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr_$_t_uint256_$_t_contract$_IBancorFormula_$13177_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256,contract IERC20Token[] memory,uint256,contract IBancorFormula) view returns (uint256[] memory)"
}
},
"id": 16031,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28680:77:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28646:111:26"
},
{
"body": {
"id": 16120,
"nodeType": "Block",
"src": "28822:985:26",
"statements": [
{
"assignments": [
16045
],
"declarations": [
{
"constant": false,
"id": 16045,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "28837:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16044,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "28837:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16049,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16046,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28864:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16048,
"indexExpression": {
"argumentTypes": null,
"id": 16047,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28879:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28864:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28837:44:26"
},
{
"assignments": [
16051
],
"declarations": [
{
"constant": false,
"id": 16051,
"mutability": "mutable",
"name": "reserveAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "28896:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16050,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28896:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16055,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16052,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16025,
"src": "28920:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16054,
"indexExpression": {
"argumentTypes": null,
"id": 16053,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28935:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28920:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28896:41:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16057,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "28960:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16058,
"name": "_reserveMinReturnAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15993,
"src": "28977:24:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16060,
"indexExpression": {
"argumentTypes": null,
"id": 16059,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "29002:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "28977:27:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28960:44:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 16062,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "29006:24:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
},
"value": "ERR_ZERO_TARGET_AMOUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_29cb0846c2d5a859f661a5b4c4a8be47a80ca27c24af6f007bda101871b53e03",
"typeString": "literal_string \"ERR_ZERO_TARGET_AMOUNT\""
}
],
"id": 16056,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "28952:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 16063,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28952:79:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16064,
"nodeType": "ExpressionStatement",
"src": "28952:79:26"
},
{
"assignments": [
16066
],
"declarations": [
{
"constant": false,
"id": 16066,
"mutability": "mutable",
"name": "newReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16120,
"src": "29048:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16065,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29048:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16074,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16072,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29111:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16067,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29076:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16069,
"indexExpression": {
"argumentTypes": null,
"id": 16068,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29085:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29076:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16070,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "29076:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16071,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22627,
"src": "29076:34:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16073,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29076:49:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "29048:77:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16080,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16075,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29140:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16077,
"indexExpression": {
"argumentTypes": null,
"id": 16076,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29149:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29140:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16078,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "29140:30:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 16079,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29173:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "29140:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16081,
"nodeType": "ExpressionStatement",
"src": "29140:50:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"id": 16084,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16082,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29294:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 16083,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "29310:19:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"src": "29294:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16094,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29432:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16095,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29446:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16096,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29446:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 16097,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29458:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16093,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22809,
"src": "29419:12:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21461_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 16098,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29419:53:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16099,
"nodeType": "ExpressionStatement",
"src": "29419:53:26"
},
"id": 16100,
"nodeType": "IfStatement",
"src": "29290:182:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16090,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29368:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29348:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16088,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29348:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 16089,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29348:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 16091,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29348:34:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16092,
"nodeType": "ExpressionStatement",
"src": "29348:34:26"
}
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16102,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "29511:3:26",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 16103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "29511:10:26",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 16104,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29523:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16105,
"name": "reserveAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16051,
"src": "29537:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16106,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29552:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16107,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16015,
"src": "29571:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16101,
"name": "LiquidityRemoved",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13041,
"src": "29494:16:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (address,contract IERC20Token,uint256,uint256,uint256)"
}
},
"id": 16108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29494:96:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16109,
"nodeType": "EmitStatement",
"src": "29489:101:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16111,
"name": "newPoolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16015,
"src": "29712:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16112,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29732:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16113,
"name": "newReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16066,
"src": "29746:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16114,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "29765:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16116,
"indexExpression": {
"argumentTypes": null,
"id": 16115,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16045,
"src": "29774:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29765:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16117,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "29765:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16110,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "29679:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29679:116:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16119,
"nodeType": "ExpressionStatement",
"src": "29679:116:26"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16040,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16037,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28790:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16038,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 15990,
"src": "28794:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16039,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "28794:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28790:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16121,
"initializationExpression": {
"assignments": [
16034
],
"declarations": [
{
"constant": false,
"id": 16034,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16121,
"src": "28775:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16033,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28775:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16036,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16035,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28787:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "28775:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16042,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "28817:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16041,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16034,
"src": "28817:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16043,
"nodeType": "ExpressionStatement",
"src": "28817:3:26"
},
"nodeType": "ForStatement",
"src": "28770:1037:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16122,
"name": "reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16025,
"src": "29922:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 16002,
"id": 16123,
"nodeType": "Return",
"src": "29915:21:26"
}
]
},
"documentation": {
"id": 15987,
"nodeType": "StructuredDocumentation",
"src": "27794:449:26",
"text": " @dev removes liquidity (reserve) from the pool\n @param _reserveTokens address of each reserve token\n @param _reserveMinReturnAmounts minimum return-amount of each reserve token\n @param _totalSupply token total supply\n @param _amount token amount\n @return the amount of each reserve token granted for the given amount of pool tokens"
},
"id": 16125,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "removeLiquidityFromPool",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 15998,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 15990,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28282:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 15988,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "28282:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 15989,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28282:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15993,
"mutability": "mutable",
"name": "_reserveMinReturnAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28319:41:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15991,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28319:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 15992,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28319:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15995,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28362:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15994,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28362:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 15997,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28384:15:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 15996,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28281:119:26"
},
"returnParameters": {
"id": 16002,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16001,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16125,
"src": "28436:16:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 15999,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28436:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16000,
"length": null,
"nodeType": "ArrayTypeName",
"src": "28436:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28435:18:26"
},
"scope": 16593,
"src": "28249:1695:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16200,
"nodeType": "Block",
"src": "30121:439:26",
"statements": [
{
"assignments": [
16141
],
"declarations": [
{
"constant": false,
"id": 16141,
"mutability": "mutable",
"name": "minIndex",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16200,
"src": "30132:16:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16140,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30132:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16143,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16142,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30151:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "30132:20:26"
},
{
"body": {
"id": 16183,
"nodeType": "Block",
"src": "30215:197:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16159,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30257:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16163,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16160,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30266:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16162,
"indexExpression": {
"argumentTypes": null,
"id": 16161,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30281:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30266:24:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30257:34:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16164,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30257:42:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16155,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30234:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16157,
"indexExpression": {
"argumentTypes": null,
"id": 16156,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30250:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30234:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "30234:22:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30234:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16170,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30333:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16174,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16171,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30342:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16173,
"indexExpression": {
"argumentTypes": null,
"id": 16172,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30357:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30342:17:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30333:27:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16175,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30333:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16166,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30303:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16168,
"indexExpression": {
"argumentTypes": null,
"id": 16167,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30319:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30303:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "30303:29:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16176,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30303:66:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30234:135:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16182,
"nodeType": "IfStatement",
"src": "30230:170:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 16180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16178,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30388:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 16179,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30399:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30388:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16181,
"nodeType": "ExpressionStatement",
"src": "30388:12:26"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16151,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16148,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30183:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16149,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30187:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30187:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "30183:25:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16184,
"initializationExpression": {
"assignments": [
16145
],
"declarations": [
{
"constant": false,
"id": 16145,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16184,
"src": "30168:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16144,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30168:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16147,
"initialValue": {
"argumentTypes": null,
"hexValue": "31",
"id": 16146,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30180:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"nodeType": "VariableDeclarationStatement",
"src": "30168:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "30210:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16152,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16145,
"src": "30210:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16154,
"nodeType": "ExpressionStatement",
"src": "30210:3:26"
},
"nodeType": "ForStatement",
"src": "30163:249:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16187,
"name": "_totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16129,
"src": "30454:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16188,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "30468:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16192,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16189,
"name": "_reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16132,
"src": "30477:14:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[] memory"
}
},
"id": 16191,
"indexExpression": {
"argumentTypes": null,
"id": 16190,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30492:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30477:24:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30468:34:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16193,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "30468:42:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16194,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "30512:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16195,
"name": "_reserveAmounts",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16135,
"src": "30526:15:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16197,
"indexExpression": {
"argumentTypes": null,
"id": 16196,
"name": "minIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16141,
"src": "30542:8:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "30526:25:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16185,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16127,
"src": "30429:7:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 16186,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fundSupplyAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13146,
"src": "30429:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_uint256_$_t_uint32_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint32,uint256) view external returns (uint256)"
}
},
"id": 16198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30429:123:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16139,
"id": 16199,
"nodeType": "Return",
"src": "30422:130:26"
}
]
},
"documentation": null,
"id": 16201,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getMinShare",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16136,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16127,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "29973:22:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 16126,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "29973:14:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16129,
"mutability": "mutable",
"name": "_totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "29997:20:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16128,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29997:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16132,
"mutability": "mutable",
"name": "_reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30019:35:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_memory_ptr",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 16130,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "30019:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"id": 16131,
"length": null,
"nodeType": "ArrayTypeName",
"src": "30019:13:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21461_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16135,
"mutability": "mutable",
"name": "_reserveAmounts",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30056:32:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16133,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30056:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16134,
"length": null,
"nodeType": "ArrayTypeName",
"src": "30056:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29972:117:26"
},
"returnParameters": {
"id": 16139,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16138,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16201,
"src": "30112:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16137,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30112:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30111:9:26"
},
"scope": 16593,
"src": "29952:608:26",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16230,
"nodeType": "Block",
"src": "30847:115:26",
"statements": [
{
"assignments": [
16210
],
"declarations": [
{
"constant": false,
"id": 16210,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16230,
"src": "30858:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16209,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30858:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16212,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30870:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "30858:13:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 16225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "30932:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16224,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16210,
"src": "30932:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16226,
"nodeType": "ExpressionStatement",
"src": "30932:3:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16217,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16214,
"src": "30903:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 16218,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30907:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "30903:5:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16227,
"initializationExpression": {
"assignments": [
16214
],
"declarations": [
{
"constant": false,
"id": 16214,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16227,
"src": "30887:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16213,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30887:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16216,
"initialValue": {
"argumentTypes": null,
"id": 16215,
"name": "_x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16204,
"src": "30899:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30887:14:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16220,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16214,
"src": "30910:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "3130",
"id": 16221,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30915:2:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"src": "30910:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16223,
"nodeType": "ExpressionStatement",
"src": "30910:7:26"
},
"nodeType": "ForStatement",
"src": "30882:53:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16228,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16210,
"src": "30953:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16208,
"id": 16229,
"nodeType": "Return",
"src": "30946:8:26"
}
]
},
"documentation": {
"id": 16202,
"nodeType": "StructuredDocumentation",
"src": "30568:208:26",
"text": " @dev returns the number of decimal digits in a given value\n @param _x value (assumed positive)\n @return the number of decimal digits in the given value"
},
"functionSelector": "6aa5332c",
"id": 16231,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "decimalLength",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16205,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16204,
"mutability": "mutable",
"name": "_x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16231,
"src": "30805:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16203,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30805:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30804:12:26"
},
"returnParameters": {
"id": 16208,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16207,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16231,
"src": "30838:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16206,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30838:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30837:9:26"
},
"scope": 16593,
"src": "30782:180:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16250,
"nodeType": "Block",
"src": "31280:44:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16245,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16241,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16234,
"src": "31299:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16242,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16236,
"src": "31304:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16243,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31309:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "31304:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31299:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16246,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31298:13:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 16247,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16236,
"src": "31314:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31298:18:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16240,
"id": 16249,
"nodeType": "Return",
"src": "31291:25:26"
}
]
},
"documentation": {
"id": 16232,
"nodeType": "StructuredDocumentation",
"src": "30970:232:26",
"text": " @dev returns the nearest integer to a given quotient\n @param _n quotient numerator\n @param _d quotient denominator\n @return the nearest integer to the given quotient"
},
"functionSelector": "bbb7e5d8",
"id": 16251,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "roundDiv",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16237,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16234,
"mutability": "mutable",
"name": "_n",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31226:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16233,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31226:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16236,
"mutability": "mutable",
"name": "_d",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31238:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16235,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31238:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31225:24:26"
},
"returnParameters": {
"id": 16240,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16239,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16251,
"src": "31271:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16238,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31271:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31270:9:26"
},
"scope": 16593,
"src": "31208:116:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16301,
"nodeType": "Block",
"src": "31686:253:26",
"statements": [
{
"assignments": [
16261
],
"declarations": [
{
"constant": false,
"id": 16261,
"mutability": "mutable",
"name": "numOfDigits",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16301,
"src": "31697:19:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16260,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31697:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16263,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16262,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31719:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "31697:23:26"
},
{
"assignments": [
16265
],
"declarations": [
{
"constant": false,
"id": 16265,
"mutability": "mutable",
"name": "length",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16301,
"src": "31731:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16264,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31731:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16268,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16266,
"name": "_values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16255,
"src": "31748:7:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31748:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "31731:31:26"
},
{
"body": {
"expression": {
"argumentTypes": null,
"id": 16285,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16279,
"name": "numOfDigits",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16261,
"src": "31823:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16281,
"name": "_values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16255,
"src": "31852:7:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 16283,
"indexExpression": {
"argumentTypes": null,
"id": 16282,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31860:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "31852:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16280,
"name": "decimalLength",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16231,
"src": "31838:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) pure returns (uint256)"
}
},
"id": 16284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31838:25:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31823:40:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16286,
"nodeType": "ExpressionStatement",
"src": "31823:40:26"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16273,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31793:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 16274,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16265,
"src": "31797:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31793:10:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 16287,
"initializationExpression": {
"assignments": [
16270
],
"declarations": [
{
"constant": false,
"id": 16270,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16287,
"src": "31778:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16269,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31778:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16272,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 16271,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31790:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "31778:13:26"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 16277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "31805:3:26",
"subExpression": {
"argumentTypes": null,
"id": 16276,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16270,
"src": "31805:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16278,
"nodeType": "ExpressionStatement",
"src": "31805:3:26"
},
"nodeType": "ForStatement",
"src": "31773:90:26"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "3130",
"id": 16290,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31889:2:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
}
],
"id": 16289,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31881:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 16288,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31881:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16291,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31881:11:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16297,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16293,
"name": "numOfDigits",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16261,
"src": "31906:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16294,
"name": "length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16265,
"src": "31919:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16292,
"name": "roundDiv",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16251,
"src": "31897:8:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16295,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31897:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16296,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31929:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "31897:33:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16298,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31896:35:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "31881:50:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16259,
"id": 16300,
"nodeType": "Return",
"src": "31874:57:26"
}
]
},
"documentation": {
"id": 16252,
"nodeType": "StructuredDocumentation",
"src": "31332:269:26",
"text": " @dev returns the average number of decimal digits in a given list of values\n @param _values list of values (each of which assumed positive)\n @return the average number of decimal digits in the given list of values"
},
"functionSelector": "a60e7724",
"id": 16302,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "geometricMean",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16256,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16255,
"mutability": "mutable",
"name": "_values",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16302,
"src": "31630:24:26",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 16253,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31630:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16254,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31630:9:26",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31629:26:26"
},
"returnParameters": {
"id": 16259,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16258,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16302,
"src": "31677:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16257,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31677:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31676:9:26"
},
"scope": 16593,
"src": "31607:332:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 16396,
"nodeType": "Block",
"src": "32294:1231:26",
"statements": [
{
"assignments": [
16311
],
"declarations": [
{
"constant": false,
"id": 16311,
"mutability": "mutable",
"name": "poolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32305:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16310,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32305:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16320,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16315,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "32351:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 16314,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32343:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 16313,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32343:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32343:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16312,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "32331:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 16317,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32331:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
"id": 16318,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21415,
"src": "32331:40:26",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 16319,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32331:42:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32305:68:26"
},
{
"assignments": [
16322
],
"declarations": [
{
"constant": false,
"id": 16322,
"mutability": "mutable",
"name": "sourceReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32384:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16321,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32384:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16326,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16324,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32430:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 16323,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "32415:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 16325,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32415:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32384:59:26"
},
{
"assignments": [
16328
],
"declarations": [
{
"constant": false,
"id": 16328,
"mutability": "mutable",
"name": "targetReserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32454:28:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16327,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32454:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16332,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16330,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32500:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
],
"id": 16329,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "32485:14:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21461_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 16331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32485:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32454:59:26"
},
{
"assignments": [
16334
],
"declarations": [
{
"constant": false,
"id": 16334,
"mutability": "mutable",
"name": "sourceReserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32524:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16333,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "32524:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16339,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16335,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "32553:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16337,
"indexExpression": {
"argumentTypes": null,
"id": 16336,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32562:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "32553:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16338,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "32553:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32524:58:26"
},
{
"assignments": [
16341
],
"declarations": [
{
"constant": false,
"id": 16341,
"mutability": "mutable",
"name": "targetReserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32593:26:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16340,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "32593:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16346,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16342,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "32622:8:26",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21461_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 16344,
"indexExpression": {
"argumentTypes": null,
"id": 16343,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32631:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "32622:22:26",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 16345,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "32622:29:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32593:58:26"
},
{
"assignments": [
16348
],
"declarations": [
{
"constant": false,
"id": 16348,
"mutability": "mutable",
"name": "rateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32732:13:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16347,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32732:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16353,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16351,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "32773:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16349,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "32748:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "32748:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16352,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32748:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32732:61:26"
},
{
"assignments": [
16355
],
"declarations": [
{
"constant": false,
"id": 16355,
"mutability": "mutable",
"name": "rateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16396,
"src": "32804:13:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16354,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32804:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16360,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16358,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "32845:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16356,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "32820:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "32820:24:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32820:45:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "32804:61:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16362,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "32897:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16363,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "32911:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16364,
"name": "rateN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16348,
"src": "32925:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16365,
"name": "rateD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16355,
"src": "32932:5:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16361,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "32881:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 16366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32881:57:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16367,
"nodeType": "EmitStatement",
"src": "32876:62:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16369,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33049:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16370,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "33066:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16371,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "33080:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16372,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "33102:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16368,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "33016:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16373,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33016:106:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16374,
"nodeType": "ExpressionStatement",
"src": "33016:106:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16376,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33166:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16377,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "33183:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16378,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "33197:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16379,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "33219:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16375,
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16428,
"src": "33133:32:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (uint256,contract IERC20Token,uint256,uint32)"
}
},
"id": 16380,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33133:106:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16381,
"nodeType": "ExpressionStatement",
"src": "33133:106:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16383,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16305,
"src": "33339:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16384,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33353:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16385,
"name": "sourceReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16322,
"src": "33370:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16386,
"name": "sourceReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16334,
"src": "33392:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16382,
"name": "PriceDataUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14455,
"src": "33323:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint256,uint256,uint32)"
}
},
"id": 16387,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33323:89:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16388,
"nodeType": "EmitStatement",
"src": "33318:94:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16390,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16307,
"src": "33444:12:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 16391,
"name": "poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16311,
"src": "33458:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16392,
"name": "targetReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16328,
"src": "33475:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16393,
"name": "targetReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16341,
"src": "33497:19:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 16389,
"name": "PriceDataUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14455,
"src": "33428:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint256,uint256,uint32)"
}
},
"id": 16394,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33428:89:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16395,
"nodeType": "EmitStatement",
"src": "33423:94:26"
}
]
},
"documentation": {
"id": 16303,
"nodeType": "StructuredDocumentation",
"src": "31947:242:26",
"text": " @dev dispatches token rate update events for the reserve tokens and the pool token\n @param _sourceToken address of the source reserve token\n @param _targetToken address of the target reserve token"
},
"id": 16397,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchTokenRateUpdateEvents",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16308,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16305,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16397,
"src": "32234:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16304,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "32234:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16307,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16397,
"src": "32260:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16306,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "32260:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32233:52:26"
},
"returnParameters": {
"id": 16309,
"nodeType": "ParameterList",
"parameters": [],
"src": "32294:0:26"
},
"scope": 16593,
"src": "32195:1330:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16427,
"nodeType": "Block",
"src": "33994:159:26",
"statements": [
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16413,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "34046:6:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 16412,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "34038:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 16411,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34038:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16414,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34038:15:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 16410,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21516,
"src": "34026:11:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21516_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 16415,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34026:28:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 16416,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16402,
"src": "34056:13:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16419,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "34091:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16417,
"name": "_reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16404,
"src": "34071:15:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16418,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "34071:19:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34071:35:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16423,
"name": "_reserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16406,
"src": "34129:14:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 16421,
"name": "_poolTokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16400,
"src": "34108:16:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16422,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22661,
"src": "34108:20:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16424,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34108:36:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21516",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16409,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "34010:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21461_$_t_contract$_IERC20Token_$21461_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 16425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34010:135:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 16426,
"nodeType": "EmitStatement",
"src": "34005:140:26"
}
]
},
"documentation": {
"id": 16398,
"nodeType": "StructuredDocumentation",
"src": "33533:304:26",
"text": " @dev dispatches token rate update event for the pool token\n @param _poolTokenSupply total pool token supply\n @param _reserveToken address of the reserve token\n @param _reserveBalance reserve balance\n @param _reserveWeight reserve weight"
},
"id": 16428,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchPoolTokenRateUpdateEvent",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16407,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16400,
"mutability": "mutable",
"name": "_poolTokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33885:24:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16399,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33885:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16402,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33911:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 16401,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21461,
"src": "33911:11:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21461",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16404,
"mutability": "mutable",
"name": "_reserveBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33938:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16403,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33938:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16406,
"mutability": "mutable",
"name": "_reserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16428,
"src": "33963:21:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 16405,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "33963:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33884:101:26"
},
"returnParameters": {
"id": 16408,
"nodeType": "ParameterList",
"parameters": [],
"src": "33994:0:26"
},
"scope": 16593,
"src": "33843:310:26",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 16436,
"nodeType": "Block",
"src": "34319:29:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 16434,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -17,
"src": "34337:3:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 16433,
"id": 16435,
"nodeType": "Return",
"src": "34330:10:26"
}
]
},
"documentation": {
"id": 16429,
"nodeType": "StructuredDocumentation",
"src": "34161:96:26",
"text": " @dev returns the current time\n utility to allow overrides for tests"
},
"id": 16437,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "time",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16430,
"nodeType": "ParameterList",
"parameters": [],
"src": "34276:2:26"
},
"returnParameters": {
"id": 16433,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16432,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16437,
"src": "34310:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16431,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34310:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34309:9:26"
},
"scope": 16593,
"src": "34263:85:26",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 16469,
"nodeType": "Block",
"src": "34709:122:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 16457,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16453,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16451,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34724:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16452,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34729:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "34724:9:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16456,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16454,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34737:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16455,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34742:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "34737:9:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "34724:22:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16464,
"nodeType": "IfStatement",
"src": "34720:77:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16459,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34784:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16460,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34788:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16461,
"name": "_max",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16444,
"src": "34792:4:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16458,
"name": "normalizedRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16521,
"src": "34768:15:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16462,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34768:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16450,
"id": 16463,
"nodeType": "Return",
"src": "34761:36:26"
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16465,
"name": "_n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16440,
"src": "34816:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16466,
"name": "_d",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16442,
"src": "34820:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16467,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "34815:8:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16450,
"id": 16468,
"nodeType": "Return",
"src": "34808:15:26"
}
]
},
"documentation": {
"id": 16438,
"nodeType": "StructuredDocumentation",
"src": "34356:246:26",
"text": " @dev computes a reduced-scalar ratio\n @param _n ratio numerator\n @param _d ratio denominator\n @param _max maximum desired scalar\n @return ratio's numerator and denominator"
},
"id": 16470,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "reducedRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16445,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16440,
"mutability": "mutable",
"name": "_n",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34630:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16439,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34630:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16442,
"mutability": "mutable",
"name": "_d",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34642:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16441,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34642:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16444,
"mutability": "mutable",
"name": "_max",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34654:12:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16443,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34654:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34629:38:26"
},
"returnParameters": {
"id": 16450,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16447,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34691:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16446,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34691:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16449,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16470,
"src": "34700:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16448,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34700:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34690:18:26"
},
"scope": 16593,
"src": "34608:223:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 16520,
"nodeType": "Block",
"src": "35034:239:26",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16484,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35049:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 16485,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35055:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35049:8:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16495,
"nodeType": "IfStatement",
"src": "35045:58:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16487,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35080:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16488,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35089:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "35080:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16492,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16490,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35092:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 16491,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35101:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "35092:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16493,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35079:24:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16494,
"nodeType": "Return",
"src": "35072:31:26"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16496,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35118:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 16497,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35123:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35118:7:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16505,
"nodeType": "IfStatement",
"src": "35114:62:26",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16500,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35161:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16501,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35165:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16502,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35169:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16499,
"name": "accurateRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16592,
"src": "35147:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16503,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35147:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16504,
"nodeType": "Return",
"src": "35140:36:26"
}
},
{
"assignments": [
16507,
16509
],
"declarations": [
{
"constant": false,
"id": 16507,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16520,
"src": "35188:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16506,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35188:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16509,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16520,
"src": "35199:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16508,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35199:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16515,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16511,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16475,
"src": "35226:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16512,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16473,
"src": "35230:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16513,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16477,
"src": "35234:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16510,
"name": "accurateRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16592,
"src": "35212:13:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)"
}
},
"id": 16514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35212:29:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35187:54:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16516,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16509,
"src": "35260:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16517,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16507,
"src": "35263:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16518,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35259:6:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16483,
"id": 16519,
"nodeType": "Return",
"src": "35252:13:26"
}
]
},
"documentation": {
"id": 16471,
"nodeType": "StructuredDocumentation",
"src": "34839:83:26",
"text": " @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\"."
},
"id": 16521,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "normalizedRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16478,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16473,
"mutability": "mutable",
"name": "_a",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34953:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16472,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34953:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16475,
"mutability": "mutable",
"name": "_b",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34965:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16474,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34965:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16477,
"mutability": "mutable",
"name": "_scale",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "34977:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16476,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34977:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34952:40:26"
},
"returnParameters": {
"id": 16483,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16480,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "35016:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16479,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35016:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16482,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16521,
"src": "35025:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16481,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35025:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35015:18:26"
},
"scope": 16593,
"src": "34928:345:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 16591,
"nodeType": "Block",
"src": "35497:300:26",
"statements": [
{
"assignments": [
16536
],
"declarations": [
{
"constant": false,
"id": 16536,
"mutability": "mutable",
"name": "maxVal",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35508:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16535,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35508:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16544,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16543,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16540,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "35533:2:26",
"subExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16539,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35534:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
],
"id": 16538,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "35525:7:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 16537,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35525:7:26",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 16541,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35525:11:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 16542,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35539:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35525:20:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35508:37:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16547,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16545,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35560:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"id": 16546,
"name": "maxVal",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16536,
"src": "35565:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35560:11:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 16568,
"nodeType": "IfStatement",
"src": "35556:121:26",
"trueBody": {
"id": 16567,
"nodeType": "Block",
"src": "35573:104:26",
"statements": [
{
"assignments": [
16549
],
"declarations": [
{
"constant": false,
"id": 16549,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16567,
"src": "35588:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16548,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35588:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16558,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16555,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16550,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35600:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16553,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16551,
"name": "maxVal",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16536,
"src": "35606:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16552,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35615:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "35606:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16554,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35605:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35600:17:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 16556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "35620:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "35600:21:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35588:33:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16561,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16559,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35636:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 16560,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16549,
"src": "35642:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35636:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16562,
"nodeType": "ExpressionStatement",
"src": "35636:7:26"
},
{
"expression": {
"argumentTypes": null,
"id": 16565,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16563,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16526,
"src": "35658:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "/=",
"rightHandSide": {
"argumentTypes": null,
"id": 16564,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16549,
"src": "35664:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35658:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16566,
"nodeType": "ExpressionStatement",
"src": "35658:7:26"
}
]
}
},
{
"assignments": [
16570
],
"declarations": [
{
"constant": false,
"id": 16570,
"mutability": "mutable",
"name": "x",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35687:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16569,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35687:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16580,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16574,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16572,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35708:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 16573,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35713:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35708:11:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 16577,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16526,
"src": "35728:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 16575,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16524,
"src": "35721:2:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22605,
"src": "35721:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16578,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35721:10:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16571,
"name": "roundDiv",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16251,
"src": "35699:8:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 16579,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "35699:33:26",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35687:45:26"
},
{
"assignments": [
16582
],
"declarations": [
{
"constant": false,
"id": 16582,
"mutability": "mutable",
"name": "y",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16591,
"src": "35743:9:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16581,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35743:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16586,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 16585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 16583,
"name": "_scale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16528,
"src": "35755:6:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 16584,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16570,
"src": "35764:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "35755:10:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "35743:22:26"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 16587,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16570,
"src": "35784:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 16588,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16582,
"src": "35787:1:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 16589,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "35783:6:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 16534,
"id": 16590,
"nodeType": "Return",
"src": "35776:13:26"
}
]
},
"documentation": {
"id": 16522,
"nodeType": "StructuredDocumentation",
"src": "35281:106:26",
"text": " @dev computes \"scale * a / (a + b)\" and \"scale * b / (a + b)\", assuming that \"a < b\"."
},
"id": 16592,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "accurateRatio",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 16529,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16524,
"mutability": "mutable",
"name": "_a",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35416:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16523,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35416:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16526,
"mutability": "mutable",
"name": "_b",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35428:10:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16525,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35428:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16528,
"mutability": "mutable",
"name": "_scale",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35440:14:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16527,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35440:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35415:40:26"
},
"returnParameters": {
"id": 16534,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 16531,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35479:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16530,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35479:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16533,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 16592,
"src": "35488:7:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16532,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "35488:7:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "35478:18:26"
},
"scope": 16593,
"src": "35393:404:26",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 16594,
"src": "519:35281:26"
}
],
"src": "52:35750:26"
},
"compiler": {
"name": "solc",
"version": "0.6.12+commit.27d51765.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-11-10T14:20:35.927Z",
"devdoc": {
"details": "Liquidity Pool v1 Converter The liquidity pool v1 converter is a specialized version of a converter that manages a classic bancor liquidity pool. Even though pools can have many reserves, the standard pool configuration is 2 reserves with 50%/50% weights.",
"events": {
"PriceDataUpdate(address,uint256,uint256,uint32)": {
"details": "triggered after a conversion with new price data deprecated, use `TokenRateUpdate` from version 28 and up",
"params": {
"_connectorBalance": "reserve balance",
"_connectorToken": "reserve token",
"_connectorWeight": "reserve weight",
"_tokenSupply": "smart token supply"
}
}
},
"kind": "dev",
"methods": {
"acceptAnchorOwnership()": {
"details": "accepts ownership of the anchor after an ownership transfer also activates the converter can only be called by the contract owner note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"acceptOwnership()": {
"details": "used by a new owner to accept an ownership transfer"
},
"acceptTokenOwnership()": {
"details": "deprecated, backward compatibility"
},
"addLiquidity(address[],uint256[],uint256)": {
"details": "increases the pool's liquidity and mints new shares in the pool to the caller note that prior to version 28, you should use 'fund' instead",
"params": {
"_minReturn": "token minimum return-amount",
"_reserveAmounts": "amount of each reserve token",
"_reserveTokens": "address of each reserve token"
},
"returns": {
"_0": "amount of pool tokens issued"
}
},
"addLiquidityCost(address[],uint256,uint256)": {
"details": "given the amount of one of the reserve tokens to add liquidity of, returns the required amount of each one of the other reserve tokens since an empty pool can be funded with any list of non-zero input amounts, this function assumes that the pool is not empty (has already been funded)",
"params": {
"_reserveAmount": "amount of the relevant reserve token",
"_reserveTokenIndex": "index of the relevant reserve token",
"_reserveTokens": "address of each reserve token"
},
"returns": {
"_0": "the required amount of each one of the reserve tokens"
}
},
"addLiquidityReturn(address,uint256)": {
"details": "given the amount of one of the reserve tokens to add liquidity of, returns the amount of pool tokens entitled for it since an empty pool can be funded with any list of non-zero input amounts, this function assumes that the pool is not empty (has already been funded)",
"params": {
"_reserveAmount": "amount of the reserve token",
"_reserveToken": "address of the reserve token"
},
"returns": {
"_0": "the amount of pool tokens entitled"
}
},
"addReserve(address,uint32)": {
"details": "defines a new reserve token for the converter can only be called by the owner while the converter is inactive",
"params": {
"_token": "address of the reserve token",
"_weight": "reserve weight, represented in ppm, 1-1000000"
}
},
"connectorTokenCount()": {
"details": "deprecated, backward compatibility"
},
"connectorTokens(uint256)": {
"details": "deprecated, backward compatibility"
},
"connectors(address)": {
"details": "deprecated, backward compatibility"
},
"constructor": {
"details": "initializes a new LiquidityPoolV1Converter instance",
"params": {
"_maxConversionFee": "maximum conversion fee, represented in ppm",
"_registry": "address of a contract registry contract",
"_token": "pool token governed by the converter"
}
},
"convert(address,address,uint256,address,address)": {
"details": "converts a specific amount of source tokens to target tokens can only be called by the bancor network contract",
"params": {
"_amount": "amount of tokens to convert (in units of the source token)",
"_beneficiary": "wallet to receive the conversion result",
"_sourceToken": "source ERC20 token",
"_targetToken": "target ERC20 token",
"_trader": "address of the caller who executed the conversion"
},
"returns": {
"_0": "amount of tokens received (in units of the target token)"
}
},
"converterType()": {
"details": "returns the converter type",
"returns": {
"_0": "see the converter types in the the main contract doc"
}
},
"decimalLength(uint256)": {
"details": "returns the number of decimal digits in a given value",
"params": {
"_x": "value (assumed positive)"
},
"returns": {
"_0": "the number of decimal digits in the given value"
}
},
"fund(uint256)": {
"details": "increases the pool's liquidity and mints new shares in the pool to the caller for example, if the caller increases the supply by 10%, then it will cost an amount equal to 10% of each reserve token balance note that starting from version 28, you should use 'addLiquidity' instead",
"params": {
"_amount": "amount to increase the supply by (in the pool token)"
},
"returns": {
"_0": "amount of pool tokens issued"
}
},
"geometricMean(uint256[])": {
"details": "returns the average number of decimal digits in a given list of values",
"params": {
"_values": "list of values (each of which assumed positive)"
},
"returns": {
"_0": "the average number of decimal digits in the given list of values"
}
},
"getConnectorBalance(address)": {
"details": "deprecated, backward compatibility"
},
"getReturn(address,address,uint256)": {
"details": "deprecated, backward compatibility"
},
"hasETHReserve()": {
"details": "checks whether or not the converter has an ETH reserve",
"returns": {
"_0": "true if the converter has an ETH reserve, false otherwise"
}
},
"isActive()": {
"details": "returns true if the converter is active, false otherwise",
"returns": {
"_0": "true if the converter is active, false otherwise"
}
},
"isV28OrHigher()": {
"details": "checks whether or not the converter version is 28 or higher",
"returns": {
"_0": "true, since the converter version is 28 or higher"
}
},
"liquidate(uint256)": {
"details": "decreases the pool's liquidity and burns the caller's shares in the pool for example, if the holder sells 10% of the supply, then they will receive 10% of each reserve token balance in return note that starting from version 28, you should use 'removeLiquidity' instead",
"params": {
"_amount": "amount to liquidate (in the pool token)"
},
"returns": {
"_0": "the amount of each reserve token granted for the given amount of pool tokens"
}
},
"recentAverageRate(address)": {
"details": "returns the recent average rate of 1 `_token` in the other reserve token units note that the rate can only be queried for reserves in a standard pool",
"params": {
"_token": "token to get the rate for"
},
"returns": {
"_0": "recent average rate between the reserves (numerator)",
"_1": "recent average rate between the reserves (denominator)"
}
},
"removeLiquidity(uint256,address[],uint256[])": {
"details": "decreases the pool's liquidity and burns the caller's shares in the pool note that prior to version 28, you should use 'liquidate' instead",
"params": {
"_amount": "token amount",
"_reserveMinReturnAmounts": "minimum return-amount of each reserve token",
"_reserveTokens": "address of each reserve token"
},
"returns": {
"_0": "the amount of each reserve token granted for the given amount of pool tokens"
}
},
"removeLiquidityReturn(uint256,address[])": {
"details": "returns the amount of each reserve token entitled for a given amount of pool tokens",
"params": {
"_amount": "amount of pool tokens",
"_reserveTokens": "address of each reserve token"
},
"returns": {
"_0": "the amount of each reserve token entitled for the given amount of pool tokens"
}
},
"reserveBalance(address)": {
"details": "returns the reserve's balance note that prior to version 17, you should use 'getConnectorBalance' instead",
"params": {
"_reserveToken": "reserve token contract address"
},
"returns": {
"_0": "reserve balance"
}
},
"reserveTokenCount()": {
"details": "returns the number of reserve tokens defined note that prior to version 17, you should use 'connectorTokenCount' instead",
"returns": {
"_0": "number of reserve tokens"
}
},
"reserveWeight(address)": {
"details": "returns the reserve's weight added in version 28",
"params": {
"_reserveToken": "reserve token contract address"
},
"returns": {
"_0": "reserve weight"
}
},
"restoreRegistry()": {
"details": "restores the previous contract-registry"
},
"restrictRegistryUpdate(bool)": {
"details": "restricts the permission to update the contract-registry",
"params": {
"_onlyOwnerCanUpdateRegistry": "indicates whether or not permission is restricted to owner only"
}
},
"roundDiv(uint256,uint256)": {
"details": "returns the nearest integer to a given quotient",
"params": {
"_d": "quotient denominator",
"_n": "quotient numerator"
},
"returns": {
"_0": "the nearest integer to the given quotient"
}
},
"setConversionFee(uint32)": {
"details": "updates the current conversion fee can only be called by the contract owner",
"params": {
"_conversionFee": "new conversion fee, represented in ppm"
}
},
"setConversionWhitelist(address)": {
"details": "allows the owner to update & enable the conversion whitelist contract address when set, only addresses that are whitelisted are actually allowed to use the converter note that the whitelist check is actually done by the BancorNetwork contract",
"params": {
"_whitelist": "address of a whitelist contract"
}
},
"targetAmountAndFee(address,address,uint256)": {
"details": "returns the expected target amount of converting one reserve to another along with the fee",
"params": {
"_amount": "amount of tokens received from the user",
"_sourceToken": "contract address of the source reserve token",
"_targetToken": "contract address of the target reserve token"
},
"returns": {
"_0": "expected target amount",
"_1": "expected fee"
}
},
"token()": {
"details": "deprecated since version 28, backward compatibility - use only for earlier versions"
},
"transferAnchorOwnership(address)": {
"details": "transfers the anchor ownership the new owner needs to accept the transfer can only be called by the converter upgrder while the upgrader is the owner note that prior to version 28, you should use 'transferAnchorOwnership' instead",
"params": {
"_newOwner": "new token owner"
}
},
"transferOwnership(address)": {
"details": "allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner",
"params": {
"_newOwner": "new contract owner"
}
},
"transferTokenOwnership(address)": {
"details": "deprecated, backward compatibility"
},
"updateRegistry()": {
"details": "updates to the new contract-registry"
},
"upgrade()": {
"details": "upgrades the converter to the latest version can only be called by the owner note that the owner needs to call acceptOwnership on the new converter after the upgrade"
},
"withdrawETH(address)": {
"details": "withdraws ether can only be called by the owner if the converter is inactive or by upgrader contract can only be called after the upgrader contract has accepted the ownership of this contract can only be called if the converter has an ETH reserve",
"params": {
"_to": "address to send the ETH to"
}
},
"withdrawFromAnchor(address,address,uint256)": {
"details": "withdraws tokens held by the anchor and sends them to an account can only be called by the owner",
"params": {
"_amount": "amount to withdraw",
"_to": "account to receive the new amount",
"_token": "ERC20 token contract address"
}
},
"withdrawTokens(address,address,uint256)": {
"details": "withdraws tokens held by the converter and sends them to an account can only be called by the owner note that reserve tokens can only be withdrawn by the owner while the converter is inactive unless the owner is the converter upgrader contract",
"params": {
"_amount": "amount to withdraw",
"_to": "account to receive the new amount",
"_token": "ERC20 token contract address"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}