cic-stack/apps/cic-eth/tests/testdata/bancor/LiquidTokenConverter.json

19724 lines
945 KiB
JSON

{
"contractName": "LiquidTokenConverter",
"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": "_prevOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "OwnerUpdate",
"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": "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": "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"
}
],
"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\":\"_prevOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdate\",\"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\":\"_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\":\"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\":\"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\":\"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\":[{\"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\":\"Liquid Token Converter The liquid token converter is a specialized version of a converter that manages a liquid token. The converters govern a token with a single reserve and allow converting between the two. Liquid tokens usually have fractional reserve (reserve ratio smaller than 100%).\",\"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\"},\"addReserve(address,uint32)\":{\"details\":\"defines the reserve token for the converter can only be called by the owner while the converter is inactive and the reserve wasn't defined yet\",\"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 LiquidTokenConverter instance\",\"params\":{\"_maxConversionFee\":\"maximum conversion fee, represented in ppm\",\"_registry\":\"address of a contract registry contract\",\"_token\":\"liquid 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\"}},\"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\"}},\"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\"}},\"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 the source token to the target token along with the fee\",\"params\":{\"_amount\":\"amount of tokens received from the user\",\"_sourceToken\":\"contract address of the source token\",\"_targetToken\":\"contract address of the target 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/liquid-token/LiquidTokenConverter.sol\":\"LiquidTokenConverter\"},\"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/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/liquid-token/LiquidTokenConverter.sol\":{\"keccak256\":\"0x71b0a2afa4f9c0f92b1607326dd1f13397cf11a4098b6580bfd9e83efcd65539\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://cce0ca5c0e627f2455c0fe3bf1148f01c1c58c34f557df148cfa88e8c94bf20e\",\"dweb:/ipfs/QmNUGi7KbbNT6wtKSd6fuySsX9FT21eqkomQZDGK4BoMHy\"]},\"/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/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": "0x60806040526003805460ff60a81b19169055600880546001600160601b03191690553480156200002e57600080fd5b50604051620031db380380620031db833981810160405260608110156200005457600080fd5b5080516020820151604090920151600080546001600160a01b03191633179055909190828282818062000087816200011e565b50600280546001600160a01b039092166001600160a01b031992831681179091556003805490921617905582620000be816200011e565b81620000ca816200017d565b5050600480546001600160a01b039094166001600160a01b031990941693909317909255506008805463ffffffff9092166401000000000263ffffffff60201b1990921691909117905550620001dc915050565b6001600160a01b0381166200017a576040805162461bcd60e51b815260206004820152601360248201527f4552525f494e56414c49445f4144445245535300000000000000000000000000604482015290519081900360640190fd5b50565b620f424063ffffffff821611156200017a576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b612fef80620001ec6000396000f3fe6080604052600436106102765760003560e01c806371f52bf31161014f578063d031370b116100c1578063d89595121161007a578063d8959512146108e7578063dc8de3791461092c578063e8dc12ff1461095f578063ecbca55d146109a5578063f2fde38b146109d5578063fc0c546a14610a085761030d565b8063d031370b14610836578063d260529c14610860578063d3fb73b414610875578063d4ee1d901461088a578063d55ec6971461089f578063d66bd524146108b45761030d565b80639b99a8e2116101135780639b99a8e21461078a578063af94b8d81461079f578063b4a176d3146107e2578063bf754558146107f7578063c45d3d921461080c578063cdc91c69146108215761030d565b806371f52bf31461072157806379ba5097146107365780637b1039991461074b5780638da5cb5b1461076057806394c275ad146107755761030d565b8063395900d4116101e8578063579cd3ca116101ac578063579cd3ca1461060f5780635e35359e1461062457806361cd756e1461066757806367b6d57c1461067c578063690d8320146106af5780636a49d2c4146106e25761030d565b8063395900d4146105435780633e8ff43f1461058657806349d10b64146105b25780634af80f0e146105c757806354fd4d50146105fa5761030d565b80631cfab2901161023a5780631cfab290146104425780631e1401f81461047557806321e6b53d146104d157806322f3e2d4146105045780632fe8a6ad1461051957806338a5e0161461052e5761030d565b8063024c7ec7146103125780630c7d5cd81461033e5780630e53aae91461036c57806312c2aca4146103d357806319b64015146103fc5761030d565b3661030d5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1661030b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b005b600080fd5b34801561031e57600080fd5b5061030b6004803603602081101561033557600080fd5b50351515610a1d565b34801561034a57600080fd5b50610353610a43565b6040805163ffffffff9092168252519081900360200190f35b34801561037857600080fd5b5061039f6004803603602081101561038f57600080fd5b50356001600160a01b0316610a4f565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156103df57600080fd5b506103e8610ae7565b604080519115158252519081900360200190f35b34801561040857600080fd5b506104266004803603602081101561041f57600080fd5b5035610b33565b604080516001600160a01b039092168252519081900360200190f35b34801561044e57600080fd5b506103536004803603602081101561046557600080fd5b50356001600160a01b0316610b5d565b34801561048157600080fd5b506104b86004803603606081101561049857600080fd5b506001600160a01b03813581169160208101359091169060400135610b8f565b6040805192835260208301919091528051918290030190f35b3480156104dd57600080fd5b5061030b600480360360208110156104f457600080fd5b50356001600160a01b0316610baa565b34801561051057600080fd5b506103e8610bbe565b34801561052557600080fd5b506103e8610c3d565b34801561053a57600080fd5b5061030b610c4d565b34801561054f57600080fd5b5061030b6004803603606081101561056657600080fd5b506001600160a01b03813581169160208101359091169060400135610c5f565b34801561059257600080fd5b5061059b610ce5565b6040805161ffff9092168252519081900360200190f35b3480156105be57600080fd5b5061030b610cea565b3480156105d357600080fd5b5061030b600480360360208110156105ea57600080fd5b50356001600160a01b0316610ef2565b34801561060657600080fd5b5061059b610f27565b34801561061b57600080fd5b50610353610f2c565b34801561063057600080fd5b5061030b6004803603606081101561064757600080fd5b506001600160a01b03813581169160208101359091169060400135610f3f565b34801561067357600080fd5b50610426611070565b34801561068857600080fd5b5061030b6004803603602081101561069f57600080fd5b50356001600160a01b031661107f565b3480156106bb57600080fd5b5061030b600480360360208110156106d257600080fd5b50356001600160a01b031661112b565b3480156106ee57600080fd5b5061030b6004803603604081101561070557600080fd5b5080356001600160a01b0316906020013563ffffffff1661125e565b34801561072d57600080fd5b5061059b6112ce565b34801561074257600080fd5b5061030b6112dd565b34801561075757600080fd5b50610426611394565b34801561076c57600080fd5b506104266113a3565b34801561078157600080fd5b506103536113b2565b34801561079657600080fd5b5061059b6113c6565b3480156107ab57600080fd5b506104b8600480360360608110156107c257600080fd5b506001600160a01b038135811691602081013590911690604001356113cc565b3480156107ee57600080fd5b5061030b6114b5565b34801561080357600080fd5b506103e86114e1565b34801561081857600080fd5b506104266114e6565b34801561082d57600080fd5b5061030b6114f5565b34801561084257600080fd5b506104266004803603602081101561085957600080fd5b503561154e565b34801561086c57600080fd5b506103e8611575565b34801561088157600080fd5b5061042661157a565b34801561089657600080fd5b50610426611589565b3480156108ab57600080fd5b5061030b611598565b3480156108c057600080fd5b5061039f600480360360208110156108d757600080fd5b50356001600160a01b0316611680565b3480156108f357600080fd5b5061091a6004803603602081101561090a57600080fd5b50356001600160a01b03166116c3565b60408051918252519081900360200190f35b34801561093857600080fd5b5061091a6004803603602081101561094f57600080fd5b50356001600160a01b03166116d4565b61091a600480360360a081101561097557600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135821691608090910135166116fd565b3480156109b157600080fd5b5061030b600480360360208110156109c857600080fd5b503563ffffffff1661190d565b3480156109e157600080fd5b5061030b600480360360208110156109f857600080fd5b50356001600160a01b03166119f5565b348015610a1457600080fd5b50610426611a73565b610a25611a82565b60038054911515600160a01b0260ff60a01b19909216919091179055565b60085463ffffffff1681565b6000806000806000610a5f612f8b565b505050506001600160a01b03929092166000908152600760209081526040808320815160a081018352815480825260019092015463ffffffff811694820185905260ff64010000000082048116151594830194909452650100000000008104841615156060830152600160301b90049092161515608090920182905295919450919250829190565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1690565b600060068281548110610b4257fe5b6000918252602090912001546001600160a01b031692915050565b600081610b6981611ad5565b50506001600160a01b031660009081526007602052604090206001015463ffffffff1690565b600080610b9d8585856113cc565b915091505b935093915050565b610bb2611a82565b610bbb8161107f565b50565b6004805460408051638da5cb5b60e01b8152905160009330936001600160a01b031692638da5cb5b9281830192602092829003018186803b158015610c0257600080fd5b505afa158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b50516001600160a01b031614905090565b600354600160a01b900460ff1681565b610c55611a82565b610c5d6114f5565b565b610c67611a82565b6004805460408051632f1a9acf60e11b81526001600160a01b038781169482019490945285841660248201526044810185905290519290911691635e35359e9160648082019260009290919082900301818387803b158015610cc857600080fd5b505af1158015610cdc573d6000803e3d6000fd5b50505050505050565b600090565b6000546001600160a01b0316331480610d0d5750600354600160a01b900460ff16155b610d52576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6000610d706f436f6e7472616374526567697374727960801b611b42565b6002549091506001600160a01b03808316911614801590610d9957506001600160a01b03811615155b610de1576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60006001600160a01b0316816001600160a01b031663bb34534c6f436f6e7472616374526567697374727960801b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610e4357600080fd5b505afa158015610e57573d6000803e3d6000fd5b505050506040513d6020811015610e6d57600080fd5b50516001600160a01b03161415610ec2576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60028054600380546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b610efa611a82565b80610f0481611bc0565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b602781565b600854600160401b900463ffffffff1681565b610f47611c14565b6003805460ff60a81b1916600160a81b179055610f62611a82565b6000610f87762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b6001600160a01b038516600090815260076020526040902060010154909150600160301b900460ff161580610fc15750610fbf610bbe565b155b80610fd957506000546001600160a01b038281169116145b61101e576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611029848484611c64565b6001600160a01b038416600090815260076020526040902060010154600160301b900460ff161561105d5761105d84611c95565b50506003805460ff60a81b191690555050565b6003546001600160a01b031681565b611087611a82565b762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b6110ab81611d73565b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561110f57600080fd5b505af1158015611123573d6000803e3d6000fd5b505050505050565b611133611c14565b6003805460ff60a81b1916600160a81b17905561114e611a82565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61116c81611ad5565b6000611191762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b905061119b610bbe565b15806111b457506000546001600160a01b038281169116145b6111f9576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6040516001600160a01b038416904780156108fc02916000818181858888f1935050505015801561122e573d6000803e3d6000fd5b5061124c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee611c95565b50506003805460ff60a81b1916905550565b611266611a82565b61126e6113c6565b61ffff16156112c0576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b6112ca8282611dd5565b5050565b60006112d86113c6565b905090565b6001546001600160a01b03163314611330576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6002546001600160a01b031681565b6000546001600160a01b031681565b600854640100000000900463ffffffff1681565b60065490565b60045460009081906001600160a01b03858116911614801561141057506001600160a01b038516600090815260076020526040902060010154600160301b900460ff165b156114275761141e83611ff7565b91509150610ba2565b6004546001600160a01b03868116911614801561146657506001600160a01b038416600090815260076020526040902060010154600160301b900460ff165b156114745761141e836121e9565b6040805162461bcd60e51b815260206004820152601160248201527022a9292fa4a72b20a624a22faa27a5a2a760791b604482015290519081900360640190fd5b6114bd611a82565b600354600280546001600160a01b0319166001600160a01b03909216919091179055565b600181565b6005546001600160a01b031681565b6114fd611a82565b6115056122dd565b6004546001906001600160a01b031661151c610ce5565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4565b6006818154811061155b57fe5b6000918252602090912001546001600160a01b0316905081565b600190565b6004546001600160a01b031681565b6001546001600160a01b031681565b6115a0611a82565b60006115c5762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b6004549091506000906001600160a01b03166115df610ce5565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4611618816119f5565b6040805163487ac64b60e11b81526027600482015290516001600160a01b038316916390f58c9691602480830192600092919082900301818387803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b50505050610bbb6112dd565b6007602052600090815260409020805460019091015463ffffffff81169060ff6401000000008204811691650100000000008104821691600160301b9091041685565b60006116ce826116d4565b92915050565b6000816116e081611ad5565b50506001600160a01b031660009081526007602052604090205490565b6000611707611c14565b6003805460ff60a81b1916600160a81b1790556c42616e636f724e6574776f726b60981b61173481611d73565b856001600160a01b0316876001600160a01b03161415611794576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b6005546001600160a01b031615806118a1575060055460408051633af32abf60e01b81526001600160a01b03878116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156117f457600080fd5b505afa158015611808573d6000803e3d6000fd5b505050506040513d602081101561181e57600080fd5b505180156118a1575060055460408051633af32abf60e01b81526001600160a01b03868116600483015291519190921691633af32abf916024808301926020929190829003018186803b15801561187457600080fd5b505afa158015611888573d6000803e3d6000fd5b505050506040513d602081101561189e57600080fd5b50515b6118e8576040805162461bcd60e51b815260206004820152601360248201527211549497d393d517d5d2125511531254d51151606a1b604482015290519081900360640190fd5b6118f587878787876123a4565b6003805460ff60a81b19169055979650505050505050565b611915611a82565b60085463ffffffff6401000000009091048116908216111561197e576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6008546040805163ffffffff600160401b90930483168152918316602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a16008805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6119fd611a82565b6000546001600160a01b0382811691161415611a51576040805162461bcd60e51b815260206004820152600e60248201526d22a9292fa9a0a6a2afa7aba722a960911b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031690565b6000546001600160a01b03163314610c5d576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260076020526040902060010154600160301b900460ff16610bbb576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60025460408051632ecd14d360e21b81526004810184905290516000926001600160a01b03169163bb34534c916024808301926020929190829003018186803b158015611b8e57600080fd5b505afa158015611ba2573d6000803e3d6000fd5b505050506040513d6020811015611bb857600080fd5b505192915050565b6001600160a01b038116301415610bbb576040805162461bcd60e51b815260206004820152601360248201527222a9292fa0a2222922a9a9afa4a9afa9a2a62360691b604482015290519081900360640190fd5b600354600160a81b900460ff1615610c5d576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b611c6c611a82565b82611c768161256d565b82611c808161256d565b83611c8a81611bc0565b6111238686866125be565b80611c9f81611ad5565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611ce4576001600160a01b03821660009081526007602052604090204790556112ca565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611d2a57600080fd5b505afa158015611d3e573d6000803e3d6000fd5b505050506040513d6020811015611d5457600080fd5b50516001600160a01b0383166000908152600760205260409020555050565b611d7c81611b42565b6001600160a01b0316336001600160a01b031614610bbb576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611ddd611a82565b611de561271e565b81611def8161256d565b82611df981611bc0565b82611e0381612765565b6004546001600160a01b03868116911614801590611e4457506001600160a01b038516600090815260076020526040902060010154600160301b900460ff16155b611e8b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60085463ffffffff908116620f42400381169085161115611ef3576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b61ffff611efe6113c6565b61ffff1610611f50576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b5050506001600160a01b0390911660008181526007602052604081208181556001908101805466ff0000000000001963ffffffff80881663ffffffff199384161791909116600160301b179092556006805493840181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910180546001600160a01b031916909317909255600880548084169094019092169216919091179055565b6000806120026127d5565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561205257600080fd5b505afa158015612066573d6000803e3d6000fd5b505050506040513d602081101561207c57600080fd5b505160068054919250600091829061209057fe5b6000918252602090912001546001600160a01b03169050816120f9576001600160a01b0381166000908152600760205260409020600101546120ec9063ffffffff908116906120e6908890620f42409061281d16565b90612882565b60009350935050506121e4565b60006121146c42616e636f72466f726d756c6160981b611b42565b6001600160a01b031663f3250fe28461212c856116d4565b6001600160a01b0386166000908152600760209081526040918290206001015482516001600160e01b031960e088901b1681526004810195909552602485019390935263ffffffff9092166044840152606483018b905251608480840193829003018186803b15801561219e57600080fd5b505afa1580156121b2573d6000803e3d6000fd5b505050506040513d60208110156121c857600080fd5b5051905060006121d7826128e1565b9182900395509093505050505b915091565b6000806121f46127d5565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d602081101561226e57600080fd5b505160068054919250600091829061228257fe5b6000918252602090912001546001600160a01b03169050818514156122aa576120ec816116d4565b60006122c56c42616e636f72466f726d756c6160981b611b42565b6001600160a01b03166376cf0b568461212c856116d4565b6122e5611a82565b60006122ef6113c6565b61ffff1611612341576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b60048054604080516379ba509760e01b815290516001600160a01b03909216926379ba509792828201926000929082900301818387803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b50505050610c5d61290c565b600454600090819081906001600160a01b0388811691161480156123ea57506001600160a01b038816600090815260076020526040902060010154600160301b900460ff165b156124035750866123fc86868661294c565b9150612454565b6004546001600160a01b03898116911614801561244257506001600160a01b038716600090815260076020526040902060010154600160301b900460ff165b156114745750856123fc868686612bc0565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156124a457600080fd5b505afa1580156124b8573d6000803e3d6000fd5b505050506040513d60208110156124ce57600080fd5b50516001600160a01b0380841660008181526007602052604090206001015460045493945063ffffffff16929091167f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c24612534620f424061252e886116d4565b9061281d565b6125478663ffffffff8088169061281d16565b6040805192835260208301919091528051918290030190a3509198975050505050505050565b6001600160a01b038116610bbb576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f4144445245535360681b604482015290519081900360640190fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b6020831061263b5780518252601f19909201916020918201910161261c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461269d576040519150601f19603f3d011682016040523d82523d6000602084013e6126a2565b606091505b50915091508180156126d05750805115806126d057508080602001905160208110156126cd57600080fd5b50515b612717576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b5050505050565b612726610bbe565b15610c5d576040805162461bcd60e51b815260206004820152600a6024820152694552525f41435449564560b01b604482015290519081900360640190fd5b60008163ffffffff161180156127845750620f424063ffffffff821611155b610bbb576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b6127dd610bbe565b610c5d576040805162461bcd60e51b815260206004820152600c60248201526b4552525f494e41435449564560a01b604482015290519081900360640190fd5b60008261282c575060006116ce565b8282028284828161283957fe5b041461287b576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b9392505050565b60008082116128cd576040805162461bcd60e51b81526020600482015260126024820152714552525f4449564944455f42595f5a45524f60701b604482015290519081900360640190fd5b60008284816128d857fe5b04949350505050565b6008546000906116ce90620f4240906120e6908590600160401b900463ffffffff9081169061281d16565b60065460005b818110156112ca576129446006828154811061292a57fe5b6000918252602090912001546001600160a01b0316611c95565b600101612912565b600080600061295a86611ff7565b9150915081600014156129ad576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b600060066000815481106129bd57fe5b6000918252602090912001546001600160a01b0316905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee811415612a4957863414612a44576040805162461bcd60e51b815260206004820152601760248201527f4552525f4554485f414d4f554e545f4d49534d41544348000000000000000000604482015290519081900360640190fd5b612b20565b34158015612ada575086612ad7612a5f836116d4565b604080516370a0823160e01b815230600482015290516001600160a01b038616916370a08231916024808301926020929190829003018186803b158015612aa557600080fd5b505afa158015612ab9573d6000803e3d6000fd5b505050506040513d6020811015612acf57600080fd5b505190612ed5565b10155b612b20576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b612b2981611c95565b600480546040805163219e412d60e21b81526001600160a01b0389811694820194909452602481018790529051929091169163867904b49160448082019260009290919082900301818387803b158015612b8257600080fd5b505af1158015612b96573d6000803e3d6000fd5b5050600454612bb592508391506001600160a01b0316888a8787612f22565b509095945050505050565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015612c0f57600080fd5b505afa158015612c23573d6000803e3d6000fd5b505050506040513d6020811015612c3957600080fd5b5051841115612c84576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600080612c90866121e9565b915091508160001415612ce3576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b60006006600081548110612cf357fe5b600091825260208083209091015460048054604080516318160ddd60e01b815290516001600160a01b03948516975091909316936318160ddd938084019391929190829003018186803b158015612d4957600080fd5b505afa158015612d5d573d6000803e3d6000fd5b505050506040513d6020811015612d7357600080fd5b505190506000612d82836116d4565b905080851080612d9b57508085148015612d9b57508189145b612da157fe5b600480546040805163a24835d160e01b81523093810193909352602483018c9052516001600160a01b039091169163a24835d191604480830192600092919082900301818387803b158015612df557600080fd5b505af1158015612e09573d6000803e3d6000fd5b5050506001600160a01b038416600090815260076020526040902054612e30915086612ed5565b6001600160a01b03841660008181526007602052604090209190915573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415612ea3576040516001600160a01b0388169086156108fc029087906000818181858888f19350505050158015612e9d573d6000803e3d6000fd5b50612eae565b612eae8388876125be565b600454612ec8906001600160a01b0316848a8c8989612f22565b5092979650505050505050565b600081831015612f1c576040805162461bcd60e51b815260206004820152600d60248201526c4552525f554e444552464c4f5760981b604482015290519081900360640190fd5b50900390565b600160ff1b8110612f2f57fe5b604080518481526020810184905280820183905290516001600160a01b038087169288821692918a16917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb9181900360600190a4505050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fea26469706673582212208711a54d3386915a9a6195bc55c1f59166ac4b22284e030f99ce604b01d8b3fd64736f6c634300060c0033",
"deployedBytecode": "0x6080604052600436106102765760003560e01c806371f52bf31161014f578063d031370b116100c1578063d89595121161007a578063d8959512146108e7578063dc8de3791461092c578063e8dc12ff1461095f578063ecbca55d146109a5578063f2fde38b146109d5578063fc0c546a14610a085761030d565b8063d031370b14610836578063d260529c14610860578063d3fb73b414610875578063d4ee1d901461088a578063d55ec6971461089f578063d66bd524146108b45761030d565b80639b99a8e2116101135780639b99a8e21461078a578063af94b8d81461079f578063b4a176d3146107e2578063bf754558146107f7578063c45d3d921461080c578063cdc91c69146108215761030d565b806371f52bf31461072157806379ba5097146107365780637b1039991461074b5780638da5cb5b1461076057806394c275ad146107755761030d565b8063395900d4116101e8578063579cd3ca116101ac578063579cd3ca1461060f5780635e35359e1461062457806361cd756e1461066757806367b6d57c1461067c578063690d8320146106af5780636a49d2c4146106e25761030d565b8063395900d4146105435780633e8ff43f1461058657806349d10b64146105b25780634af80f0e146105c757806354fd4d50146105fa5761030d565b80631cfab2901161023a5780631cfab290146104425780631e1401f81461047557806321e6b53d146104d157806322f3e2d4146105045780632fe8a6ad1461051957806338a5e0161461052e5761030d565b8063024c7ec7146103125780630c7d5cd81461033e5780630e53aae91461036c57806312c2aca4146103d357806319b64015146103fc5761030d565b3661030d5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1661030b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b005b600080fd5b34801561031e57600080fd5b5061030b6004803603602081101561033557600080fd5b50351515610a1d565b34801561034a57600080fd5b50610353610a43565b6040805163ffffffff9092168252519081900360200190f35b34801561037857600080fd5b5061039f6004803603602081101561038f57600080fd5b50356001600160a01b0316610a4f565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156103df57600080fd5b506103e8610ae7565b604080519115158252519081900360200190f35b34801561040857600080fd5b506104266004803603602081101561041f57600080fd5b5035610b33565b604080516001600160a01b039092168252519081900360200190f35b34801561044e57600080fd5b506103536004803603602081101561046557600080fd5b50356001600160a01b0316610b5d565b34801561048157600080fd5b506104b86004803603606081101561049857600080fd5b506001600160a01b03813581169160208101359091169060400135610b8f565b6040805192835260208301919091528051918290030190f35b3480156104dd57600080fd5b5061030b600480360360208110156104f457600080fd5b50356001600160a01b0316610baa565b34801561051057600080fd5b506103e8610bbe565b34801561052557600080fd5b506103e8610c3d565b34801561053a57600080fd5b5061030b610c4d565b34801561054f57600080fd5b5061030b6004803603606081101561056657600080fd5b506001600160a01b03813581169160208101359091169060400135610c5f565b34801561059257600080fd5b5061059b610ce5565b6040805161ffff9092168252519081900360200190f35b3480156105be57600080fd5b5061030b610cea565b3480156105d357600080fd5b5061030b600480360360208110156105ea57600080fd5b50356001600160a01b0316610ef2565b34801561060657600080fd5b5061059b610f27565b34801561061b57600080fd5b50610353610f2c565b34801561063057600080fd5b5061030b6004803603606081101561064757600080fd5b506001600160a01b03813581169160208101359091169060400135610f3f565b34801561067357600080fd5b50610426611070565b34801561068857600080fd5b5061030b6004803603602081101561069f57600080fd5b50356001600160a01b031661107f565b3480156106bb57600080fd5b5061030b600480360360208110156106d257600080fd5b50356001600160a01b031661112b565b3480156106ee57600080fd5b5061030b6004803603604081101561070557600080fd5b5080356001600160a01b0316906020013563ffffffff1661125e565b34801561072d57600080fd5b5061059b6112ce565b34801561074257600080fd5b5061030b6112dd565b34801561075757600080fd5b50610426611394565b34801561076c57600080fd5b506104266113a3565b34801561078157600080fd5b506103536113b2565b34801561079657600080fd5b5061059b6113c6565b3480156107ab57600080fd5b506104b8600480360360608110156107c257600080fd5b506001600160a01b038135811691602081013590911690604001356113cc565b3480156107ee57600080fd5b5061030b6114b5565b34801561080357600080fd5b506103e86114e1565b34801561081857600080fd5b506104266114e6565b34801561082d57600080fd5b5061030b6114f5565b34801561084257600080fd5b506104266004803603602081101561085957600080fd5b503561154e565b34801561086c57600080fd5b506103e8611575565b34801561088157600080fd5b5061042661157a565b34801561089657600080fd5b50610426611589565b3480156108ab57600080fd5b5061030b611598565b3480156108c057600080fd5b5061039f600480360360208110156108d757600080fd5b50356001600160a01b0316611680565b3480156108f357600080fd5b5061091a6004803603602081101561090a57600080fd5b50356001600160a01b03166116c3565b60408051918252519081900360200190f35b34801561093857600080fd5b5061091a6004803603602081101561094f57600080fd5b50356001600160a01b03166116d4565b61091a600480360360a081101561097557600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135821691608090910135166116fd565b3480156109b157600080fd5b5061030b600480360360208110156109c857600080fd5b503563ffffffff1661190d565b3480156109e157600080fd5b5061030b600480360360208110156109f857600080fd5b50356001600160a01b03166119f5565b348015610a1457600080fd5b50610426611a73565b610a25611a82565b60038054911515600160a01b0260ff60a01b19909216919091179055565b60085463ffffffff1681565b6000806000806000610a5f612f8b565b505050506001600160a01b03929092166000908152600760209081526040808320815160a081018352815480825260019092015463ffffffff811694820185905260ff64010000000082048116151594830194909452650100000000008104841615156060830152600160301b90049092161515608090920182905295919450919250829190565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f54600160301b900460ff1690565b600060068281548110610b4257fe5b6000918252602090912001546001600160a01b031692915050565b600081610b6981611ad5565b50506001600160a01b031660009081526007602052604090206001015463ffffffff1690565b600080610b9d8585856113cc565b915091505b935093915050565b610bb2611a82565b610bbb8161107f565b50565b6004805460408051638da5cb5b60e01b8152905160009330936001600160a01b031692638da5cb5b9281830192602092829003018186803b158015610c0257600080fd5b505afa158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b50516001600160a01b031614905090565b600354600160a01b900460ff1681565b610c55611a82565b610c5d6114f5565b565b610c67611a82565b6004805460408051632f1a9acf60e11b81526001600160a01b038781169482019490945285841660248201526044810185905290519290911691635e35359e9160648082019260009290919082900301818387803b158015610cc857600080fd5b505af1158015610cdc573d6000803e3d6000fd5b50505050505050565b600090565b6000546001600160a01b0316331480610d0d5750600354600160a01b900460ff16155b610d52576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6000610d706f436f6e7472616374526567697374727960801b611b42565b6002549091506001600160a01b03808316911614801590610d9957506001600160a01b03811615155b610de1576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60006001600160a01b0316816001600160a01b031663bb34534c6f436f6e7472616374526567697374727960801b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610e4357600080fd5b505afa158015610e57573d6000803e3d6000fd5b505050506040513d6020811015610e6d57600080fd5b50516001600160a01b03161415610ec2576040805162461bcd60e51b81526020600482015260146024820152734552525f494e56414c49445f524547495354525960601b604482015290519081900360640190fd5b60028054600380546001600160a01b038084166001600160a01b0319928316179092559091169216919091179055565b610efa611a82565b80610f0481611bc0565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b602781565b600854600160401b900463ffffffff1681565b610f47611c14565b6003805460ff60a81b1916600160a81b179055610f62611a82565b6000610f87762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b6001600160a01b038516600090815260076020526040902060010154909150600160301b900460ff161580610fc15750610fbf610bbe565b155b80610fd957506000546001600160a01b038281169116145b61101e576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611029848484611c64565b6001600160a01b038416600090815260076020526040902060010154600160301b900460ff161561105d5761105d84611c95565b50506003805460ff60a81b191690555050565b6003546001600160a01b031681565b611087611a82565b762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b6110ab81611d73565b600460009054906101000a90046001600160a01b03166001600160a01b031663f2fde38b836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561110f57600080fd5b505af1158015611123573d6000803e3d6000fd5b505050505050565b611133611c14565b6003805460ff60a81b1916600160a81b17905561114e611a82565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61116c81611ad5565b6000611191762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b905061119b610bbe565b15806111b457506000546001600160a01b038281169116145b6111f9576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6040516001600160a01b038416904780156108fc02916000818181858888f1935050505015801561122e573d6000803e3d6000fd5b5061124c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee611c95565b50506003805460ff60a81b1916905550565b611266611a82565b61126e6113c6565b61ffff16156112c0576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b6112ca8282611dd5565b5050565b60006112d86113c6565b905090565b6001546001600160a01b03163314611330576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6002546001600160a01b031681565b6000546001600160a01b031681565b600854640100000000900463ffffffff1681565b60065490565b60045460009081906001600160a01b03858116911614801561141057506001600160a01b038516600090815260076020526040902060010154600160301b900460ff165b156114275761141e83611ff7565b91509150610ba2565b6004546001600160a01b03868116911614801561146657506001600160a01b038416600090815260076020526040902060010154600160301b900460ff165b156114745761141e836121e9565b6040805162461bcd60e51b815260206004820152601160248201527022a9292fa4a72b20a624a22faa27a5a2a760791b604482015290519081900360640190fd5b6114bd611a82565b600354600280546001600160a01b0319166001600160a01b03909216919091179055565b600181565b6005546001600160a01b031681565b6114fd611a82565b6115056122dd565b6004546001906001600160a01b031661151c610ce5565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4565b6006818154811061155b57fe5b6000918252602090912001546001600160a01b0316905081565b600190565b6004546001600160a01b031681565b6001546001600160a01b031681565b6115a0611a82565b60006115c5762130b731b7b921b7b73b32b93a32b92ab833b930b232b960491b611b42565b6004549091506000906001600160a01b03166115df610ce5565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4611618816119f5565b6040805163487ac64b60e11b81526027600482015290516001600160a01b038316916390f58c9691602480830192600092919082900301818387803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b50505050610bbb6112dd565b6007602052600090815260409020805460019091015463ffffffff81169060ff6401000000008204811691650100000000008104821691600160301b9091041685565b60006116ce826116d4565b92915050565b6000816116e081611ad5565b50506001600160a01b031660009081526007602052604090205490565b6000611707611c14565b6003805460ff60a81b1916600160a81b1790556c42616e636f724e6574776f726b60981b61173481611d73565b856001600160a01b0316876001600160a01b03161415611794576040805162461bcd60e51b815260206004820152601660248201527511549497d4d0535157d4d3d55490d157d5105491d15560521b604482015290519081900360640190fd5b6005546001600160a01b031615806118a1575060055460408051633af32abf60e01b81526001600160a01b03878116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156117f457600080fd5b505afa158015611808573d6000803e3d6000fd5b505050506040513d602081101561181e57600080fd5b505180156118a1575060055460408051633af32abf60e01b81526001600160a01b03868116600483015291519190921691633af32abf916024808301926020929190829003018186803b15801561187457600080fd5b505afa158015611888573d6000803e3d6000fd5b505050506040513d602081101561189e57600080fd5b50515b6118e8576040805162461bcd60e51b815260206004820152601360248201527211549497d393d517d5d2125511531254d51151606a1b604482015290519081900360640190fd5b6118f587878787876123a4565b6003805460ff60a81b19169055979650505050505050565b611915611a82565b60085463ffffffff6401000000009091048116908216111561197e576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6008546040805163ffffffff600160401b90930483168152918316602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a16008805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6119fd611a82565b6000546001600160a01b0382811691161415611a51576040805162461bcd60e51b815260206004820152600e60248201526d22a9292fa9a0a6a2afa7aba722a960911b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031690565b6000546001600160a01b03163314610c5d576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b6001600160a01b038116600090815260076020526040902060010154600160301b900460ff16610bbb576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60025460408051632ecd14d360e21b81526004810184905290516000926001600160a01b03169163bb34534c916024808301926020929190829003018186803b158015611b8e57600080fd5b505afa158015611ba2573d6000803e3d6000fd5b505050506040513d6020811015611bb857600080fd5b505192915050565b6001600160a01b038116301415610bbb576040805162461bcd60e51b815260206004820152601360248201527222a9292fa0a2222922a9a9afa4a9afa9a2a62360691b604482015290519081900360640190fd5b600354600160a81b900460ff1615610c5d576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b611c6c611a82565b82611c768161256d565b82611c808161256d565b83611c8a81611bc0565b6111238686866125be565b80611c9f81611ad5565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611ce4576001600160a01b03821660009081526007602052604090204790556112ca565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611d2a57600080fd5b505afa158015611d3e573d6000803e3d6000fd5b505050506040513d6020811015611d5457600080fd5b50516001600160a01b0383166000908152600760205260409020555050565b611d7c81611b42565b6001600160a01b0316336001600160a01b031614610bbb576040805162461bcd60e51b815260206004820152601160248201527011549497d050d0d154d4d7d11153925151607a1b604482015290519081900360640190fd5b611ddd611a82565b611de561271e565b81611def8161256d565b82611df981611bc0565b82611e0381612765565b6004546001600160a01b03868116911614801590611e4457506001600160a01b038516600090815260076020526040902060010154600160301b900460ff16155b611e8b576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f5245534552564560681b604482015290519081900360640190fd5b60085463ffffffff908116620f42400381169085161115611ef3576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b61ffff611efe6113c6565b61ffff1610611f50576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b5050506001600160a01b0390911660008181526007602052604081208181556001908101805466ff0000000000001963ffffffff80881663ffffffff199384161791909116600160301b179092556006805493840181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910180546001600160a01b031916909317909255600880548084169094019092169216919091179055565b6000806120026127d5565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561205257600080fd5b505afa158015612066573d6000803e3d6000fd5b505050506040513d602081101561207c57600080fd5b505160068054919250600091829061209057fe5b6000918252602090912001546001600160a01b03169050816120f9576001600160a01b0381166000908152600760205260409020600101546120ec9063ffffffff908116906120e6908890620f42409061281d16565b90612882565b60009350935050506121e4565b60006121146c42616e636f72466f726d756c6160981b611b42565b6001600160a01b031663f3250fe28461212c856116d4565b6001600160a01b0386166000908152600760209081526040918290206001015482516001600160e01b031960e088901b1681526004810195909552602485019390935263ffffffff9092166044840152606483018b905251608480840193829003018186803b15801561219e57600080fd5b505afa1580156121b2573d6000803e3d6000fd5b505050506040513d60208110156121c857600080fd5b5051905060006121d7826128e1565b9182900395509093505050505b915091565b6000806121f46127d5565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d602081101561226e57600080fd5b505160068054919250600091829061228257fe5b6000918252602090912001546001600160a01b03169050818514156122aa576120ec816116d4565b60006122c56c42616e636f72466f726d756c6160981b611b42565b6001600160a01b03166376cf0b568461212c856116d4565b6122e5611a82565b60006122ef6113c6565b61ffff1611612341576040805162461bcd60e51b815260206004820152601960248201527811549497d253959053125117d49154d154959157d0d3d55395603a1b604482015290519081900360640190fd5b60048054604080516379ba509760e01b815290516001600160a01b03909216926379ba509792828201926000929082900301818387803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b50505050610c5d61290c565b600454600090819081906001600160a01b0388811691161480156123ea57506001600160a01b038816600090815260076020526040902060010154600160301b900460ff165b156124035750866123fc86868661294c565b9150612454565b6004546001600160a01b03898116911614801561244257506001600160a01b038716600090815260076020526040902060010154600160301b900460ff165b156114745750856123fc868686612bc0565b6000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156124a457600080fd5b505afa1580156124b8573d6000803e3d6000fd5b505050506040513d60208110156124ce57600080fd5b50516001600160a01b0380841660008181526007602052604090206001015460045493945063ffffffff16929091167f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c24612534620f424061252e886116d4565b9061281d565b6125478663ffffffff8088169061281d16565b6040805192835260208301919091528051918290030190a3509198975050505050505050565b6001600160a01b038116610bbb576040805162461bcd60e51b81526020600482015260136024820152724552525f494e56414c49445f4144445245535360681b604482015290519081900360640190fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b6020831061263b5780518252601f19909201916020918201910161261c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461269d576040519150601f19603f3d011682016040523d82523d6000602084013e6126a2565b606091505b50915091508180156126d05750805115806126d057508080602001905160208110156126cd57600080fd5b50515b612717576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b5050505050565b612726610bbe565b15610c5d576040805162461bcd60e51b815260206004820152600a6024820152694552525f41435449564560b01b604482015290519081900360640190fd5b60008163ffffffff161180156127845750620f424063ffffffff821611155b610bbb576040805162461bcd60e51b815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b6127dd610bbe565b610c5d576040805162461bcd60e51b815260206004820152600c60248201526b4552525f494e41435449564560a01b604482015290519081900360640190fd5b60008261282c575060006116ce565b8282028284828161283957fe5b041461287b576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4f564552464c4f5760a01b604482015290519081900360640190fd5b9392505050565b60008082116128cd576040805162461bcd60e51b81526020600482015260126024820152714552525f4449564944455f42595f5a45524f60701b604482015290519081900360640190fd5b60008284816128d857fe5b04949350505050565b6008546000906116ce90620f4240906120e6908590600160401b900463ffffffff9081169061281d16565b60065460005b818110156112ca576129446006828154811061292a57fe5b6000918252602090912001546001600160a01b0316611c95565b600101612912565b600080600061295a86611ff7565b9150915081600014156129ad576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b600060066000815481106129bd57fe5b6000918252602090912001546001600160a01b0316905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee811415612a4957863414612a44576040805162461bcd60e51b815260206004820152601760248201527f4552525f4554485f414d4f554e545f4d49534d41544348000000000000000000604482015290519081900360640190fd5b612b20565b34158015612ada575086612ad7612a5f836116d4565b604080516370a0823160e01b815230600482015290516001600160a01b038616916370a08231916024808301926020929190829003018186803b158015612aa557600080fd5b505afa158015612ab9573d6000803e3d6000fd5b505050506040513d6020811015612acf57600080fd5b505190612ed5565b10155b612b20576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b612b2981611c95565b600480546040805163219e412d60e21b81526001600160a01b0389811694820194909452602481018790529051929091169163867904b49160448082019260009290919082900301818387803b158015612b8257600080fd5b505af1158015612b96573d6000803e3d6000fd5b5050600454612bb592508391506001600160a01b0316888a8787612f22565b509095945050505050565b60048054604080516370a0823160e01b81523093810193909352516000926001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015612c0f57600080fd5b505afa158015612c23573d6000803e3d6000fd5b505050506040513d6020811015612c3957600080fd5b5051841115612c84576040805162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015290519081900360640190fd5b600080612c90866121e9565b915091508160001415612ce3576040805162461bcd60e51b815260206004820152601660248201527511549497d6915493d7d5105491d15517d05353d5539560521b604482015290519081900360640190fd5b60006006600081548110612cf357fe5b600091825260208083209091015460048054604080516318160ddd60e01b815290516001600160a01b03948516975091909316936318160ddd938084019391929190829003018186803b158015612d4957600080fd5b505afa158015612d5d573d6000803e3d6000fd5b505050506040513d6020811015612d7357600080fd5b505190506000612d82836116d4565b905080851080612d9b57508085148015612d9b57508189145b612da157fe5b600480546040805163a24835d160e01b81523093810193909352602483018c9052516001600160a01b039091169163a24835d191604480830192600092919082900301818387803b158015612df557600080fd5b505af1158015612e09573d6000803e3d6000fd5b5050506001600160a01b038416600090815260076020526040902054612e30915086612ed5565b6001600160a01b03841660008181526007602052604090209190915573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415612ea3576040516001600160a01b0388169086156108fc029087906000818181858888f19350505050158015612e9d573d6000803e3d6000fd5b50612eae565b612eae8388876125be565b600454612ec8906001600160a01b0316848a8c8989612f22565b5092979650505050505050565b600081831015612f1c576040805162461bcd60e51b815260206004820152600d60248201526c4552525f554e444552464c4f5760981b604482015290519081900360640190fd5b50900390565b600160ff1b8110612f2f57fe5b604080518481526020810184905280820183905290516001600160a01b038087169288821692918a16917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb9181900360600190a4505050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fea26469706673582212208711a54d3386915a9a6195bc55c1f59166ac4b22284e030f99ce604b01d8b3fd64736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "501:10433:24:-:0;;;349:27:59;;;-1:-1:-1;;;;349:27:59;;;2899:30:8;;;-1:-1:-1;;3292:40:8;;;876:211:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;876:211:24;;;;;;;;;;;619:5:57;:18;;-1:-1:-1;;;;;;619:18:57;627:10;619:18;;;876:211:24;;;;;;;;594:23:64;876:211:24;594:13:64;:23::i;:::-;-1:-1:-1;2122:8:56::1;:39:::0;;-1:-1:-1;;;;;2122:39:56;;;::::1;-1:-1:-1::0;;;;;;2122:39:56;;::::1;::::0;::::1;::::0;;;2172:12:::1;:43:::0;;;;::::1;;::::0;;6069:7:8;594:23:64;6069:7:8;594:13:64;: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;501:10433:24;;-1:-1:-1;;501:10433:24;692:128:64;-1:-1:-1;;;;;766:22:64;;758:54;;;;;-1:-1:-1;;;758:54:64;;;;;;;;;;;;-1:-1:-1;;;758:54:64;;;;;;;;;;;;;;;692:128;:::o;7404:156:8:-;1846:7;7489:32;;;;;7481:71;;;;;-1:-1:-1;;;7481:71:8;;;;;;;;;;;;;;;;;;;;;;;;;;;501:10433:24;;;;;;;",
"deployedSourceMap": "501:10433:24:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1924:42:8;8454:29;;:8;:29;;:35;;-1:-1:-1;;;8454:35:8;;;;8446:67;;;;;-1:-1:-1;;;8446:67:8;;;;;;;;;;;;-1:-1:-1;;;8446:67:8;;;;;;;;;;;;;;;501:10433:24;;;;;3655:224:56;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3655:224:56;;;;:::i;2899:30:8:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;22514:248;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22514:248:8;-1:-1:-1;;;;;22514:248:8;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17176:113;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;22836:145;;;;;;;;;;;;;;;;;;;;;;;;;;-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;23471:208::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;23471:208:8;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;22136:130;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22136:130:8;-1:-1:-1;;;;;22136:130:8;;:::i;10641:121::-;;;;;;;;;;;;;:::i;1333:38:56:-;;;;;;;;;;;;;:::i;22340:100:8:-;;;;;;;;;;;;;:::i;12220:157::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;12220:157:8;;;;;;;;;;;;;;;;;:::i;1232:90:24:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2300:925:56;;;;;;;;;;;;;:::i;10268:202:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10268:202:8;-1:-1:-1;;;;;10268:202:8;;:::i;2343:35::-;;;;;;;;;;;;;:::i;3292:40::-;;;;;;;;;;;;;:::i;13330:735::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;13330:735:8;;;;;;;;;;;;;;;;;:::i;1243:37:56:-;;;;;;;;;;;;;:::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;2095:272:24:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2095:272:24;;-1:-1:-1;;;;;2095:272:24;;;;;;;;:::i;23055:114:8:-;;;;;;;;;;;;;:::i;1422:217:57:-;;;;;;;;;;;;;:::i;1154:33:56:-;;;;;;;;;;;;;:::i;219:29:57:-;;;;;;;;;;;;;:::i;3041:43:8:-;;;;;;;;;;;;;:::i;14882:112::-;;;;;;;;;;;;;:::i;2809:499:24:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2809:499:24;;;;;;;;;;;;;;;;;:::i;3304:137:56:-;;;;;;;;;;;;;:::i;3417:46:8:-;;;;;;;;;;;;;:::i;2473:::-;;;;;;;;;;;;;:::i;1595:166:24:-;;;;;;;;;;;;;:::i;2613:34:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2613:34:8;;:::i;9815:82::-;;;;;;;;;;;;;:::i;2387:39::-;;;;;;;;;;;;;:::i;255:23:57:-;;;;;;;;;;;;;:::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;17872:782::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;17872:782:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;12580:274::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12580:274:8;;;;:::i;1164:167:57:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1164:167:57;-1:-1:-1;;;;;1164:167:57;;:::i;21965:97:8:-;;;;;;;;;;;;;:::i;3655:224:56:-;726:12:57;:10;:12::i;:::-;3815:26:56::1;:56:::0;;;::::1;;-1:-1:-1::0;;;3815:56:56::1;-1:-1:-1::0;;;;3815:56:56;;::::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;22657:18:8;;-1:-1:-1;22657:18:8;;22632:43;22514:248::o;17176:113::-;1924:42;17222:4;17246:29;:8;:29;;:35;;-1:-1:-1;;;17246:35:8;;;;;17176:113::o;22836:145::-;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;23471:208::-;23580:7;23589;23616:55;23635:12;23649;23663:7;23616:18;:55::i;:::-;23609:62;;;;23471:208;;;;;;;:::o;22136:130::-;726:12:57;: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:56:-;;;-1:-1:-1;;;1333:38:56;;;;;:::o;22340:100:8:-;726:12:57;:10;:12::i;:::-;22409:23:8::1;:21;:23::i;:::-;22340:100::o:0;12220:157::-;726:12:57;: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;1232:90:24:-;1287:6;1232:90;:::o;2300:925:56:-;2417:5;;-1:-1:-1;;;;;2417:5:56;2403:10;:19;;:50;;-1:-1:-1;2427:26:56;;-1:-1:-1;;;2427:26:56;;;;2426:27;2403:50;2395:80;;;;;-1:-1:-1;;;2395:80:56;;;;;;;;;;;;-1:-1:-1;;;2395:80:56;;;;;;;;;;;;;;;2530:29;2580:28;-1:-1:-1;;;2580:9:56;:28::i;:::-;2721:8;;2530:79;;-1:-1:-1;;;;;;2706:23:56;;;2721:8;;2706:23;;;;:61;;-1:-1:-1;;;;;;2733:34:56;;;;2706:61;2698:94;;;;;-1:-1:-1;;;2698:94:56;;;;;;;;;;;;-1:-1:-1;;;2698:94:56;;;;;;;;;;;;;;;2907:40;;;-1:-1:-1;;;2907:40:56;;-1:-1:-1;;;2907:40:56;;;;;;2959:1;;-1:-1:-1;;;;;2907:21:56;;;;;:40;;;;;;;;;;;;;;;:21;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2907:40:56;-1:-1:-1;;;;;2907:54:56;;;2899:87;;;;;-1:-1:-1;;;2899:87:56;;;;;;;;;;;;-1:-1:-1;;;2899:87:56;;;;;;;;;;;;;;;3093:8;;;3078:12;:23;;-1:-1:-1;;;;;3093:8:56;;;-1:-1:-1;;;;;;3078:23:56;;;;;;;3195:22;;;;;;;;;;;2300:925::o;10268:202:8:-;726:12:57;:10;:12::i;:::-;10401:10:8::1;948:18:64;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;2343:35::-;2376:2;2343:35;:::o;3292:40::-;;;-1:-1:-1;;;3292:40:8;;;;;:::o;13330:735::-;580:12:59;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:59;-1:-1:-1;;;603:13:59;;;726:12:57::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:59;:14;;-1:-1:-1;;;;639:14:59;;;-1:-1:-1;;13330:735:8:o;1243:37:56:-;;;-1:-1:-1;;;;;1243:37:56;;:::o;11112:198:8:-;726:12:57;:10;:12::i;:::-;-1:-1:-1;;;1627:20:56::1;-1:-1:-1::0;1627:5:56::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:57::1;11112:198:8::0;:::o;9086:554::-;580:12:59;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:59;-1:-1:-1;;;603:13:59;;;726:12:57::1;:10;:12::i;:::-;1924:42:8::2;6959:23;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;1924:42;9593:18;:39::i;:::-;-1:-1:-1::0;;639:6:59;:14;;-1:-1:-1;;;;639:14:59;;;-1:-1:-1;9086:554:8:o;2095:272:24:-;726:12:57;:10;:12::i;:::-;2261:19:24::1;:17;:19::i;:::-;:24;;::::0;2253:62:::1;;;::::0;;-1:-1:-1;;;2253:62:24;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;2253:62:24;;;;;;;;;;;;;::::1;;2326:33;2343:6;2351:7;2326:16;:33::i;:::-;2095:272:::0;;:::o;23055:114:8:-;23116:6;23142:19;:17;:19::i;:::-;23135:26;;23055:114;:::o;1422:217:57:-;1498:8;;-1:-1:-1;;;;;1498:8:57;1484:10;:22;1476:52;;;;;-1:-1:-1;;;1476:52:57;;;;;;;;;;;;-1:-1:-1;;;1476:52:57;;;;;;;;;;;;;;;1563:8;;;1556:5;;1544:28;;-1:-1:-1;;;;;1563:8:57;;;;1556:5;;;;1544:28;;;1591:8;;;;1583:16;;-1:-1:-1;;;;;1591:8:57;;-1:-1:-1;;;;;;1583:16:57;;;;;;;1610:21;;;1422:217::o;1154:33:56:-;;;-1:-1:-1;;;;;1154:33:56;;:::o;219:29:57:-;;;-1:-1:-1;;;;;219:29:57;;:::o;3041:43:8:-;;;;;;;;;:::o;14882:112::-;14965:13;:20;14882:112;:::o;2809:499:24:-;3005:6;;2936:7;;;;-1:-1:-1;;;;;2969:44:24;;;3005:6;;2969:44;:76;;;;-1:-1:-1;;;;;;3017:22:24;;;;;;:8;:22;;;;;-1:-1:-1;3017:28:24;;-1:-1:-1;;;3017:28:24;;;;2969:76;2965:131;;;3067:29;3088:7;3067:20;:29::i;:::-;3060:36;;;;;;2965:131;3147:6;;-1:-1:-1;;;;;3111:44:24;;;3147:6;;3111:44;:76;;;;-1:-1:-1;;;;;;3159:22:24;;;;;;:8;:22;;;;;-1:-1:-1;3159:28:24;;-1:-1:-1;;;3159:28:24;;;;3111:76;3107:127;;;3209:25;3226:7;3209:16;:25::i;3107:127::-;3273:27;;;-1:-1:-1;;;3273:27:24;;;;;;;;;;;;-1:-1:-1;;;3273:27:24;;;;;;;;;;;;;;3304:137:56;726:12:57;:10;:12::i;:::-;3421::56::1;::::0;3410:8:::1;:23:::0;;-1:-1:-1;;;;;;3410:23:56::1;-1:-1:-1::0;;;;;3421:12:56;;::::1;3410:23:::0;;;::::1;::::0;;3304:137::o;3417:46:8:-;3459:4;3417:46;:::o;2473:::-;;;-1:-1:-1;;;;;2473:46:8;;:::o;1595:166:24:-;726:12:57;:10;:12::i;:::-;1665:29:24::1;:27;:29::i;:::-;1740:6;::::0;1748:4:::1;::::0;-1:-1:-1;;;;;1740:6:24::1;1723:15;:13;:15::i;:::-;1712:41;;;;;;;;;;;;1595:166::o:0;2613:34:8:-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2613:34:8;;-1:-1:-1;2613:34:8;:::o;9815:82::-;9885:4;9815:82;:::o;2387:39::-;;;-1:-1:-1;;;;;2387:39:8;;:::o;255:23:57:-;;;-1:-1:-1;;;;;255:23:57;;:::o;14288:374:8:-;726:12:57;: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;;;;;:::o;23243:154::-;23331:7;23358:31;23373:15;23358:14;:31::i;:::-;23351:38;23243:154;-1:-1:-1;;23243:154:8:o;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;17872:782::-;18123:7;580:12:59;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;;;603:13:59;-1:-1:-1;;;603:13:59;;;-1:-1:-1;;;1627:20:56::1;-1:-1:-1::0;1627:5:56::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:59::0;:14;;-1:-1:-1;;;;639:14:59;;;18570:76:8;;-1:-1:-1;;;;;;;17872:782:8:o;12580:274::-;726:12:57;:10;:12::i;:::-;12692:16:8::1;::::0;::::1;::::0;;;::::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:57:-;726:12;:10;:12::i;:::-;1268:5:::1;::::0;-1:-1:-1;;;;;1255:18:57;;::::1;1268:5:::0;::::1;1255:18;;1247:45;;;::::0;;-1:-1:-1;;;1247:45:57;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;1247:45:57;;;;;;;;;;;;;::::1;;1303:8;:20:::0;;-1:-1:-1;;;;;;1303:20:57::1;-1:-1:-1::0;;;;;1303:20:57;;;::::1;::::0;;;::::1;::::0;;1164:167::o;21965:97:8:-;22048:6;;-1:-1:-1;;;;;22048:6:8;;21965:97::o;813:104:57:-;882:5;;-1:-1:-1;;;;;882:5:57;868:10;:19;860:49;;;;;-1:-1:-1;;;860:49:57;;;;;;;;;;;;-1:-1:-1;;;860:49:57;;;;;;;;;;;;;;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;;;;;;;;;;;;;;4077:133:56;4169:8;;:33;;;-1:-1:-1;;;4169:33:56;;;;;;;;;;-1:-1:-1;;;;;;;4169:8:56;;:18;;:33;;;;;;;;;;;;;;:8;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4169:33:56;;4077:133;-1:-1:-1;;4077:133:56:o;1041:126:64:-;1130:4;-1:-1:-1;;;;;1110:25:64;;;;1102:57;;;;;-1:-1:-1;;;1102:57:64;;;;;;;;;;;;-1:-1:-1;;;1102:57:64;;;;;;;;;;;;;;716:89:59;772:6;;-1:-1:-1;;;772:6:59;;;;771:7;763:34;;;;;-1:-1:-1;;;763:34:59;;;;;;;;;;;;-1:-1:-1;;;763:34:59;;;;;;;;;;;;;;1196:290:62;726:12:57;:10;:12::i;:::-;1370:6:62::1;594:23:64;608:8;594:13;:23::i;:::-;1401:3:62::2;594:23:64;608:8;594:13;:23::i;:::-;1423:3:62::3;948:18:64;957:8;948;:18::i;:::-;1444:34:62::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;:::-;1924:42:::1;-1:-1:-1::0;;;;;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;20061:322;;:::o;1722:139:56:-;1807:24;1817:13;1807:9;:24::i;:::-;-1:-1:-1;;;;;1793:38:56;:10;:38;1785:68;;;;;-1:-1:-1;;;1785:68:56;;;;;;;;;;;;-1:-1:-1;;;1785:68:56;;;;;;;;;;;;;;15286:803:8;726:12:57;:10;:12::i;:::-;6615:11:8::1;:9;:11::i;:::-;15460:6:::2;594:23:64;608:8;594:13;:23::i;:::-;15494:6:8::3;948:18:64;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;5419:908:24:-;5532:7;5541;6356:9:8;:7;:9::i;:::-;5608:6:24::1;::::0;;5588:42:::1;::::0;;-1:-1:-1;;;5588:42:24;;;;5566:19:::1;::::0;-1:-1:-1;;;;;5608:6:24;;::::1;::::0;5588:40:::1;::::0;:42;;::::1;::::0;::::1;::::0;;;;;;;;5608:6;5588:42;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;5588:42:24;5668:13:::1;:16:::0;;5588:42;;-1:-1:-1;5641:24:24::1;::::0;;;5668:16:::1;;;;;::::0;;;::::1;::::0;;;::::1;::::0;-1:-1:-1;;;;;5668:16:24::1;::::0;-1:-1:-1;5814:16:24;5810:109:::1;;-1:-1:-1::0;;;;;5885:22:24;::::1;;::::0;;;:8:::1;:22;::::0;;;;-1:-1:-1;5885:29:24::1;::::0;5853:62:::1;::::0;5885:29:::1;::::0;;::::1;::::0;5853:27:::1;::::0;:7;;1846::8::1;::::0;5853:11:24::1;:27;:::i;:::-;:31:::0;::::1;:62::i;:::-;5917:1;5845:74;;;;;;;;5810:109;5932:14;5964:25;-1:-1:-1::0;;;5964:9:24::1;:25::i;:::-;-1:-1:-1::0;;;;;5949:62:24::1;;6026:11:::0;6052:28:::1;6067:12:::0;6052:14:::1;:28::i;:::-;-1:-1:-1::0;;;;;6095:22:24;::::1;;::::0;;;:8:::1;:22;::::0;;;;;;;;-1:-1:-1;6095:29:24::1;::::0;5949:208;;-1:-1:-1;5949:208:24;;;-1:-1:-1;;;;;;5949:208:24;;;::::1;::::0;::::1;::::0;;;;;;;;;;;6095:29:::1;::::0;;::::1;5949:208:::0;;;;;;;;;;;;;;;;;;;;;;;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;5949:208:24;;-1:-1:-1;6248:11:24::1;6262:20;5949:208:::0;6262:12:::1;:20::i;:::-;6301:12:::0;;;::::1;::::0;-1:-1:-1;6248:34:24;;-1:-1:-1;;;;6376:1:8::1;5419:908:24::0;;;:::o;6604:834::-;6713:7;6722;6356:9:8;:7;:9::i;:::-;6789:6:24::1;::::0;;6769:42:::1;::::0;;-1:-1:-1;;;6769:42:24;;;;6747:19:::1;::::0;-1:-1:-1;;;;;6789:6:24;;::::1;::::0;6769:40:::1;::::0;:42;;::::1;::::0;::::1;::::0;;;;;;;;6789:6;6769:42;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;6769:42:24;6851:13:::1;:16:::0;;6769:42;;-1:-1:-1;6824:24:24::1;::::0;;;6851:16:::1;;;;;::::0;;;::::1;::::0;;;::::1;::::0;-1:-1:-1;;;;;6851:16:24::1;::::0;-1:-1:-1;6957:22:24;;::::1;6953:81;;;7002:28;7017:12;7002:14;:28::i;6953:81::-;7047:14;7079:25;-1:-1:-1::0;;;7079:9:24::1;:25::i;:::-;-1:-1:-1::0;;;;;7064:58:24::1;;7137:11:::0;7163:28:::1;7178:12:::0;7163:14:::1;:28::i;11633:276:8:-:0;726:12:57;: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;3880:1189:24:-:0;4202:6;;4069:7;;;;;;-1:-1:-1;;;;;4166:44:24;;;4202:6;;4166:44;:76;;;;-1:-1:-1;;;;;;4214:22:24;;;;;;:8;:22;;;;;-1:-1:-1;4214:28:24;;-1:-1:-1;;;4214:28:24;;;;4166:76;4162:517;;;-1:-1:-1;4274:12:24;4316:35;4320:7;4329;4338:12;4316:3;:35::i;:::-;4301:50;;4162:517;;;4418:6;;-1:-1:-1;;;;;4382:44:24;;;4418:6;;4382:44;:76;;;;-1:-1:-1;;;;;;4430:22:24;;;;;;:8;:22;;;;;-1:-1:-1;4430:28:24;;-1:-1:-1;;;4430:28:24;;;;4382:76;4378:301;;;-1:-1:-1;4490:12:24;4532:36;4537:7;4546;4555:12;4532:4;:36::i;4378:301::-;4787:6;;;4767:42;;;-1:-1:-1;;;4767:42:24;;;;4745:19;;-1:-1:-1;;;;;4787:6:24;;;;4767:40;;:42;;;;;;;;;;;;;4787:6;4767:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4767:42:24;-1:-1:-1;;;;;4843:22:24;;;4820:20;4843:22;;;:8;4767:42;4843:22;;;;-1:-1:-1;4843:29:24;;4924:6;;4767:42;;-1:-1:-1;4843:29:24;;;:22;;4924:6;4888:141;4948:48;1846:7:8;4948:28:24;4843:22;4948:14;:28::i;:::-;:32;;:48::i;:::-;4998:30;:11;:30;;;;;:15;:30;:::i;:::-;4888:141;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5049:12:24;;3880:1189;-1:-1:-1;;;;;;;;3880:1189:24:o;692:128:64:-;-1:-1:-1;;;;;766:22:64;;758:54;;;;;-1:-1:-1;;;758:54:64;;;;;;;;;;;;-1:-1:-1;;;758:54:64;;;;;;;;;;;;;;1485:312:61;1631:59;;;-1:-1:-1;;;;;1631:59:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1631:59:61;-1:-1:-1;;;1631:59:61;;;1610:81;;;;-1:-1:-1;;1589:17:61;;1610:20;;;;1631:59;1610:81;;;1631:59;1610:81;;1631:59;1610:81;;;;;;;;;;-1:-1:-1;;1610:81:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1574:117;;;;1709:7;:57;;;;-1:-1:-1;1721:11:61;;:16;;:44;;;1752:4;1741:24;;;;;;;;;;;;;;;-1:-1:-1;1741:24:61;1721:44;1701:89;;;;;-1:-1:-1;;;1701:89:61;;;;;;;;;;;;-1:-1:-1;;;1701:89:61;;;;;;;;;;;;;;;1485:312;;;;;:::o;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;;;;;;;;;;;;;;;;;;;;;;;;;;;6440:87;6492:10;:8;:10::i;:::-;6484:35;;;;;-1:-1:-1;;;6484:35:8;;;;;;;;;;;;-1:-1:-1;;;6484:35:8;;;;;;;;;;;;;;1149:250:60;1209:7;1262;1258:34;;-1:-1:-1;1291:1:60;1284:8;;1258:34;1317:7;;;1322:2;1317;:7;:2;1343:6;;;;;:12;1335:37;;;;;-1:-1:-1;;;1335:37:60;;;;;;;;;;;;-1:-1:-1;;;1335:37:60;;;;;;;;;;;;;;;1390:1;1149:250;-1:-1:-1;;;1149:250:60:o;1627:174::-;1687:7;1720:1;1715:2;:6;1707:37;;;;;-1:-1:-1;;;1707:37:60;;;;;;;;;;;;-1:-1:-1;;;1707:37:60;;;;;;;;;;;;;;;1755:9;1772:2;1767;:7;;;;;;;1627:174;-1:-1:-1;;;;1627:174:60: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;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;;7818:1136:24;7905:7;7973:14;7989:11;8004:29;8025:7;8004:20;:29::i;:::-;7972:61;;;;8109:6;8119:1;8109:11;;8101:46;;;;;-1:-1:-1;;;8101:46:24;;;;;;;;;;;;-1:-1:-1;;;8101:46:24;;;;;;;;;;;;;;;8160:24;8187:13;8201:1;8187:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8187:16:24;;-1:-1:-1;1924:42:8;8283:35:24;;8279:270;;;8354:7;8341:9;:20;8333:56;;;;;-1:-1:-1;;;8333:56:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;8279:270;;;8426:9;:14;:100;;;;;8519:7;8444:71;8486:28;8501:12;8486:14;:28::i;:::-;8444:37;;;-1:-1:-1;;;8444:37:24;;8475:4;8444:37;;;;;;-1:-1:-1;;;;;8444:22:24;;;-1:-1:-1;;8444:37:24;;;;;;;;;;;;;;:22;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8444:37:24;;:41;:71::i;:::-;:82;;8426:100;8418:131;;;;;-1:-1:-1;;;8418:131:24;;;;;;;;;;;;-1:-1:-1;;;8418:131:24;;;;;;;;;;;;;;;8599:32;8618:12;8599:18;:32::i;:::-;8731:6;;;8711:56;;;-1:-1:-1;;;8711:56:24;;-1:-1:-1;;;;;8711:56:24;;;;;;;;;;;;;;;;;;8731:6;;;;;8711:34;;:56;;;;;-1:-1:-1;;8711:56:24;;;;;;;;-1:-1:-1;8731:6:24;8711:56;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;8880:6:24;;8822:98;;-1:-1:-1;8846:12:24;;-1:-1:-1;;;;;;8880:6:24;8890:7;8899;8908:6;8916:3;8822:23;:98::i;:::-;-1:-1:-1;8940:6:24;;7818:1136;-1:-1:-1;;;;;7818:1136:24:o;9326:1605::-;9544:6;;;9524:53;;;-1:-1:-1;;;9524:53:24;;9571:4;9524:53;;;;;;;;-1:-1:-1;;;;;;;9544:6:24;;;;-1:-1:-1;;9524:53:24;;;;;;;;;;;;;;9544:6;9524:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9524:53:24;9513:64;;;9505:95;;;;;-1:-1:-1;;;9505:95:24;;;;;;;;;;;;-1:-1:-1;;;9505:95:24;;;;;;;;;;;;;;;9661:14;9677:11;9692:25;9709:7;9692:16;:25::i;:::-;9660:57;;;;9793:6;9803:1;9793:11;;9785:46;;;;;-1:-1:-1;;;9785:46:24;;;;;;;;;;;;-1:-1:-1;;;9785:46:24;;;;;;;;;;;;;;;9844:24;9871:13;9885:1;9871:16;;;;;;;;;;;;;;;;;;;;;10054:6;;;10034:42;;;-1:-1:-1;;;10034:42:24;;;;-1:-1:-1;;;;;9871:16:24;;;;-1:-1:-1;10054:6:24;;;;;-1:-1:-1;;10034:42:24;;;;9871:16;;10034:42;;;;;;;;10054:6;10034:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10034:42:24;;-1:-1:-1;10087:18:24;10108:28;10123:12;10108:14;:28::i;:::-;10087:49;;10163:10;10154:6;:19;:71;;;;10188:10;10178:6;:20;:46;;;;;10213:11;10202:7;:22;10178:46;10147:79;;;;10337:6;;;10317:60;;;-1:-1:-1;;;10317:60:24;;10362:4;10317:60;;;;;;;;;;;;;;-1:-1:-1;;;;;10337:6:24;;;;-1:-1:-1;;10317:60:24;;;;;-1:-1:-1;;10317:60:24;;;;;;;-1:-1:-1;10337:6:24;10317:60;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;10462:22:24;;;;;;:8;:22;;;;;:30;:42;;10497:6;10462:34;:42::i;:::-;-1:-1:-1;;;;;10429:22:24;;;;;;:8;:22;;;;;:75;;;;1924:42:8;10588:35:24;10584:160;;;10638:29;;-1:-1:-1;;;;;10638:21:24;;;:29;;;;;;;;;;;;:21;:29;;;;;;;;;;;;;;;;;;;;;10584:160;;;10696:48;10709:12;10723;10737:6;10696:12;:48::i;:::-;10843:6;;10799:98;;-1:-1:-1;;;;;10843:6:24;10853:12;10867:7;10876;10885:6;10893:3;10799:23;:98::i;:::-;-1:-1:-1;10917:6:24;;9326:1605;-1:-1:-1;;;;;;;9326:1605:24:o;778:147:60:-;838:7;872:2;866;:8;;858:34;;;;;-1:-1:-1;;;858:34:60;;;;;;;;;;;;-1:-1:-1;;;858:34:60;;;;;;;;;;;;;;;-1:-1:-1;910:7:60;;;778:147::o;21084:758:8:-;-1:-1:-1;;;21705:21:8;;21698:29;;;;21743:91;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;21743:91:8;;;;;;;;;;;;;;;;;;;;;21084:758;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\r\npragma solidity 0.6.12;\r\nimport \"../../ConverterBase.sol\";\r\nimport \"../../../token/interfaces/ISmartToken.sol\";\r\n\r\n/**\r\n * @dev Liquid Token Converter\r\n *\r\n * The liquid token converter is a specialized version of a converter that manages a liquid token.\r\n *\r\n * The converters govern a token with a single reserve and allow converting between the two.\r\n * Liquid tokens usually have fractional reserve (reserve ratio smaller than 100%).\r\n*/\r\ncontract LiquidTokenConverter is ConverterBase {\r\n /**\r\n * @dev initializes a new LiquidTokenConverter instance\r\n *\r\n * @param _token liquid 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 ConverterBase(_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 0;\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 the reserve token for the converter\r\n * can only be called by the owner while the converter is inactive and the\r\n * reserve wasn't defined yet\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 // verify that the converter doesn't have a reserve yet\r\n require(reserveTokenCount() == 0, \"ERR_INVALID_RESERVE_COUNT\");\r\n super.addReserve(_token, _weight);\r\n }\r\n\r\n /**\r\n * @dev returns the expected target amount of converting the source token to the\r\n * target token along with the fee\r\n *\r\n * @param _sourceToken contract address of the source token\r\n * @param _targetToken contract address of the target 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) public view override returns (uint256, uint256) {\r\n if (_targetToken == ISmartToken(address(anchor)) && reserves[_sourceToken].isSet)\r\n return purchaseTargetAmount(_amount);\r\n if (_sourceToken == ISmartToken(address(anchor)) && reserves[_targetToken].isSet)\r\n return saleTargetAmount(_amount);\r\n\r\n // invalid input\r\n revert(\"ERR_INVALID_TOKEN\");\r\n }\r\n\r\n /**\r\n * @dev converts between the liquid token and its reserve\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 uint256 targetAmount;\r\n IERC20Token reserveToken;\r\n\r\n if (_targetToken == ISmartToken(address(anchor)) && reserves[_sourceToken].isSet) {\r\n reserveToken = _sourceToken;\r\n targetAmount = buy(_amount, _trader, _beneficiary);\r\n }\r\n else if (_sourceToken == ISmartToken(address(anchor)) && reserves[_targetToken].isSet) {\r\n reserveToken = _targetToken;\r\n targetAmount = sell(_amount, _trader, _beneficiary);\r\n }\r\n else {\r\n // invalid input\r\n revert(\"ERR_INVALID_TOKEN\");\r\n }\r\n\r\n // dispatch rate update for the liquid token\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n uint32 reserveWeight = reserves[reserveToken].weight;\r\n emit TokenRateUpdate(ISmartToken(address(anchor)), reserveToken, reserveBalance(reserveToken).mul(PPM_RESOLUTION), totalSupply.mul(reserveWeight));\r\n\r\n return targetAmount;\r\n }\r\n\r\n /**\r\n * @dev returns the expected target amount of buying with a given amount of tokens\r\n *\r\n * @param _amount amount of reserve tokens to get the target amount for\r\n *\r\n * @return amount of liquid tokens that the user will receive\r\n * @return amount of liquid tokens that the user will pay as fee\r\n */\r\n function purchaseTargetAmount(uint256 _amount)\r\n internal\r\n view\r\n active\r\n returns (uint256, uint256)\r\n {\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n IERC20Token reserveToken = reserveTokens[0];\r\n\r\n // if the current supply is zero, then return the input amount divided by the normalized reserve-weight\r\n if (totalSupply == 0)\r\n return (_amount.mul(PPM_RESOLUTION).div(reserves[reserveToken].weight), 0);\r\n\r\n uint256 amount = IBancorFormula(addressOf(BANCOR_FORMULA)).purchaseTargetAmount(\r\n totalSupply,\r\n reserveBalance(reserveToken),\r\n reserves[reserveToken].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 returns the expected target amount of selling a given amount of tokens\r\n *\r\n * @param _amount amount of liquid tokens to get the target amount for\r\n *\r\n * @return expected reserve tokens\r\n * @return expected fee\r\n */\r\n function saleTargetAmount(uint256 _amount)\r\n internal\r\n view\r\n active\r\n returns (uint256, uint256)\r\n {\r\n uint256 totalSupply = ISmartToken(address(anchor)).totalSupply();\r\n\r\n IERC20Token reserveToken = reserveTokens[0];\r\n\r\n // if selling the entire supply, then return the entire reserve\r\n if (totalSupply == _amount)\r\n return (reserveBalance(reserveToken), 0);\r\n\r\n uint256 amount = IBancorFormula(addressOf(BANCOR_FORMULA)).saleTargetAmount(\r\n totalSupply,\r\n reserveBalance(reserveToken),\r\n reserves[reserveToken].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 buys the liquid token by depositing in its reserve\r\n *\r\n * @param _amount amount of reserve token to buy the token for\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 liquid tokens received\r\n */\r\n function buy(uint256 _amount, address _trader, address _beneficiary) internal returns (uint256) {\r\n // get expected target amount and fee\r\n (uint256 amount, uint256 fee) = purchaseTargetAmount(_amount);\r\n\r\n // ensure the trade gives something in return\r\n require(amount != 0, \"ERR_ZERO_TARGET_AMOUNT\");\r\n\r\n IERC20Token reserveToken = reserveTokens[0];\r\n\r\n // ensure that the input amount was already deposited\r\n if (reserveToken == ETH_RESERVE_ADDRESS)\r\n require(msg.value == _amount, \"ERR_ETH_AMOUNT_MISMATCH\");\r\n else\r\n require(msg.value == 0 && reserveToken.balanceOf(address(this)).sub(reserveBalance(reserveToken)) >= _amount, \"ERR_INVALID_AMOUNT\");\r\n\r\n // sync the reserve balance\r\n syncReserveBalance(reserveToken);\r\n\r\n // issue new funds to the beneficiary in the liquid token\r\n ISmartToken(address(anchor)).issue(_beneficiary, amount);\r\n\r\n // dispatch the conversion event\r\n dispatchConversionEvent(reserveToken, ISmartToken(address(anchor)), _trader, _amount, amount, fee);\r\n\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev sells the liquid token by withdrawing from its reserve\r\n *\r\n * @param _amount amount of liquid tokens to sell\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 reserve tokens received\r\n */\r\n function sell(uint256 _amount, address _trader, address payable _beneficiary) internal returns (uint256) {\r\n // ensure that the input amount was already deposited\r\n require(_amount <= ISmartToken(address(anchor)).balanceOf(address(this)), \"ERR_INVALID_AMOUNT\");\r\n\r\n // get expected target amount and fee\r\n (uint256 amount, uint256 fee) = saleTargetAmount(_amount);\r\n\r\n // ensure the trade gives something in return\r\n require(amount != 0, \"ERR_ZERO_TARGET_AMOUNT\");\r\n\r\n IERC20Token reserveToken = reserveTokens[0];\r\n\r\n // ensure that the trade will only deplete the reserve balance if the total supply is depleted as well\r\n uint256 tokenSupply = ISmartToken(address(anchor)).totalSupply();\r\n uint256 rsvBalance = reserveBalance(reserveToken);\r\n assert(amount < rsvBalance || (amount == rsvBalance && _amount == tokenSupply));\r\n\r\n // destroy the tokens from the converter balance in the liquid token\r\n ISmartToken(address(anchor)).destroy(address(this), _amount);\r\n\r\n // update the reserve balance\r\n reserves[reserveToken].balance = reserves[reserveToken].balance.sub(amount);\r\n\r\n // transfer funds to the beneficiary in the reserve token\r\n if (reserveToken == ETH_RESERVE_ADDRESS)\r\n _beneficiary.transfer(amount);\r\n else\r\n safeTransfer(reserveToken, _beneficiary, amount);\r\n\r\n // dispatch the conversion event\r\n dispatchConversionEvent(ISmartToken(address(anchor)), reserveToken, _trader, _amount, amount, fee);\r\n\r\n return amount;\r\n }\r\n}\r\n",
"sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquid-token/LiquidTokenConverter.sol",
"ast": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquid-token/LiquidTokenConverter.sol",
"exportedSymbols": {
"LiquidTokenConverter": [
14362
]
},
"id": 14363,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 13712,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:24"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol",
"file": "../../ConverterBase.sol",
"id": 13713,
"nodeType": "ImportDirective",
"scope": 14363,
"sourceUnit": 10040,
"src": "77:33:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "../../../token/interfaces/ISmartToken.sol",
"id": 13714,
"nodeType": "ImportDirective",
"scope": 14363,
"sourceUnit": 21183,
"src": "112:51:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 13716,
"name": "ConverterBase",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10039,
"src": "534:13:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
},
"id": 13717,
"nodeType": "InheritanceSpecifier",
"src": "534:13:24"
}
],
"contractDependencies": [
10039,
13340,
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 13715,
"nodeType": "StructuredDocumentation",
"src": "167:332:24",
"text": " @dev Liquid Token Converter\n The liquid token converter is a specialized version of a converter that manages a liquid token.\n The converters govern a token with a single reserve and allow converting between the two.\n Liquid tokens usually have fractional reserve (reserve ratio smaller than 100%)."
},
"fullyImplemented": true,
"id": 14362,
"linearizedBaseContracts": [
14362,
10039,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
13340,
22847
],
"name": "LiquidTokenConverter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 13732,
"nodeType": "Block",
"src": "1079:8:24",
"statements": []
},
"documentation": {
"id": 13718,
"nodeType": "StructuredDocumentation",
"src": "555:315:24",
"text": " @dev initializes a new LiquidTokenConverter instance\n @param _token liquid token governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 13733,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 13727,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13720,
"src": "1020:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 13728,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13722,
"src": "1028:9:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
{
"argumentTypes": null,
"id": 13729,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13724,
"src": "1039:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 13730,
"modifierName": {
"argumentTypes": null,
"id": 13726,
"name": "ConverterBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10039,
"src": "1006:13:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ConverterBase_$10039_$",
"typeString": "type(contract ConverterBase)"
}
},
"nodeType": "ModifierInvocation",
"src": "1006:51:24"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 13725,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13720,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "898:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
"typeName": {
"contractScope": null,
"id": 13719,
"name": "ISmartToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21182,
"src": "898:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13722,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "927:27:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 13721,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "927:17:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13724,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "965:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13723,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "965:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "887:109:24"
},
"returnParameters": {
"id": 13731,
"nodeType": "ParameterList",
"parameters": [],
"src": "1079:0:24"
},
"scope": 14362,
"src": "876:211:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9242
],
"body": {
"id": 13742,
"nodeType": "Block",
"src": "1295:27:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13740,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1313:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 13739,
"id": 13741,
"nodeType": "Return",
"src": "1306:8:24"
}
]
},
"documentation": {
"id": 13734,
"nodeType": "StructuredDocumentation",
"src": "1095:131:24",
"text": " @dev returns the converter type\n @return see the converter types in the the main contract doc"
},
"functionSelector": "3e8ff43f",
"id": 13743,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13736,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "1269:8:24"
},
"parameters": {
"id": 13735,
"nodeType": "ParameterList",
"parameters": [],
"src": "1254:2:24"
},
"returnParameters": {
"id": 13739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13738,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13743,
"src": "1287:6:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 13737,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1287:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1286:8:24"
},
"scope": 14362,
"src": "1232:90:24",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9405
],
"body": {
"id": 13762,
"nodeType": "Block",
"src": "1654:107:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 13750,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "1665:5:24",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidTokenConverter_$14362",
"typeString": "contract super LiquidTokenConverter"
}
},
"id": 13752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptAnchorOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 9405,
"src": "1665:27:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 13753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1665:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13754,
"nodeType": "ExpressionStatement",
"src": "1665:29:24"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 13756,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [
13743
],
"referencedDeclaration": 13743,
"src": "1723:13:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 13757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1723:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 13758,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "1740:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 13759,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1748:4:24",
"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": 13755,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "1712:10:24",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 13760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1712:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13761,
"nodeType": "EmitStatement",
"src": "1707:46:24"
}
]
},
"documentation": {
"id": 13744,
"nodeType": "StructuredDocumentation",
"src": "1330:259:24",
"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": 13763,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13748,
"modifierName": {
"argumentTypes": null,
"id": 13747,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "1644:9:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1644:9:24"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13746,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "1635:8:24"
},
"parameters": {
"id": 13745,
"nodeType": "ParameterList",
"parameters": [],
"src": "1625:2:24"
},
"returnParameters": {
"id": 13749,
"nodeType": "ParameterList",
"parameters": [],
"src": "1654:0:24"
},
"scope": 14362,
"src": "1595:166:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9664
],
"body": {
"id": 13789,
"nodeType": "Block",
"src": "2177:190:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 13778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 13775,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "2261:17:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 13776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2261:19:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13777,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2284:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2261:24:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 13779,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2287:27:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 13774,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2253:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 13780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2253:62:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13781,
"nodeType": "ExpressionStatement",
"src": "2253:62:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13785,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13766,
"src": "2343:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 13786,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13768,
"src": "2351:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 13782,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "2326:5:24",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidTokenConverter_$14362",
"typeString": "contract super LiquidTokenConverter"
}
},
"id": 13784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "addReserve",
"nodeType": "MemberAccess",
"referencedDeclaration": 9664,
"src": "2326:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint32)"
}
},
"id": 13787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2326:33:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13788,
"nodeType": "ExpressionStatement",
"src": "2326:33:24"
}
]
},
"documentation": {
"id": 13764,
"nodeType": "StructuredDocumentation",
"src": "1769:320:24",
"text": " @dev defines the reserve token for the converter\n can only be called by the owner while the converter is inactive and the\n reserve wasn't defined yet\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 13790,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13772,
"modifierName": {
"argumentTypes": null,
"id": 13771,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "2167:9:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2167:9:24"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13770,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2158:8:24"
},
"parameters": {
"id": 13769,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13766,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13790,
"src": "2115:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13765,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2115:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13768,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13790,
"src": "2135:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13767,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2135:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2114:36:24"
},
"returnParameters": {
"id": 13773,
"nodeType": "ParameterList",
"parameters": [],
"src": "2177:0:24"
},
"scope": 14362,
"src": "2095:272:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9256
],
"body": {
"id": 13845,
"nodeType": "Block",
"src": "2954:354:24",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13805,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13795,
"src": "2969:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13809,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3005:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13808,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2997:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13807,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2997:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13810,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2997:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13806,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "2985:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2985:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "2969:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13813,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3017:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13815,
"indexExpression": {
"argumentTypes": null,
"id": 13814,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13793,
"src": "3026:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3017:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13816,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "3017:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2969:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 13822,
"nodeType": "IfStatement",
"src": "2965:131:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13819,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13797,
"src": "3088:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13818,
"name": "purchaseTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14047,
"src": "3067:20:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 13820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3067:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13804,
"id": 13821,
"nodeType": "Return",
"src": "3060:36:24"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13835,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13830,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13823,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13793,
"src": "3111:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13827,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3147:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13826,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3139:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13825,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3139:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13828,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3139:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13824,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "3127:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13829,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3127:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "3111:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13831,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3159:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13833,
"indexExpression": {
"argumentTypes": null,
"id": 13832,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13795,
"src": "3168:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3159:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13834,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "3159:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3111:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 13840,
"nodeType": "IfStatement",
"src": "3107:127:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13837,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13797,
"src": "3226:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13836,
"name": "saleTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14118,
"src": "3209:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 13838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3209:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13804,
"id": 13839,
"nodeType": "Return",
"src": "3202:32:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f544f4b454e",
"id": 13842,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3280:19:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
},
"value": "ERR_INVALID_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
}
],
"id": 13841,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
-19,
-19
],
"referencedDeclaration": -19,
"src": "3273:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 13843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3273:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13844,
"nodeType": "ExpressionStatement",
"src": "3273:27:24"
}
]
},
"documentation": {
"id": 13791,
"nodeType": "StructuredDocumentation",
"src": "2375:428:24",
"text": " @dev returns the expected target amount of converting the source token to the\n target token along with the fee\n @param _sourceToken contract address of the source token\n @param _targetToken contract address of the target token\n @param _amount amount of tokens received from the user\n @return expected target amount\n @return expected fee"
},
"functionSelector": "af94b8d8",
"id": 13846,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13799,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2918:8:24"
},
"parameters": {
"id": 13798,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13793,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2837:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13792,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2837:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13795,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2863:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13794,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2863:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13797,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2889:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13796,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2889:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2836:69:24"
},
"returnParameters": {
"id": 13804,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13801,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2936:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13800,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2936:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13803,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2945:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13802,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2945:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2935:18:24"
},
"scope": 14362,
"src": "2809:499:24",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9789
],
"body": {
"id": 13968,
"nodeType": "Block",
"src": "4083:986:24",
"statements": [
{
"assignments": [
13864
],
"declarations": [
{
"constant": false,
"id": 13864,
"mutability": "mutable",
"name": "targetAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4094:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13863,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4094:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13865,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "4094:20:24"
},
{
"assignments": [
13867
],
"declarations": [
{
"constant": false,
"id": 13867,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4125:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13866,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4125:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13868,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "4125:24:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13881,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13876,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13869,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4166:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13873,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4202:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13872,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4194:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13871,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4194:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4194:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13870,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4182:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13875,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4182:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "4166:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13877,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4214:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13879,
"indexExpression": {
"argumentTypes": null,
"id": 13878,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4223:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4214:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13880,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "4214:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4166:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13907,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13902,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13895,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4382:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13899,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4418:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13898,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4410:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13897,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4410:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4410:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13896,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4398:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4398:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "4382:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13903,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4430:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13905,
"indexExpression": {
"argumentTypes": null,
"id": 13904,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4439:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4430:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13906,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "4430:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4382:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 13925,
"nodeType": "Block",
"src": "4595:84:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f544f4b454e",
"id": 13922,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4647:19:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
},
"value": "ERR_INVALID_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
}
],
"id": 13921,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
-19,
-19
],
"referencedDeclaration": -19,
"src": "4640:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 13923,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4640:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13924,
"nodeType": "ExpressionStatement",
"src": "4640:27:24"
}
]
},
"id": 13926,
"nodeType": "IfStatement",
"src": "4378:301:24",
"trueBody": {
"id": 13920,
"nodeType": "Block",
"src": "4460:120:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13910,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13908,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4475:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 13909,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4490:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "4475:27:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 13911,
"nodeType": "ExpressionStatement",
"src": "4475:27:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13918,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13912,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "4517:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13914,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13853,
"src": "4537:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 13915,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13855,
"src": "4546:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 13916,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13857,
"src": "4555:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 13913,
"name": "sell",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14361,
"src": "4532:4:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (uint256,address,address payable) returns (uint256)"
}
},
"id": 13917,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4532:36:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4517:51:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13919,
"nodeType": "ExpressionStatement",
"src": "4517:51:24"
}
]
}
},
"id": 13927,
"nodeType": "IfStatement",
"src": "4162:517:24",
"trueBody": {
"id": 13894,
"nodeType": "Block",
"src": "4244:119:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13884,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13882,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4259:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 13883,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4274:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "4259:27:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 13885,
"nodeType": "ExpressionStatement",
"src": "4259:27:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13886,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "4301:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13888,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13853,
"src": "4320:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 13889,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13855,
"src": "4329:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 13890,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13857,
"src": "4338:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 13887,
"name": "buy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14218,
"src": "4316:3:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (uint256,address,address) returns (uint256)"
}
},
"id": 13891,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4316:35:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4301:50:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13893,
"nodeType": "ExpressionStatement",
"src": "4301:50:24"
}
]
}
},
{
"assignments": [
13929
],
"declarations": [
{
"constant": false,
"id": 13929,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4745:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13928,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4745:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13938,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13933,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4787:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13932,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4779:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13931,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4779:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13934,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4779:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13930,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4767:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13935,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4767:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 13936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "4767:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 13937,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4767:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4745:64:24"
},
{
"assignments": [
13940
],
"declarations": [
{
"constant": false,
"id": 13940,
"mutability": "mutable",
"name": "reserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4820:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13939,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "4820:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13945,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13941,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4843:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13943,
"indexExpression": {
"argumentTypes": null,
"id": 13942,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4852:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4843:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13944,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4843:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4820:52:24"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13950,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4924:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4916:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13948,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4916:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4916:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13947,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4904:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4904:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 13953,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4934:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13958,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "4981:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13955,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4963:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 13954,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4948:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 13956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4948:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13957,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "4948:32:24",
"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": 13959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4948:48:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13962,
"name": "reserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13940,
"src": "5014:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 13960,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13929,
"src": "4998:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "4998:15:24",
"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": 13963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4998:30:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13946,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "4888:15:24",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 13964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4888:141:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13965,
"nodeType": "EmitStatement",
"src": "4883:146:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13966,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "5049:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 13862,
"id": 13967,
"nodeType": "Return",
"src": "5042:19:24"
}
]
},
"documentation": {
"id": 13847,
"nodeType": "StructuredDocumentation",
"src": "3316:558:24",
"text": " @dev converts between the liquid token and its reserve\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": 13969,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13859,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "4042:8:24"
},
"parameters": {
"id": 13858,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13849,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3899:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13848,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3899:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13851,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3925:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13850,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3925:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13853,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3951:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13852,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3951:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13855,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3968:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13854,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3968:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13857,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3985:28:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 13856,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3985:15:24",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3898:116:24"
},
"returnParameters": {
"id": 13862,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13861,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "4069:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13860,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4069:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4068:9:24"
},
"scope": 14362,
"src": "3880:1189:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14046,
"nodeType": "Block",
"src": "5555:772:24",
"statements": [
{
"assignments": [
13982
],
"declarations": [
{
"constant": false,
"id": 13982,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5566:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13981,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5566:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13991,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13986,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "5608:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13985,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "5600:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13984,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5600:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13987,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5600:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13983,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "5588:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13988,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5588:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 13989,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "5588:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 13990,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5588:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5566:64:24"
},
{
"assignments": [
13993
],
"declarations": [
{
"constant": false,
"id": 13993,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5641:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13992,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5641:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13997,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13994,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "5668:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 13996,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13995,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5682:1:24",
"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": "5668:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5641:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13998,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13982,
"src": "5814:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13999,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5829:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5814:16:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14014,
"nodeType": "IfStatement",
"src": "5810:109:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14006,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "5885:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14008,
"indexExpression": {
"argumentTypes": null,
"id": 14007,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "5894:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5885:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14009,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "5885:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14003,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "5865:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 14001,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13972,
"src": "5853:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14002,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "5853:11:24",
"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": 14004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5853:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14005,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "5853:31:24",
"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": 14010,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5853:62:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 14011,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5917:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 14012,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5852:67:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 13980,
"id": 14013,
"nodeType": "Return",
"src": "5845:74:24"
}
},
{
"assignments": [
14016
],
"declarations": [
{
"constant": false,
"id": 14016,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5932:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14015,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5932:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14033,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14023,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13982,
"src": "6026:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14025,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "6067:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14024,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6052:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14026,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6052:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14027,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6095:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14029,
"indexExpression": {
"argumentTypes": null,
"id": 14028,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "6104:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6095:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14030,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "6095:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14031,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13972,
"src": "6139:7:24",
"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,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14019,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "5974:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14018,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5964:9:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14020,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5964:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14017,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "5949:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14021,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5949:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14022,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "purchaseTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13092,
"src": "5949:62:24",
"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": 14032,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5949:208:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5932:225:24"
},
{
"assignments": [
14035
],
"declarations": [
{
"constant": false,
"id": 14035,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "6248:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14034,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6248:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14039,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14037,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14016,
"src": "6275:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14036,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "6262:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6262:20:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6248:34:24"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14042,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14040,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14016,
"src": "6301:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14041,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14035,
"src": "6310:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6301:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14043,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14035,
"src": "6315:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14044,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "6300:19:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13980,
"id": 14045,
"nodeType": "Return",
"src": "6293:26:24"
}
]
},
"documentation": {
"id": 13970,
"nodeType": "StructuredDocumentation",
"src": "5077:336:24",
"text": " @dev returns the expected target amount of buying with a given amount of tokens\n @param _amount amount of reserve tokens to get the target amount for\n @return amount of liquid tokens that the user will receive\n @return amount of liquid tokens that the user will pay as fee"
},
"id": 14047,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13975,
"modifierName": {
"argumentTypes": null,
"id": 13974,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "5507:6:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "5507:6:24"
}
],
"name": "purchaseTargetAmount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 13973,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13972,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5449:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13971,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5449:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5448:17:24"
},
"returnParameters": {
"id": 13980,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13977,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5532:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13976,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5532:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13979,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5541:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13978,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5541:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5531:18:24"
},
"scope": 14362,
"src": "5419:908:24",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14117,
"nodeType": "Block",
"src": "6736:702:24",
"statements": [
{
"assignments": [
14060
],
"declarations": [
{
"constant": false,
"id": 14060,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "6747:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14059,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6747:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14069,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14064,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "6789:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14063,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6781:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14062,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6781:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14065,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6781:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14061,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "6769:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14066,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6769:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14067,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "6769:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6769:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6747:64:24"
},
{
"assignments": [
14071
],
"declarations": [
{
"constant": false,
"id": 14071,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "6824:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14070,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6824:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14075,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14072,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "6851:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14074,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14073,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6865:1:24",
"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": "6851:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6824:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14076,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14060,
"src": "6957:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14077,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14050,
"src": "6972:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6957:22:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14085,
"nodeType": "IfStatement",
"src": "6953:81:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14080,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7017:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14079,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "7002:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14081,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7002:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 14082,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7032:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 14083,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "7001:33:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 14058,
"id": 14084,
"nodeType": "Return",
"src": "6994:40:24"
}
},
{
"assignments": [
14087
],
"declarations": [
{
"constant": false,
"id": 14087,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "7047:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14086,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7047:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14104,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14094,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14060,
"src": "7137:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14096,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7178:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14095,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "7163:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14097,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7163:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14098,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "7206:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14100,
"indexExpression": {
"argumentTypes": null,
"id": 14099,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7215:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7206:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14101,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "7206:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14102,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14050,
"src": "7250:7:24",
"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,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14090,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "7089:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14089,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "7079:9:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14091,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7079:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14088,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "7064:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7064:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14093,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "saleTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13105,
"src": "7064:58:24",
"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": 14103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7064:204:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7047:221:24"
},
{
"assignments": [
14106
],
"declarations": [
{
"constant": false,
"id": 14106,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "7359:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14105,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7359:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14110,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14108,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14087,
"src": "7386:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14107,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "7373:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7373:20:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7359:34:24"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14111,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14087,
"src": "7412:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14112,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14106,
"src": "7421:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7412:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14114,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14106,
"src": "7426:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14115,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "7411:19:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14058,
"id": 14116,
"nodeType": "Return",
"src": "7404:26:24"
}
]
},
"documentation": {
"id": 14048,
"nodeType": "StructuredDocumentation",
"src": "6335:263:24",
"text": " @dev returns the expected target amount of selling a given amount of tokens\n @param _amount amount of liquid tokens to get the target amount for\n @return expected reserve tokens\n @return expected fee"
},
"id": 14118,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14053,
"modifierName": {
"argumentTypes": null,
"id": 14052,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "6688:6:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "6688:6:24"
}
],
"name": "saleTargetAmount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14051,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14050,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6630:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14049,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6630:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6629:17:24"
},
"returnParameters": {
"id": 14058,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14055,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6713:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14054,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6713:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14057,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6722:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14056,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6722:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6712:18:24"
},
"scope": 14362,
"src": "6604:834:24",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14217,
"nodeType": "Block",
"src": "7914:1040:24",
"statements": [
{
"assignments": [
14131,
14133
],
"declarations": [
{
"constant": false,
"id": 14131,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "7973:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14130,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7973:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14133,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "7989:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14132,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7989:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14137,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14135,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8025:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14134,
"name": "purchaseTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14047,
"src": "8004:20:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 14136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8004:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7972:61:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14139,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8109:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14140,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8119:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8109:11:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14142,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8122:24:24",
"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": 14138,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8101:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8101:46:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14144,
"nodeType": "ExpressionStatement",
"src": "8101:46:24"
},
{
"assignments": [
14146
],
"declarations": [
{
"constant": false,
"id": 14146,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "8160:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14145,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8160:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14150,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14147,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8187:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14149,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14148,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8201:1:24",
"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": "8187:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8160:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 14153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14151,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8283:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14152,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "8299:19:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "8283:35:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14181,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14163,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "8426:3:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14164,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "8426:9:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8439:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8426:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14176,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8501:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14175,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "8486:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8486:28:24",
"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": 14171,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "8475:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14170,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8467:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14169,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8467:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14172,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8467:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 14167,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8444:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 14168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "8444:22:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8444:37:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "8444:41:24",
"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": 14178,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8444:71:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14179,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8519:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8444:82:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "8426:100:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14182,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8528:20:24",
"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": 14162,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8418:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8418:131:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14184,
"nodeType": "ExpressionStatement",
"src": "8418:131:24"
},
"id": 14185,
"nodeType": "IfStatement",
"src": "8279:270:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14155,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "8341:3:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14156,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "8341:9:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14157,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8354:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8341:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14159,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8363:25:24",
"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": 14154,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8333:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14160,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8333:56:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14161,
"nodeType": "ExpressionStatement",
"src": "8333:56:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14187,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8618:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14186,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "8599:18:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 14188,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8599:32:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14189,
"nodeType": "ExpressionStatement",
"src": "8599:32:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14197,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14125,
"src": "8746:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14198,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8760:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14193,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "8731:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14192,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8723:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14191,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8723:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8723:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14190,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "8711:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8711:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21174,
"src": "8711:34:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 14199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8711:56:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14200,
"nodeType": "ExpressionStatement",
"src": "8711:56:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14202,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8846:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14206,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "8880:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14205,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8872:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14204,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8872:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8872:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14203,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "8860:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14208,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8860:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14209,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14123,
"src": "8890:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14210,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8899:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14211,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8908:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14212,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14133,
"src": "8916:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14201,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "8822:23:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14213,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8822:98:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14214,
"nodeType": "ExpressionStatement",
"src": "8822:98:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14215,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8940:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14129,
"id": 14216,
"nodeType": "Return",
"src": "8933:13:24"
}
]
},
"documentation": {
"id": 14119,
"nodeType": "StructuredDocumentation",
"src": "7446:366:24",
"text": " @dev buys the liquid token by depositing in its reserve\n @param _amount amount of reserve token to buy the token for\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of liquid tokens received"
},
"id": 14218,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "buy",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14126,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14121,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7831:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14120,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7831:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14123,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7848:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14122,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7848:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14125,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7865:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14124,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7865:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7830:56:24"
},
"returnParameters": {
"id": 14129,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14128,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7905:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14127,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7905:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7904:9:24"
},
"scope": 14362,
"src": "7818:1136:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14360,
"nodeType": "Block",
"src": "9431:1500:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14231,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "9513:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14241,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "9571:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14240,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9563:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14239,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9563:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9563:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14235,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "9544:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14234,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9536:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14233,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9536:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14236,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9536:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14232,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "9524:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14237,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9524:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "9524:38:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9524:53:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9513:64:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9579:20:24",
"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": 14230,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9505:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9505:95:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14247,
"nodeType": "ExpressionStatement",
"src": "9505:95:24"
},
{
"assignments": [
14249,
14251
],
"declarations": [
{
"constant": false,
"id": 14249,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9661:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14248,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9661:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14251,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9677:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14250,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9677:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14255,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14253,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "9709:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14252,
"name": "saleTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14118,
"src": "9692:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 14254,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9692:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9660:57:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14257,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "9793:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14258,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9803:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "9793:11:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14260,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9806:24:24",
"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": 14256,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9785:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14261,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9785:46:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14262,
"nodeType": "ExpressionStatement",
"src": "9785:46:24"
},
{
"assignments": [
14264
],
"declarations": [
{
"constant": false,
"id": 14264,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9844:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14263,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "9844:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14268,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14265,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "9871:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14267,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14266,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9885:1:24",
"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": "9871:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9844:43:24"
},
{
"assignments": [
14270
],
"declarations": [
{
"constant": false,
"id": 14270,
"mutability": "mutable",
"name": "tokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "10012:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14269,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10012:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14279,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14274,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10054:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14273,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10046:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14272,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10046:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10046:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14271,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10034:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10034:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "10034:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14278,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10034:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10012:64:24"
},
{
"assignments": [
14281
],
"declarations": [
{
"constant": false,
"id": 14281,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "10087:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14280,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10087:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14285,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14283,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10123:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14282,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "10108:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10108:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10087:49:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14289,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14287,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10154:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 14288,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14281,
"src": "10163:10:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10154:19:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14292,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14290,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10178:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14291,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14281,
"src": "10188:10:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10178:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14295,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14293,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10202:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14294,
"name": "tokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14270,
"src": "10213:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10202:22:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10178:46:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 14297,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "10177:48:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10154:71:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14286,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "10147:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 14299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10147:79:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14300,
"nodeType": "ExpressionStatement",
"src": "10147:79:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14310,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "10362:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10354:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14308,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10354:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14311,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10354:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14312,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10369:7:24",
"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": 14304,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10337:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14303,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10329:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14302,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10329:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14305,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10329:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14301,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10317:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14306,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10317:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21181,
"src": "10317:36:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 14313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10317:60:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14314,
"nodeType": "ExpressionStatement",
"src": "10317:60:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14326,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14315,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "10429:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14317,
"indexExpression": {
"argumentTypes": null,
"id": 14316,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10438:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10429:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14318,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "10429:30:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14324,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10497:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14319,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "10462:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14321,
"indexExpression": {
"argumentTypes": null,
"id": 14320,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10471:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10462:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14322,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "10462:30:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14323,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "10462:34:24",
"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": 14325,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10462:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10429:75:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14327,
"nodeType": "ExpressionStatement",
"src": "10429:75:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 14330,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14328,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10588:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14329,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "10604:19:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "10588:35:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14338,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10709:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14339,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14225,
"src": "10723:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14340,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10737:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14337,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "10696:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 14341,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10696:48:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14342,
"nodeType": "ExpressionStatement",
"src": "10696:48:24"
},
"id": 14343,
"nodeType": "IfStatement",
"src": "10584:160:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14334,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10660:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14331,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14225,
"src": "10638:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 14333,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10638:21:24",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 14335,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10638:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14336,
"nodeType": "ExpressionStatement",
"src": "10638:29:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14348,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10843:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14347,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10835:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14346,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10835:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14349,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10835:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14345,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10823:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10823:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14351,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10853:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14352,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14223,
"src": "10867:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14353,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10876:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14354,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10885:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14355,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14251,
"src": "10893:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14344,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "10799:23:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14356,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10799:98:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14357,
"nodeType": "ExpressionStatement",
"src": "10799:98:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14358,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10917:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14229,
"id": 14359,
"nodeType": "Return",
"src": "10910:13:24"
}
]
},
"documentation": {
"id": 14219,
"nodeType": "StructuredDocumentation",
"src": "8962:358:24",
"text": " @dev sells the liquid token by withdrawing from its reserve\n @param _amount amount of liquid tokens to sell\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of reserve tokens received"
},
"id": 14361,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sell",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14221,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9340:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14220,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9340:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14223,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9357:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14222,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9357:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14225,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9374:28:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 14224,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9374:15:24",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9339:64:24"
},
"returnParameters": {
"id": 14229,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14228,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9422:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14227,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9422:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9421:9:24"
},
"scope": 14362,
"src": "9326:1605:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 14363,
"src": "501:10433:24"
}
],
"src": "52:10884:24"
},
"legacyAST": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/types/liquid-token/LiquidTokenConverter.sol",
"exportedSymbols": {
"LiquidTokenConverter": [
14362
]
},
"id": 14363,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 13712,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:24"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol",
"file": "../../ConverterBase.sol",
"id": 13713,
"nodeType": "ImportDirective",
"scope": 14363,
"sourceUnit": 10040,
"src": "77:33:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "../../../token/interfaces/ISmartToken.sol",
"id": 13714,
"nodeType": "ImportDirective",
"scope": 14363,
"sourceUnit": 21183,
"src": "112:51:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 13716,
"name": "ConverterBase",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10039,
"src": "534:13:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
},
"id": 13717,
"nodeType": "InheritanceSpecifier",
"src": "534:13:24"
}
],
"contractDependencies": [
10039,
13340,
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 13715,
"nodeType": "StructuredDocumentation",
"src": "167:332:24",
"text": " @dev Liquid Token Converter\n The liquid token converter is a specialized version of a converter that manages a liquid token.\n The converters govern a token with a single reserve and allow converting between the two.\n Liquid tokens usually have fractional reserve (reserve ratio smaller than 100%)."
},
"fullyImplemented": true,
"id": 14362,
"linearizedBaseContracts": [
14362,
10039,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
13340,
22847
],
"name": "LiquidTokenConverter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 13732,
"nodeType": "Block",
"src": "1079:8:24",
"statements": []
},
"documentation": {
"id": 13718,
"nodeType": "StructuredDocumentation",
"src": "555:315:24",
"text": " @dev initializes a new LiquidTokenConverter instance\n @param _token liquid token governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 13733,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 13727,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13720,
"src": "1020:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 13728,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13722,
"src": "1028:9:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
{
"argumentTypes": null,
"id": 13729,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13724,
"src": "1039:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 13730,
"modifierName": {
"argumentTypes": null,
"id": 13726,
"name": "ConverterBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10039,
"src": "1006:13:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ConverterBase_$10039_$",
"typeString": "type(contract ConverterBase)"
}
},
"nodeType": "ModifierInvocation",
"src": "1006:51:24"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 13725,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13720,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "898:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
"typeName": {
"contractScope": null,
"id": 13719,
"name": "ISmartToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21182,
"src": "898:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13722,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "927:27:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 13721,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "927:17:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13724,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13733,
"src": "965:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13723,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "965:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "887:109:24"
},
"returnParameters": {
"id": 13731,
"nodeType": "ParameterList",
"parameters": [],
"src": "1079:0:24"
},
"scope": 14362,
"src": "876:211:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9242
],
"body": {
"id": 13742,
"nodeType": "Block",
"src": "1295:27:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13740,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1313:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 13739,
"id": 13741,
"nodeType": "Return",
"src": "1306:8:24"
}
]
},
"documentation": {
"id": 13734,
"nodeType": "StructuredDocumentation",
"src": "1095:131:24",
"text": " @dev returns the converter type\n @return see the converter types in the the main contract doc"
},
"functionSelector": "3e8ff43f",
"id": 13743,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13736,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "1269:8:24"
},
"parameters": {
"id": 13735,
"nodeType": "ParameterList",
"parameters": [],
"src": "1254:2:24"
},
"returnParameters": {
"id": 13739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13738,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13743,
"src": "1287:6:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 13737,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1287:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1286:8:24"
},
"scope": 14362,
"src": "1232:90:24",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9405
],
"body": {
"id": 13762,
"nodeType": "Block",
"src": "1654:107:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 13750,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "1665:5:24",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidTokenConverter_$14362",
"typeString": "contract super LiquidTokenConverter"
}
},
"id": 13752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptAnchorOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 9405,
"src": "1665:27:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 13753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1665:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13754,
"nodeType": "ExpressionStatement",
"src": "1665:29:24"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 13756,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [
13743
],
"referencedDeclaration": 13743,
"src": "1723:13:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 13757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1723:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 13758,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "1740:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 13759,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1748:4:24",
"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": 13755,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "1712:10:24",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 13760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1712:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13761,
"nodeType": "EmitStatement",
"src": "1707:46:24"
}
]
},
"documentation": {
"id": 13744,
"nodeType": "StructuredDocumentation",
"src": "1330:259:24",
"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": 13763,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13748,
"modifierName": {
"argumentTypes": null,
"id": 13747,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "1644:9:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1644:9:24"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13746,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "1635:8:24"
},
"parameters": {
"id": 13745,
"nodeType": "ParameterList",
"parameters": [],
"src": "1625:2:24"
},
"returnParameters": {
"id": 13749,
"nodeType": "ParameterList",
"parameters": [],
"src": "1654:0:24"
},
"scope": 14362,
"src": "1595:166:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9664
],
"body": {
"id": 13789,
"nodeType": "Block",
"src": "2177:190:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 13778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 13775,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "2261:17:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 13776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2261:19:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13777,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2284:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2261:24:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 13779,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2287:27:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 13774,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2253:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 13780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2253:62:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13781,
"nodeType": "ExpressionStatement",
"src": "2253:62:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13785,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13766,
"src": "2343:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 13786,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13768,
"src": "2351:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 13782,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "2326:5:24",
"typeDescriptions": {
"typeIdentifier": "t_super$_LiquidTokenConverter_$14362",
"typeString": "contract super LiquidTokenConverter"
}
},
"id": 13784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "addReserve",
"nodeType": "MemberAccess",
"referencedDeclaration": 9664,
"src": "2326:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_uint32_$returns$__$",
"typeString": "function (contract IERC20Token,uint32)"
}
},
"id": 13787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2326:33:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13788,
"nodeType": "ExpressionStatement",
"src": "2326:33:24"
}
]
},
"documentation": {
"id": 13764,
"nodeType": "StructuredDocumentation",
"src": "1769:320:24",
"text": " @dev defines the reserve token for the converter\n can only be called by the owner while the converter is inactive and the\n reserve wasn't defined yet\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 13790,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13772,
"modifierName": {
"argumentTypes": null,
"id": 13771,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "2167:9:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2167:9:24"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13770,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2158:8:24"
},
"parameters": {
"id": 13769,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13766,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13790,
"src": "2115:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13765,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2115:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13768,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13790,
"src": "2135:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13767,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2135:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2114:36:24"
},
"returnParameters": {
"id": 13773,
"nodeType": "ParameterList",
"parameters": [],
"src": "2177:0:24"
},
"scope": 14362,
"src": "2095:272:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9256
],
"body": {
"id": 13845,
"nodeType": "Block",
"src": "2954:354:24",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13805,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13795,
"src": "2969:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13809,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3005:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13808,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2997:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13807,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2997:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13810,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2997:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13806,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "2985:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2985:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "2969:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13813,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3017:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13815,
"indexExpression": {
"argumentTypes": null,
"id": 13814,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13793,
"src": "3026:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3017:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13816,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "3017:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2969:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 13822,
"nodeType": "IfStatement",
"src": "2965:131:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13819,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13797,
"src": "3088:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13818,
"name": "purchaseTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14047,
"src": "3067:20:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 13820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3067:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13804,
"id": 13821,
"nodeType": "Return",
"src": "3060:36:24"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13835,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13830,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13823,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13793,
"src": "3111:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13827,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "3147:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13826,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3139:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13825,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3139:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13828,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3139:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13824,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "3127:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13829,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3127:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "3111:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13831,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "3159:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13833,
"indexExpression": {
"argumentTypes": null,
"id": 13832,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13795,
"src": "3168:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3159:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13834,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "3159:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3111:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 13840,
"nodeType": "IfStatement",
"src": "3107:127:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13837,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13797,
"src": "3226:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13836,
"name": "saleTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14118,
"src": "3209:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 13838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3209:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13804,
"id": 13839,
"nodeType": "Return",
"src": "3202:32:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f544f4b454e",
"id": 13842,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3280:19:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
},
"value": "ERR_INVALID_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
}
],
"id": 13841,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
-19,
-19
],
"referencedDeclaration": -19,
"src": "3273:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 13843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3273:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13844,
"nodeType": "ExpressionStatement",
"src": "3273:27:24"
}
]
},
"documentation": {
"id": 13791,
"nodeType": "StructuredDocumentation",
"src": "2375:428:24",
"text": " @dev returns the expected target amount of converting the source token to the\n target token along with the fee\n @param _sourceToken contract address of the source token\n @param _targetToken contract address of the target token\n @param _amount amount of tokens received from the user\n @return expected target amount\n @return expected fee"
},
"functionSelector": "af94b8d8",
"id": 13846,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13799,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2918:8:24"
},
"parameters": {
"id": 13798,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13793,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2837:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13792,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2837:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13795,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2863:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13794,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2863:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13797,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2889:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13796,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2889:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2836:69:24"
},
"returnParameters": {
"id": 13804,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13801,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2936:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13800,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2936:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13803,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13846,
"src": "2945:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13802,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2945:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2935:18:24"
},
"scope": 14362,
"src": "2809:499:24",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
9789
],
"body": {
"id": 13968,
"nodeType": "Block",
"src": "4083:986:24",
"statements": [
{
"assignments": [
13864
],
"declarations": [
{
"constant": false,
"id": 13864,
"mutability": "mutable",
"name": "targetAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4094:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13863,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4094:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13865,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "4094:20:24"
},
{
"assignments": [
13867
],
"declarations": [
{
"constant": false,
"id": 13867,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4125:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13866,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4125:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13868,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "4125:24:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13881,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13876,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13869,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4166:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13873,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4202:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13872,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4194:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13871,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4194:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4194:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13870,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4182:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13875,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4182:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "4166:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13877,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4214:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13879,
"indexExpression": {
"argumentTypes": null,
"id": 13878,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4223:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4214:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13880,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "4214:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4166:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 13907,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 13902,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13895,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4382:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13899,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4418:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13898,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4410:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13897,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4410:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4410:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13896,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4398:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4398:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "4382:44:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13903,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4430:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13905,
"indexExpression": {
"argumentTypes": null,
"id": 13904,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4439:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4430:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13906,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "4430:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4382:76:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 13925,
"nodeType": "Block",
"src": "4595:84:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f544f4b454e",
"id": 13922,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4647:19:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
},
"value": "ERR_INVALID_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_ebb7677ef55bf004ceacedca2d0ee2121b64fc0fddbb89e9252a1965146107fb",
"typeString": "literal_string \"ERR_INVALID_TOKEN\""
}
],
"id": 13921,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
-19,
-19
],
"referencedDeclaration": -19,
"src": "4640:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 13923,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4640:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13924,
"nodeType": "ExpressionStatement",
"src": "4640:27:24"
}
]
},
"id": 13926,
"nodeType": "IfStatement",
"src": "4378:301:24",
"trueBody": {
"id": 13920,
"nodeType": "Block",
"src": "4460:120:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13910,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13908,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4475:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 13909,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13851,
"src": "4490:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "4475:27:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 13911,
"nodeType": "ExpressionStatement",
"src": "4475:27:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13918,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13912,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "4517:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13914,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13853,
"src": "4537:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 13915,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13855,
"src": "4546:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 13916,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13857,
"src": "4555:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 13913,
"name": "sell",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14361,
"src": "4532:4:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (uint256,address,address payable) returns (uint256)"
}
},
"id": 13917,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4532:36:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4517:51:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13919,
"nodeType": "ExpressionStatement",
"src": "4517:51:24"
}
]
}
},
"id": 13927,
"nodeType": "IfStatement",
"src": "4162:517:24",
"trueBody": {
"id": 13894,
"nodeType": "Block",
"src": "4244:119:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13884,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13882,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4259:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 13883,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13849,
"src": "4274:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "4259:27:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 13885,
"nodeType": "ExpressionStatement",
"src": "4259:27:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 13886,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "4301:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13888,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13853,
"src": "4320:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 13889,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13855,
"src": "4329:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 13890,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13857,
"src": "4338:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 13887,
"name": "buy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14218,
"src": "4316:3:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (uint256,address,address) returns (uint256)"
}
},
"id": 13891,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4316:35:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4301:50:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13893,
"nodeType": "ExpressionStatement",
"src": "4301:50:24"
}
]
}
},
{
"assignments": [
13929
],
"declarations": [
{
"constant": false,
"id": 13929,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4745:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13928,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4745:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13938,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13933,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4787:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13932,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4779:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13931,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4779:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13934,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4779:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13930,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4767:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13935,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4767:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 13936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "4767:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 13937,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4767:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4745:64:24"
},
{
"assignments": [
13940
],
"declarations": [
{
"constant": false,
"id": 13940,
"mutability": "mutable",
"name": "reserveWeight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13968,
"src": "4820:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 13939,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "4820:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13945,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13941,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "4843:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 13943,
"indexExpression": {
"argumentTypes": null,
"id": 13942,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4852:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4843:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 13944,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "4843:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4820:52:24"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13950,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "4924:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4916:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13948,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4916:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4916:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13947,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "4904:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4904:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 13953,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4934:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13958,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "4981:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13955,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13867,
"src": "4963:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 13954,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "4948:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 13956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4948:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13957,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "4948:32:24",
"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": 13959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4948:48:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13962,
"name": "reserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13940,
"src": "5014:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 13960,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13929,
"src": "4998:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 13961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "4998:15:24",
"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": 13963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4998:30:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13946,
"name": "TokenRateUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9089,
"src": "4888:15:24",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256)"
}
},
"id": 13964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4888:141:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 13965,
"nodeType": "EmitStatement",
"src": "4883:146:24"
},
{
"expression": {
"argumentTypes": null,
"id": 13966,
"name": "targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13864,
"src": "5049:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 13862,
"id": 13967,
"nodeType": "Return",
"src": "5042:19:24"
}
]
},
"documentation": {
"id": 13847,
"nodeType": "StructuredDocumentation",
"src": "3316:558:24",
"text": " @dev converts between the liquid token and its reserve\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": 13969,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 13859,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "4042:8:24"
},
"parameters": {
"id": 13858,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13849,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3899:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13848,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3899:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13851,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3925:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13850,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3925:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13853,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3951:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13852,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3951:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13855,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3968:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13854,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3968:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13857,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "3985:28:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 13856,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3985:15:24",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3898:116:24"
},
"returnParameters": {
"id": 13862,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13861,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 13969,
"src": "4069:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13860,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4069:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4068:9:24"
},
"scope": 14362,
"src": "3880:1189:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14046,
"nodeType": "Block",
"src": "5555:772:24",
"statements": [
{
"assignments": [
13982
],
"declarations": [
{
"constant": false,
"id": 13982,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5566:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13981,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5566:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13991,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 13986,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "5608:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 13985,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "5600:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 13984,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5600:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 13987,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5600:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 13983,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "5588:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 13988,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5588:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 13989,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "5588:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 13990,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5588:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5566:64:24"
},
{
"assignments": [
13993
],
"declarations": [
{
"constant": false,
"id": 13993,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5641:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13992,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5641:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 13997,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 13994,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "5668:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 13996,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13995,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5682:1:24",
"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": "5668:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5641:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 13998,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13982,
"src": "5814:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 13999,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5829:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5814:16:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14014,
"nodeType": "IfStatement",
"src": "5810:109:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14006,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "5885:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14008,
"indexExpression": {
"argumentTypes": null,
"id": 14007,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "5894:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5885:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14009,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "5885:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14003,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "5865:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 14001,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13972,
"src": "5853:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14002,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "5853:11:24",
"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": 14004,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5853:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14005,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "5853:31:24",
"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": 14010,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5853:62:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 14011,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5917:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 14012,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5852:67:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 13980,
"id": 14013,
"nodeType": "Return",
"src": "5845:74:24"
}
},
{
"assignments": [
14016
],
"declarations": [
{
"constant": false,
"id": 14016,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "5932:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14015,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5932:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14033,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14023,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13982,
"src": "6026:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14025,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "6067:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14024,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "6052:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14026,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6052:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14027,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "6095:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14029,
"indexExpression": {
"argumentTypes": null,
"id": 14028,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13993,
"src": "6104:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6095:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14030,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "6095:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14031,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13972,
"src": "6139:7:24",
"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,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14019,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "5974:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14018,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5964:9:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14020,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5964:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14017,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "5949:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14021,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5949:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14022,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "purchaseTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13092,
"src": "5949:62:24",
"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": 14032,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5949:208:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5932:225:24"
},
{
"assignments": [
14035
],
"declarations": [
{
"constant": false,
"id": 14035,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14046,
"src": "6248:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14034,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6248:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14039,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14037,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14016,
"src": "6275:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14036,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "6262:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6262:20:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6248:34:24"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14042,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14040,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14016,
"src": "6301:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14041,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14035,
"src": "6310:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6301:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14043,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14035,
"src": "6315:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14044,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "6300:19:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 13980,
"id": 14045,
"nodeType": "Return",
"src": "6293:26:24"
}
]
},
"documentation": {
"id": 13970,
"nodeType": "StructuredDocumentation",
"src": "5077:336:24",
"text": " @dev returns the expected target amount of buying with a given amount of tokens\n @param _amount amount of reserve tokens to get the target amount for\n @return amount of liquid tokens that the user will receive\n @return amount of liquid tokens that the user will pay as fee"
},
"id": 14047,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 13975,
"modifierName": {
"argumentTypes": null,
"id": 13974,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "5507:6:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "5507:6:24"
}
],
"name": "purchaseTargetAmount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 13973,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13972,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5449:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13971,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5449:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5448:17:24"
},
"returnParameters": {
"id": 13980,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 13977,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5532:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13976,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5532:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13979,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14047,
"src": "5541:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13978,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5541:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5531:18:24"
},
"scope": 14362,
"src": "5419:908:24",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14117,
"nodeType": "Block",
"src": "6736:702:24",
"statements": [
{
"assignments": [
14060
],
"declarations": [
{
"constant": false,
"id": 14060,
"mutability": "mutable",
"name": "totalSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "6747:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14059,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6747:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14069,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14064,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "6789:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14063,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6781:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14062,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6781:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14065,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6781:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14061,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "6769:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14066,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6769:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14067,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "6769:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6769:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6747:64:24"
},
{
"assignments": [
14071
],
"declarations": [
{
"constant": false,
"id": 14071,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "6824:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14070,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6824:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14075,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14072,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "6851:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14074,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14073,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6865:1:24",
"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": "6851:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6824:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14076,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14060,
"src": "6957:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14077,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14050,
"src": "6972:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6957:22:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 14085,
"nodeType": "IfStatement",
"src": "6953:81:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14080,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7017:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14079,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "7002:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14081,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7002:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 14082,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7032:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 14083,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "7001:33:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 14058,
"id": 14084,
"nodeType": "Return",
"src": "6994:40:24"
}
},
{
"assignments": [
14087
],
"declarations": [
{
"constant": false,
"id": 14087,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "7047:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14086,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7047:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14104,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14094,
"name": "totalSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14060,
"src": "7137:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14096,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7178:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14095,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "7163:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14097,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7163:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14098,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "7206:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14100,
"indexExpression": {
"argumentTypes": null,
"id": 14099,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14071,
"src": "7215:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7206:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14101,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "7206:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 14102,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14050,
"src": "7250:7:24",
"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,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14090,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "7089:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 14089,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "7079:9:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 14091,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7079:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14088,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "7064:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 14092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7064:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 14093,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "saleTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13105,
"src": "7064:58:24",
"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": 14103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7064:204:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7047:221:24"
},
{
"assignments": [
14106
],
"declarations": [
{
"constant": false,
"id": 14106,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14117,
"src": "7359:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14105,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7359:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14110,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14108,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14087,
"src": "7386:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14107,
"name": "calculateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9806,
"src": "7373:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256)"
}
},
"id": 14109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7373:20:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7359:34:24"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14111,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14087,
"src": "7412:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 14112,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14106,
"src": "7421:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7412:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14114,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14106,
"src": "7426:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 14115,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "7411:19:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 14058,
"id": 14116,
"nodeType": "Return",
"src": "7404:26:24"
}
]
},
"documentation": {
"id": 14048,
"nodeType": "StructuredDocumentation",
"src": "6335:263:24",
"text": " @dev returns the expected target amount of selling a given amount of tokens\n @param _amount amount of liquid tokens to get the target amount for\n @return expected reserve tokens\n @return expected fee"
},
"id": 14118,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 14053,
"modifierName": {
"argumentTypes": null,
"id": 14052,
"name": "active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9134,
"src": "6688:6:24",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "6688:6:24"
}
],
"name": "saleTargetAmount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14051,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14050,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6630:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14049,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6630:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6629:17:24"
},
"returnParameters": {
"id": 14058,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14055,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6713:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14054,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6713:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14057,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14118,
"src": "6722:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14056,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6722:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6712:18:24"
},
"scope": 14362,
"src": "6604:834:24",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14217,
"nodeType": "Block",
"src": "7914:1040:24",
"statements": [
{
"assignments": [
14131,
14133
],
"declarations": [
{
"constant": false,
"id": 14131,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "7973:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14130,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7973:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14133,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "7989:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14132,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7989:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14137,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14135,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8025:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14134,
"name": "purchaseTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14047,
"src": "8004:20:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 14136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8004:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "7972:61:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14139,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8109:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14140,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8119:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8109:11:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14142,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8122:24:24",
"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": 14138,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8101:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8101:46:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14144,
"nodeType": "ExpressionStatement",
"src": "8101:46:24"
},
{
"assignments": [
14146
],
"declarations": [
{
"constant": false,
"id": 14146,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14217,
"src": "8160:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14145,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8160:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14150,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14147,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "8187:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14149,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14148,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8201:1:24",
"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": "8187:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8160:43:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 14153,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14151,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8283:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14152,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "8299:19:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "8283:35:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14181,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14163,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "8426:3:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14164,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "8426:9:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8439:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "8426:14:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14176,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8501:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14175,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "8486:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8486:28:24",
"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": 14171,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "8475:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14170,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8467:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14169,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8467:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14172,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8467:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 14167,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8444:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 14168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "8444:22:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8444:37:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "8444:41:24",
"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": 14178,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8444:71:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 14179,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8519:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8444:82:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "8426:100:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14182,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8528:20:24",
"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": 14162,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8418:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8418:131:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14184,
"nodeType": "ExpressionStatement",
"src": "8418:131:24"
},
"id": 14185,
"nodeType": "IfStatement",
"src": "8279:270:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 14155,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "8341:3:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 14156,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "8341:9:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14157,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8354:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8341:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 14159,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8363:25:24",
"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": 14154,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8333:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14160,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8333:56:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14161,
"nodeType": "ExpressionStatement",
"src": "8333:56:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14187,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8618:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14186,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "8599:18:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 14188,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8599:32:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14189,
"nodeType": "ExpressionStatement",
"src": "8599:32:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14197,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14125,
"src": "8746:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14198,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8760:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14193,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "8731:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14192,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8723:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14191,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8723:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8723:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14190,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "8711:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8711:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "issue",
"nodeType": "MemberAccess",
"referencedDeclaration": 21174,
"src": "8711:34:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 14199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8711:56:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14200,
"nodeType": "ExpressionStatement",
"src": "8711:56:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14202,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14146,
"src": "8846:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14206,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "8880:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14205,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "8872:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14204,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8872:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8872:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14203,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "8860:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14208,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8860:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14209,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14123,
"src": "8890:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14210,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14121,
"src": "8899:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14211,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8908:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14212,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14133,
"src": "8916:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14201,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "8822:23:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14213,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8822:98:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14214,
"nodeType": "ExpressionStatement",
"src": "8822:98:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14215,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14131,
"src": "8940:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14129,
"id": 14216,
"nodeType": "Return",
"src": "8933:13:24"
}
]
},
"documentation": {
"id": 14119,
"nodeType": "StructuredDocumentation",
"src": "7446:366:24",
"text": " @dev buys the liquid token by depositing in its reserve\n @param _amount amount of reserve token to buy the token for\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of liquid tokens received"
},
"id": 14218,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "buy",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14126,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14121,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7831:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14120,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7831:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14123,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7848:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14122,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7848:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14125,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7865:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14124,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7865:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7830:56:24"
},
"returnParameters": {
"id": 14129,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14128,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14218,
"src": "7905:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14127,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "7905:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7904:9:24"
},
"scope": 14362,
"src": "7818:1136:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 14360,
"nodeType": "Block",
"src": "9431:1500:24",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14231,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "9513:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14241,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "9571:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14240,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9563:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14239,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9563:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9563:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14235,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "9544:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14234,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9536:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14233,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9536:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14236,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9536:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14232,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "9524:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14237,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9524:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "9524:38:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 14243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9524:53:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9513:64:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414d4f554e54",
"id": 14245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9579:20:24",
"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": 14230,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9505:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9505:95:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14247,
"nodeType": "ExpressionStatement",
"src": "9505:95:24"
},
{
"assignments": [
14249,
14251
],
"declarations": [
{
"constant": false,
"id": 14249,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9661:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14248,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9661:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14251,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9677:11:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14250,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9677:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14255,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14253,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "9709:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14252,
"name": "saleTargetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14118,
"src": "9692:16:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (uint256) view returns (uint256,uint256)"
}
},
"id": 14254,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9692:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9660:57:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14257,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "9793:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14258,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9803:1:24",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "9793:11:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f5a45524f5f5441524745545f414d4f554e54",
"id": 14260,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9806:24:24",
"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": 14256,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9785:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 14261,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9785:46:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14262,
"nodeType": "ExpressionStatement",
"src": "9785:46:24"
},
{
"assignments": [
14264
],
"declarations": [
{
"constant": false,
"id": 14264,
"mutability": "mutable",
"name": "reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "9844:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 14263,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "9844:11:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14268,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14265,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "9871:13:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 14267,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 14266,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9885:1:24",
"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": "9871:16:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9844:43:24"
},
{
"assignments": [
14270
],
"declarations": [
{
"constant": false,
"id": 14270,
"mutability": "mutable",
"name": "tokenSupply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "10012:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14269,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10012:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14279,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14274,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10054:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14273,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10046:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14272,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10046:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10046:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14271,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10034:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10034:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "10034:40:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 14278,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10034:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10012:64:24"
},
{
"assignments": [
14281
],
"declarations": [
{
"constant": false,
"id": 14281,
"mutability": "mutable",
"name": "rsvBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14360,
"src": "10087:18:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14280,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "10087:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 14285,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14283,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10123:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 14282,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "10108:14:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 14284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10108:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10087:49:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14289,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14287,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10154:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 14288,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14281,
"src": "10163:10:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10154:19:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 14296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14292,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14290,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10178:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14291,
"name": "rsvBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14281,
"src": "10188:10:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10178:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 14295,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14293,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10202:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14294,
"name": "tokenSupply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14270,
"src": "10213:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10202:22:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10178:46:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 14297,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "10177:48:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10154:71:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 14286,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "10147:6:24",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 14299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10147:79:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14300,
"nodeType": "ExpressionStatement",
"src": "10147:79:24"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14310,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "10362:4:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_LiquidTokenConverter_$14362",
"typeString": "contract LiquidTokenConverter"
}
],
"id": 14309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10354:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14308,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10354:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14311,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10354:13:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14312,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10369:7:24",
"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": 14304,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10337:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14303,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10329:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14302,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10329:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14305,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10329:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14301,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10317:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14306,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10317:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 14307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "destroy",
"nodeType": "MemberAccess",
"referencedDeclaration": 21181,
"src": "10317:36:24",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256) external"
}
},
"id": 14313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10317:60:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14314,
"nodeType": "ExpressionStatement",
"src": "10317:60:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14326,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14315,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "10429:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14317,
"indexExpression": {
"argumentTypes": null,
"id": 14316,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10438:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10429:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14318,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "10429:30:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14324,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10497:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 14319,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "10462:8:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 14321,
"indexExpression": {
"argumentTypes": null,
"id": 14320,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10471:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10462:22:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 14322,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "10462:30:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14323,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "10462:34:24",
"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": 14325,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10462:42:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10429:75:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 14327,
"nodeType": "ExpressionStatement",
"src": "10429:75:24"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 14330,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 14328,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10588:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 14329,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "10604:19:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "10588:35:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14338,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10709:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14339,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14225,
"src": "10723:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 14340,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10737:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14337,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "10696:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 14341,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10696:48:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14342,
"nodeType": "ExpressionStatement",
"src": "10696:48:24"
},
"id": 14343,
"nodeType": "IfStatement",
"src": "10584:160:24",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14334,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10660:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 14331,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14225,
"src": "10638:12:24",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 14333,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10638:21:24",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 14335,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10638:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14336,
"nodeType": "ExpressionStatement",
"src": "10638:29:24"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 14348,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10843:6:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 14347,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10835:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 14346,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10835:7:24",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 14349,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10835:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 14345,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "10823:11:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 14350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10823:28:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
{
"argumentTypes": null,
"id": 14351,
"name": "reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14264,
"src": "10853:12:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 14352,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14223,
"src": "10867:7:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 14353,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14221,
"src": "10876:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14354,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10885:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 14355,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14251,
"src": "10893:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 14344,
"name": "dispatchConversionEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9908,
"src": "10799:23:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,uint256)"
}
},
"id": 14356,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10799:98:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 14357,
"nodeType": "ExpressionStatement",
"src": "10799:98:24"
},
{
"expression": {
"argumentTypes": null,
"id": 14358,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14249,
"src": "10917:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 14229,
"id": 14359,
"nodeType": "Return",
"src": "10910:13:24"
}
]
},
"documentation": {
"id": 14219,
"nodeType": "StructuredDocumentation",
"src": "8962:358:24",
"text": " @dev sells the liquid token by withdrawing from its reserve\n @param _amount amount of liquid tokens to sell\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of reserve tokens received"
},
"id": 14361,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sell",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 14226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14221,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9340:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14220,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9340:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14223,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9357:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 14222,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9357:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 14225,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9374:28:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 14224,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9374:15:24",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9339:64:24"
},
"returnParameters": {
"id": 14229,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14228,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14361,
"src": "9422:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 14227,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9422:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9421:9:24"
},
"scope": 14362,
"src": "9326:1605:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 14363,
"src": "501:10433:24"
}
],
"src": "52:10884:24"
},
"compiler": {
"name": "solc",
"version": "0.6.12+commit.27d51765.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-11-10T14:20:44.681Z",
"networkType": "ethereum",
"devdoc": {
"details": "Liquid Token Converter The liquid token converter is a specialized version of a converter that manages a liquid token. The converters govern a token with a single reserve and allow converting between the two. Liquid tokens usually have fractional reserve (reserve ratio smaller than 100%).",
"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"
},
"addReserve(address,uint32)": {
"details": "defines the reserve token for the converter can only be called by the owner while the converter is inactive and the reserve wasn't defined yet",
"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 LiquidTokenConverter instance",
"params": {
"_maxConversionFee": "maximum conversion fee, represented in ppm",
"_registry": "address of a contract registry contract",
"_token": "liquid 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"
}
},
"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"
}
},
"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"
}
},
"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 the source token to the target token along with the fee",
"params": {
"_amount": "amount of tokens received from the user",
"_sourceToken": "contract address of the source token",
"_targetToken": "contract address of the target 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
}
}