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

55374 lines
2.5 MiB

{
"contractName": "ILegacyConverter",
"abi": [
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_minReturn",
"type": "uint256"
}
],
"name": "change",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20Token\",\"name\":\"_targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_minReturn\",\"type\":\"uint256\"}],\"name\":\"change\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/BancorNetwork.sol\":\"ILegacyConverter\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/BancorNetwork.sol\":{\"keccak256\":\"0xb1817f3d45dd66177f17cf45f1b660186ee35575222a11c9bc0e0d44b32846ea\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://ce648a9b8038bb11d1ed091a16aa831a973ff2896ae9aae6b34cb9a8d0e02b00\",\"dweb:/ipfs/QmQKqVVXV6dDBd8saigyEALeLwjG8nhqK8wLRqDGaKSDV6\"]},\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/IConversionPathFinder.sol\":{\"keccak256\":\"0x2d0f5b57bc448581a6e2296486ca618851138f40928049d75220623605915d7b\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://2182eb05da8442792a5f3f4d8cdb2cf0bf9e952ca02638f3880cc59d5fd6dcb6\",\"dweb:/ipfs/QmSH9uWh6zTQkcBgD7VGGSzYW9DjdBDkUZUZ6zhzPWPPDz\"]},\"/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/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/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": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\r\npragma solidity 0.6.12;\r\nimport \"./IConversionPathFinder.sol\";\r\nimport \"./converter/interfaces/IConverter.sol\";\r\nimport \"./converter/interfaces/IConverterAnchor.sol\";\r\nimport \"./converter/interfaces/IBancorFormula.sol\";\r\nimport \"./utility/ContractRegistryClient.sol\";\r\nimport \"./utility/ReentrancyGuard.sol\";\r\nimport \"./utility/TokenHolder.sol\";\r\nimport \"./utility/SafeMath.sol\";\r\nimport \"./token/interfaces/IEtherToken.sol\";\r\nimport \"./token/interfaces/ISmartToken.sol\";\r\nimport \"./bancorx/interfaces/IBancorX.sol\";\r\n\r\n// interface of older converters for backward compatibility\r\ninterface ILegacyConverter {\r\n function change(IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount, uint256 _minReturn) external returns (uint256);\r\n}\r\n\r\n/**\r\n * @dev The BancorNetwork contract is the main entry point for Bancor token conversions.\r\n * It also allows for the conversion of any token in the Bancor Network to any other token in a single\r\n * transaction by providing a conversion path.\r\n *\r\n * A note on Conversion Path: Conversion path is a data structure that is used when converting a token\r\n * to another token in the Bancor Network, when the conversion cannot necessarily be done by a single\r\n * converter and might require multiple 'hops'.\r\n * The path defines which converters should be used and what kind of conversion should be done in each step.\r\n *\r\n * The path format doesn't include complex structure; instead, it is represented by a single array\r\n * in which each 'hop' is represented by a 2-tuple - converter anchor & target token.\r\n * In addition, the first element is always the source token.\r\n * The converter anchor is only used as a pointer to a converter (since converter addresses are more\r\n * likely to change as opposed to anchor addresses).\r\n *\r\n * Format:\r\n * [source token, converter anchor, target token, converter anchor, target token...]\r\n*/\r\ncontract BancorNetwork is TokenHolder, ContractRegistryClient, ReentrancyGuard {\r\n using SafeMath for uint256;\r\n\r\n uint256 private constant PPM_RESOLUTION = 1000000;\r\n IERC20Token private constant ETH_RESERVE_ADDRESS = IERC20Token(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);\r\n\r\n struct ConversionStep {\r\n IConverter converter;\r\n IConverterAnchor anchor;\r\n IERC20Token sourceToken;\r\n IERC20Token targetToken;\r\n address payable beneficiary;\r\n bool isV28OrHigherConverter;\r\n bool processAffiliateFee;\r\n }\r\n\r\n uint256 public maxAffiliateFee = 30000; // maximum affiliate-fee\r\n\r\n mapping (IERC20Token => bool) public etherTokens; // list of all supported ether tokens\r\n\r\n /**\r\n * @dev triggered when a conversion between two tokens occurs\r\n *\r\n * @param _smartToken anchor governed by the converter\r\n * @param _fromToken source ERC20 token\r\n * @param _toToken target ERC20 token\r\n * @param _fromAmount amount converted, in the source token\r\n * @param _toAmount amount returned, minus conversion fee\r\n * @param _trader wallet that initiated the trade\r\n */\r\n event Conversion(\r\n IConverterAnchor indexed _smartToken,\r\n IERC20Token indexed _fromToken,\r\n IERC20Token indexed _toToken,\r\n uint256 _fromAmount,\r\n uint256 _toAmount,\r\n address _trader\r\n );\r\n\r\n /**\r\n * @dev initializes a new BancorNetwork instance\r\n *\r\n * @param _registry address of a contract registry contract\r\n */\r\n constructor(IContractRegistry _registry) ContractRegistryClient(_registry) public {\r\n etherTokens[ETH_RESERVE_ADDRESS] = true;\r\n }\r\n\r\n /**\r\n * @dev allows the owner to update the maximum affiliate-fee\r\n *\r\n * @param _maxAffiliateFee maximum affiliate-fee\r\n */\r\n function setMaxAffiliateFee(uint256 _maxAffiliateFee)\r\n public\r\n ownerOnly\r\n {\r\n require(_maxAffiliateFee <= PPM_RESOLUTION, \"ERR_INVALID_AFFILIATE_FEE\");\r\n maxAffiliateFee = _maxAffiliateFee;\r\n }\r\n\r\n /**\r\n * @dev allows the owner to register/unregister ether tokens\r\n *\r\n * @param _token ether token contract address\r\n * @param _register true to register, false to unregister\r\n */\r\n function registerEtherToken(IEtherToken _token, bool _register)\r\n public\r\n ownerOnly\r\n validAddress(address(_token))\r\n notThis(address(_token))\r\n {\r\n etherTokens[_token] = _register;\r\n }\r\n\r\n /**\r\n * @dev returns the conversion path between two tokens in the network\r\n * note that this method is quite expensive in terms of gas and should generally be called off-chain\r\n *\r\n * @param _sourceToken source token address\r\n * @param _targetToken target token address\r\n *\r\n * @return conversion path between the two tokens\r\n */\r\n function conversionPath(IERC20Token _sourceToken, IERC20Token _targetToken) public view returns (address[] memory) {\r\n IConversionPathFinder pathFinder = IConversionPathFinder(addressOf(CONVERSION_PATH_FINDER));\r\n return pathFinder.findPath(_sourceToken, _targetToken);\r\n }\r\n\r\n /**\r\n * @dev returns the expected target amount of converting a given amount on a given path\r\n * note that there is no support for circular paths\r\n *\r\n * @param _path conversion path (see conversion path format above)\r\n * @param _amount amount of _path[0] tokens received from the sender\r\n *\r\n * @return expected target amount\r\n */\r\n function rateByPath(address[] memory _path, uint256 _amount) public view returns (uint256) {\r\n uint256 amount;\r\n uint256 fee;\r\n uint256 supply;\r\n uint256 balance;\r\n uint32 weight;\r\n IConverter converter;\r\n IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA));\r\n\r\n amount = _amount;\r\n\r\n // verify that the number of elements is larger than 2 and odd\r\n require(_path.length > 2 && _path.length % 2 == 1, \"ERR_INVALID_PATH\");\r\n\r\n // iterate over the conversion path\r\n for (uint256 i = 2; i < _path.length; i += 2) {\r\n IERC20Token sourceToken = IERC20Token(_path[i - 2]);\r\n address anchor = _path[i - 1];\r\n IERC20Token targetToken = IERC20Token(_path[i]);\r\n\r\n converter = IConverter(payable(IConverterAnchor(anchor).owner()));\r\n\r\n // backward compatibility\r\n sourceToken = getConverterTokenAddress(converter, sourceToken);\r\n targetToken = getConverterTokenAddress(converter, targetToken);\r\n\r\n if (address(targetToken) == anchor) { // buy the smart token\r\n // check if the current smart token has changed\r\n if (i < 3 || anchor != _path[i - 3])\r\n supply = ISmartToken(anchor).totalSupply();\r\n\r\n // get the amount & the conversion fee\r\n balance = converter.getConnectorBalance(sourceToken);\r\n (, weight, , , ) = converter.connectors(sourceToken);\r\n amount = formula.purchaseTargetAmount(supply, balance, weight, amount);\r\n fee = amount.mul(converter.conversionFee()).div(PPM_RESOLUTION);\r\n amount -= fee;\r\n\r\n // update the smart token supply for the next iteration\r\n supply = supply.add(amount);\r\n }\r\n else if (address(sourceToken) == anchor) { // sell the smart token\r\n // check if the current smart token has changed\r\n if (i < 3 || anchor != _path[i - 3])\r\n supply = ISmartToken(anchor).totalSupply();\r\n\r\n // get the amount & the conversion fee\r\n balance = converter.getConnectorBalance(targetToken);\r\n (, weight, , , ) = converter.connectors(targetToken);\r\n amount = formula.saleTargetAmount(supply, balance, weight, amount);\r\n fee = amount.mul(converter.conversionFee()).div(PPM_RESOLUTION);\r\n amount -= fee;\r\n\r\n // update the smart token supply for the next iteration\r\n supply = supply.sub(amount);\r\n }\r\n else { // cross reserve conversion\r\n (amount, fee) = getReturn(converter, sourceToken, targetToken, amount);\r\n }\r\n }\r\n\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev converts the token to any other token in the bancor network by following\r\n * a predefined conversion path and transfers the result tokens to a target account\r\n * affiliate account/fee can also be passed in to receive a conversion fee (on top of the liquidity provider fees)\r\n * note that the network should already have been given allowance of the source token (if not ETH)\r\n *\r\n * @param _path conversion path, see conversion path format above\r\n * @param _amount amount to convert from, in the source token\r\n * @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\r\n * @param _beneficiary account that will receive the conversion result or 0x0 to send the result to the sender account\r\n * @param _affiliateAccount wallet address to receive the affiliate fee or 0x0 to disable affiliate fee\r\n * @param _affiliateFee affiliate fee in PPM or 0 to disable affiliate fee\r\n *\r\n * @return amount of tokens received from the conversion\r\n */\r\n function convertByPath(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address payable _beneficiary,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee)\r\n public\r\n payable\r\n protected\r\n greaterThanZero(_minReturn)\r\n returns (uint256)\r\n {\r\n // verify that the path contrains at least a single 'hop' and that the number of elements is odd\r\n require(_path.length > 2 && _path.length % 2 == 1, \"ERR_INVALID_PATH\");\r\n\r\n // validate msg.value and prepare the source token for the conversion\r\n handleSourceToken(IERC20Token(_path[0]), IConverterAnchor(_path[1]), _amount);\r\n\r\n // check if affiliate fee is enabled\r\n bool affiliateFeeEnabled = false;\r\n if (address(_affiliateAccount) == address(0)) {\r\n require(_affiliateFee == 0, \"ERR_INVALID_AFFILIATE_FEE\");\r\n }\r\n else {\r\n require(0 < _affiliateFee && _affiliateFee <= maxAffiliateFee, \"ERR_INVALID_AFFILIATE_FEE\");\r\n affiliateFeeEnabled = true;\r\n }\r\n\r\n // check if beneficiary is set\r\n address payable beneficiary = msg.sender;\r\n if (_beneficiary != address(0))\r\n beneficiary = _beneficiary;\r\n\r\n // convert and get the resulting amount\r\n ConversionStep[] memory data = createConversionData(_path, beneficiary, affiliateFeeEnabled);\r\n uint256 amount = doConversion(data, _amount, _minReturn, _affiliateAccount, _affiliateFee);\r\n\r\n // handle the conversion target tokens\r\n handleTargetToken(data, amount, beneficiary);\r\n\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev converts any other token to BNT in the bancor network by following\r\n a predefined conversion path and transfers the result to an account on a different blockchain\r\n * note that the network should already have been given allowance of the source token (if not ETH)\r\n *\r\n * @param _path conversion path, see conversion path format above\r\n * @param _amount amount to convert from, in the source token\r\n * @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\r\n * @param _targetBlockchain blockchain BNT will be issued on\r\n * @param _targetAccount address/account on the target blockchain to send the BNT to\r\n * @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\r\n *\r\n * @return the amount of BNT received from this conversion\r\n */\r\n function xConvert(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n bytes32 _targetBlockchain,\r\n bytes32 _targetAccount,\r\n uint256 _conversionId\r\n )\r\n public\r\n payable\r\n returns (uint256)\r\n {\r\n return xConvert2(_path, _amount, _minReturn, _targetBlockchain, _targetAccount, _conversionId, address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev converts any other token to BNT in the bancor network by following\r\n a predefined conversion path and transfers the result to an account on a different blockchain\r\n * note that the network should already have been given allowance of the source token (if not ETH)\r\n *\r\n * @param _path conversion path, see conversion path format above\r\n * @param _amount amount to convert from, in the source token\r\n * @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\r\n * @param _targetBlockchain blockchain BNT will be issued on\r\n * @param _targetAccount address/account on the target blockchain to send the BNT to\r\n * @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\r\n * @param _affiliateAccount affiliate account\r\n * @param _affiliateFee affiliate fee in PPM\r\n *\r\n * @return the amount of BNT received from this conversion\r\n */\r\n function xConvert2(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n bytes32 _targetBlockchain,\r\n bytes32 _targetAccount,\r\n uint256 _conversionId,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n )\r\n public\r\n payable\r\n greaterThanZero(_minReturn)\r\n returns (uint256)\r\n {\r\n IERC20Token targetToken = IERC20Token(_path[_path.length - 1]);\r\n IBancorX bancorX = IBancorX(addressOf(BANCOR_X));\r\n\r\n // verify that the destination token is BNT\r\n require(targetToken == IERC20Token(addressOf(BNT_TOKEN)), \"ERR_INVALID_TARGET_TOKEN\");\r\n\r\n // convert and get the resulting amount\r\n uint256 amount = convertByPath(_path, _amount, _minReturn, payable(address(this)), _affiliateAccount, _affiliateFee);\r\n\r\n // grant BancorX allowance\r\n ensureAllowance(targetToken, address(bancorX), amount);\r\n\r\n // transfer the resulting amount to BancorX\r\n bancorX.xTransfer(_targetBlockchain, _targetAccount, amount, _conversionId);\r\n\r\n return amount;\r\n }\r\n\r\n /**\r\n * @dev allows a user to convert a token that was sent from another blockchain into any other\r\n * token on the BancorNetwork\r\n * ideally this transaction is created before the previous conversion is even complete, so\r\n * so the input amount isn't known at that point - the amount is actually take from the\r\n * BancorX contract directly by specifying the conversion id\r\n *\r\n * @param _path conversion path\r\n * @param _bancorX address of the BancorX contract for the source token\r\n * @param _conversionId pre-determined unique (if non zero) id which refers to this conversion\r\n * @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero\r\n * @param _beneficiary wallet to receive the conversion result\r\n *\r\n * @return amount of tokens received from the conversion\r\n */\r\n function completeXConversion(address[] memory _path, IBancorX _bancorX, uint256 _conversionId, uint256 _minReturn, address payable _beneficiary)\r\n public returns (uint256)\r\n {\r\n // verify that the source token is the BancorX token\r\n require(IERC20Token(_path[0]) == _bancorX.token(), \"ERR_INVALID_SOURCE_TOKEN\");\r\n\r\n // get conversion amount from BancorX contract\r\n uint256 amount = _bancorX.getXTransferAmount(_conversionId, msg.sender);\r\n\r\n // perform the conversion\r\n return convertByPath(_path, amount, _minReturn, _beneficiary, address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev executes the actual conversion by following the conversion path\r\n *\r\n * @param _data conversion data, see ConversionStep struct above\r\n * @param _amount amount to convert from, in the source token\r\n * @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\r\n * @param _affiliateAccount affiliate account\r\n * @param _affiliateFee affiliate fee in PPM\r\n *\r\n * @return amount of tokens received from the conversion\r\n */\r\n function doConversion(\r\n ConversionStep[] memory _data,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n ) private returns (uint256) {\r\n uint256 toAmount;\r\n uint256 fromAmount = _amount;\r\n\r\n // iterate over the conversion data\r\n for (uint256 i = 0; i < _data.length; i++) {\r\n ConversionStep memory stepData = _data[i];\r\n\r\n // newer converter\r\n if (stepData.isV28OrHigherConverter) {\r\n // transfer the tokens to the converter only if the network contract currently holds the tokens\r\n // not needed with ETH or if it's the first conversion step\r\n if (i != 0 && _data[i - 1].beneficiary == address(this) && !etherTokens[stepData.sourceToken])\r\n safeTransfer(stepData.sourceToken, address(stepData.converter), fromAmount);\r\n }\r\n // older converter\r\n // if the source token is the smart token, no need to do any transfers as the converter controls it\r\n else if (stepData.sourceToken != ISmartToken(address(stepData.anchor))) {\r\n // grant allowance for it to transfer the tokens from the network contract\r\n ensureAllowance(stepData.sourceToken, address(stepData.converter), fromAmount);\r\n }\r\n\r\n // do the conversion\r\n if (!stepData.isV28OrHigherConverter)\r\n toAmount = ILegacyConverter(address(stepData.converter)).change(stepData.sourceToken, stepData.targetToken, fromAmount, 1);\r\n else if (etherTokens[stepData.sourceToken])\r\n toAmount = stepData.converter.convert{ value: msg.value }(stepData.sourceToken, stepData.targetToken, fromAmount, msg.sender, stepData.beneficiary);\r\n else\r\n toAmount = stepData.converter.convert(stepData.sourceToken, stepData.targetToken, fromAmount, msg.sender, stepData.beneficiary);\r\n\r\n // pay affiliate-fee if needed\r\n if (stepData.processAffiliateFee) {\r\n uint256 affiliateAmount = toAmount.mul(_affiliateFee).div(PPM_RESOLUTION);\r\n require(stepData.targetToken.transfer(_affiliateAccount, affiliateAmount), \"ERR_FEE_TRANSFER_FAILED\");\r\n toAmount -= affiliateAmount;\r\n }\r\n\r\n emit Conversion(stepData.anchor, stepData.sourceToken, stepData.targetToken, fromAmount, toAmount, msg.sender);\r\n fromAmount = toAmount;\r\n }\r\n\r\n // ensure the trade meets the minimum requested amount\r\n require(toAmount >= _minReturn, \"ERR_RETURN_TOO_LOW\");\r\n\r\n return toAmount;\r\n }\r\n\r\n /**\r\n * @dev validates msg.value and prepares the conversion source token for the conversion\r\n *\r\n * @param _sourceToken source token of the first conversion step\r\n * @param _anchor converter anchor of the first conversion step\r\n * @param _amount amount to convert from, in the source token\r\n */\r\n function handleSourceToken(IERC20Token _sourceToken, IConverterAnchor _anchor, uint256 _amount) private {\r\n IConverter firstConverter = IConverter(payable(_anchor.owner()));\r\n bool isNewerConverter = isV28OrHigherConverter(firstConverter);\r\n\r\n // ETH\r\n if (msg.value > 0) {\r\n // validate msg.value\r\n require(msg.value == _amount, \"ERR_ETH_AMOUNT_MISMATCH\");\r\n\r\n // EtherToken converter - deposit the ETH into the EtherToken\r\n // note that it can still be a non ETH converter if the path is wrong\r\n // but such conversion will simply revert\r\n if (!isNewerConverter)\r\n IEtherToken(address(getConverterEtherTokenAddress(firstConverter))).deposit{ value: msg.value }();\r\n }\r\n // EtherToken\r\n else if (etherTokens[_sourceToken]) {\r\n // claim the tokens - if the source token is ETH reserve, this call will fail\r\n // since in that case the transaction must be sent with msg.value\r\n safeTransferFrom(_sourceToken, msg.sender, address(this), _amount);\r\n\r\n // ETH converter - withdraw the ETH\r\n if (isNewerConverter)\r\n IEtherToken(address(_sourceToken)).withdraw(_amount);\r\n }\r\n // other ERC20 token\r\n else {\r\n // newer converter - transfer the tokens from the sender directly to the converter\r\n // otherwise claim the tokens\r\n if (isNewerConverter)\r\n safeTransferFrom(_sourceToken, msg.sender, address(firstConverter), _amount);\r\n else\r\n safeTransferFrom(_sourceToken, msg.sender, address(this), _amount);\r\n }\r\n }\r\n\r\n /**\r\n * @dev handles the conversion target token if the network still holds it at the end of the conversion\r\n *\r\n * @param _data conversion data, see ConversionStep struct above\r\n * @param _amount conversion target amount\r\n * @param _beneficiary wallet to receive the conversion result\r\n */\r\n function handleTargetToken(ConversionStep[] memory _data, uint256 _amount, address payable _beneficiary) private {\r\n ConversionStep memory stepData = _data[_data.length - 1];\r\n\r\n // network contract doesn't hold the tokens, do nothing\r\n if (stepData.beneficiary != address(this))\r\n return;\r\n\r\n IERC20Token targetToken = stepData.targetToken;\r\n\r\n // ETH / EtherToken\r\n if (etherTokens[targetToken]) {\r\n // newer converter should send ETH directly to the beneficiary\r\n assert(!stepData.isV28OrHigherConverter);\r\n\r\n // EtherToken converter - withdraw the ETH and transfer to the beneficiary\r\n IEtherToken(address(targetToken)).withdrawTo(_beneficiary, _amount);\r\n }\r\n // other ERC20 token\r\n else {\r\n safeTransfer(targetToken, _beneficiary, _amount);\r\n }\r\n }\r\n\r\n /**\r\n * @dev creates a memory cache of all conversion steps data to minimize logic and external calls during conversions\r\n *\r\n * @param _conversionPath conversion path, see conversion path format above\r\n * @param _beneficiary wallet to receive the conversion result\r\n * @param _affiliateFeeEnabled true if affiliate fee was requested by the sender, false if not\r\n *\r\n * @return cached conversion data to be ingested later on by the conversion flow\r\n */\r\n function createConversionData(address[] memory _conversionPath, address payable _beneficiary, bool _affiliateFeeEnabled) private view returns (ConversionStep[] memory) {\r\n ConversionStep[] memory data = new ConversionStep[](_conversionPath.length / 2);\r\n\r\n bool affiliateFeeProcessed = false;\r\n IERC20Token bntToken = IERC20Token(addressOf(BNT_TOKEN));\r\n // iterate the conversion path and create the conversion data for each step\r\n uint256 i;\r\n for (i = 0; i < _conversionPath.length - 1; i += 2) {\r\n IConverterAnchor anchor = IConverterAnchor(_conversionPath[i + 1]);\r\n IConverter converter = IConverter(payable(anchor.owner()));\r\n IERC20Token targetToken = IERC20Token(_conversionPath[i + 2]);\r\n\r\n // check if the affiliate fee should be processed in this step\r\n bool processAffiliateFee = _affiliateFeeEnabled && !affiliateFeeProcessed && targetToken == bntToken;\r\n if (processAffiliateFee)\r\n affiliateFeeProcessed = true;\r\n\r\n data[i / 2] = ConversionStep({\r\n // set the converter anchor\r\n anchor: anchor,\r\n\r\n // set the converter\r\n converter: converter,\r\n\r\n // set the source/target tokens\r\n sourceToken: IERC20Token(_conversionPath[i]),\r\n targetToken: targetToken,\r\n\r\n // requires knowledge about the next step, so initialize in the next phase\r\n beneficiary: address(0),\r\n\r\n // set flags\r\n isV28OrHigherConverter: isV28OrHigherConverter(converter),\r\n processAffiliateFee: processAffiliateFee\r\n });\r\n }\r\n\r\n // ETH support\r\n // source is ETH\r\n ConversionStep memory stepData = data[0];\r\n if (etherTokens[stepData.sourceToken]) {\r\n // newer converter - replace the source token address with ETH reserve address\r\n if (stepData.isV28OrHigherConverter)\r\n stepData.sourceToken = ETH_RESERVE_ADDRESS;\r\n // older converter - replace the source token with the EtherToken address used by the converter\r\n else\r\n stepData.sourceToken = getConverterEtherTokenAddress(stepData.converter);\r\n }\r\n\r\n // target is ETH\r\n stepData = data[data.length - 1];\r\n if (etherTokens[stepData.targetToken]) {\r\n // newer converter - replace the target token address with ETH reserve address\r\n if (stepData.isV28OrHigherConverter)\r\n stepData.targetToken = ETH_RESERVE_ADDRESS;\r\n // older converter - replace the target token with the EtherToken address used by the converter\r\n else\r\n stepData.targetToken = getConverterEtherTokenAddress(stepData.converter);\r\n }\r\n\r\n // set the beneficiary for each step\r\n for (i = 0; i < data.length; i++) {\r\n stepData = data[i];\r\n\r\n // first check if the converter in this step is newer as older converters don't even support the beneficiary argument\r\n if (stepData.isV28OrHigherConverter) {\r\n // if affiliate fee is processed in this step, beneficiary is the network contract\r\n if (stepData.processAffiliateFee)\r\n stepData.beneficiary = payable(address(this));\r\n // if it's the last step, beneficiary is the final beneficiary\r\n else if (i == data.length - 1)\r\n stepData.beneficiary = _beneficiary;\r\n // if the converter in the next step is newer, beneficiary is the next converter\r\n else if (data[i + 1].isV28OrHigherConverter)\r\n stepData.beneficiary = address(data[i + 1].converter);\r\n // the converter in the next step is older, beneficiary is the network contract\r\n else\r\n stepData.beneficiary = payable(address(this));\r\n }\r\n else {\r\n // converter in this step is older, beneficiary is the network contract\r\n stepData.beneficiary = payable(address(this));\r\n }\r\n }\r\n\r\n return data;\r\n }\r\n\r\n /**\r\n * @dev utility, checks whether allowance for the given spender exists and approves one if it doesn't.\r\n * Note that we use the non standard erc-20 interface in which `approve` has no return value so that\r\n * this function will work for both standard and non standard tokens\r\n *\r\n * @param _token token to check the allowance in\r\n * @param _spender approved address\r\n * @param _value allowance amount\r\n */\r\n function ensureAllowance(IERC20Token _token, address _spender, uint256 _value) private {\r\n uint256 allowance = _token.allowance(address(this), _spender);\r\n if (allowance < _value) {\r\n if (allowance > 0)\r\n safeApprove(_token, _spender, 0);\r\n safeApprove(_token, _spender, _value);\r\n }\r\n }\r\n\r\n // legacy - returns the address of an EtherToken used by the converter\r\n function getConverterEtherTokenAddress(IConverter _converter) private view returns (IERC20Token) {\r\n uint256 reserveCount = _converter.connectorTokenCount();\r\n for (uint256 i = 0; i < reserveCount; i++) {\r\n IERC20Token reserveTokenAddress = _converter.connectorTokens(i);\r\n if (etherTokens[reserveTokenAddress])\r\n return reserveTokenAddress;\r\n }\r\n\r\n return ETH_RESERVE_ADDRESS;\r\n }\r\n\r\n // legacy - if the token is an ether token, returns the ETH reserve address\r\n // used by the converter, otherwise returns the input token address\r\n function getConverterTokenAddress(IConverter _converter, IERC20Token _token) private view returns (IERC20Token) {\r\n if (!etherTokens[_token])\r\n return _token;\r\n\r\n if (isV28OrHigherConverter(_converter))\r\n return ETH_RESERVE_ADDRESS;\r\n\r\n return getConverterEtherTokenAddress(_converter);\r\n }\r\n\r\n bytes4 private constant GET_RETURN_FUNC_SELECTOR = bytes4(keccak256(\"getReturn(address,address,uint256)\"));\r\n\r\n // using a static call to get the return from older converters\r\n function getReturn(IConverter _dest, IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount) internal view returns (uint256, uint256) {\r\n bytes memory data = abi.encodeWithSelector(GET_RETURN_FUNC_SELECTOR, _sourceToken, _targetToken, _amount);\r\n (bool success, bytes memory returnData) = address(_dest).staticcall(data);\r\n\r\n if (success) {\r\n if (returnData.length == 64) {\r\n return abi.decode(returnData, (uint256, uint256));\r\n }\r\n\r\n if (returnData.length == 32) {\r\n return (abi.decode(returnData, (uint256)), 0);\r\n }\r\n }\r\n\r\n return (0, 0);\r\n }\r\n\r\n bytes4 private constant IS_V28_OR_HIGHER_FUNC_SELECTOR = bytes4(keccak256(\"isV28OrHigher()\"));\r\n\r\n // using a static call to identify converter version\r\n // can't rely on the version number since the function had a different signature in older converters\r\n function isV28OrHigherConverter(IConverter _converter) internal view returns (bool) {\r\n bytes memory data = abi.encodeWithSelector(IS_V28_OR_HIGHER_FUNC_SELECTOR);\r\n (bool success, bytes memory returnData) = address(_converter).staticcall{ gas: 4000 }(data);\r\n\r\n if (success && returnData.length == 32) {\r\n return abi.decode(returnData, (bool));\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function getReturnByPath(address[] memory _path, uint256 _amount) public view returns (uint256, uint256) {\r\n return (rateByPath(_path, _amount), 0);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function convert(address[] memory _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256) {\r\n return convertByPath(_path, _amount, _minReturn, address(0), address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function convert2(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n )\r\n public\r\n payable\r\n returns (uint256)\r\n {\r\n return convertByPath(_path, _amount, _minReturn, address(0), _affiliateAccount, _affiliateFee);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function convertFor(address[] memory _path, uint256 _amount, uint256 _minReturn, address payable _beneficiary) public payable returns (uint256) {\r\n return convertByPath(_path, _amount, _minReturn, _beneficiary, address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function convertFor2(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address payable _beneficiary,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n )\r\n public\r\n payable\r\n greaterThanZero(_minReturn)\r\n returns (uint256)\r\n {\r\n return convertByPath(_path, _amount, _minReturn, _beneficiary, _affiliateAccount, _affiliateFee);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function claimAndConvert(address[] memory _path, uint256 _amount, uint256 _minReturn) public returns (uint256) {\r\n return convertByPath(_path, _amount, _minReturn, address(0), address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function claimAndConvert2(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n )\r\n public\r\n returns (uint256)\r\n {\r\n return convertByPath(_path, _amount, _minReturn, address(0), _affiliateAccount, _affiliateFee);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function claimAndConvertFor(address[] memory _path, uint256 _amount, uint256 _minReturn, address payable _beneficiary) public returns (uint256) {\r\n return convertByPath(_path, _amount, _minReturn, _beneficiary, address(0), 0);\r\n }\r\n\r\n /**\r\n * @dev deprecated, backward compatibility\r\n */\r\n function claimAndConvertFor2(\r\n address[] memory _path,\r\n uint256 _amount,\r\n uint256 _minReturn,\r\n address payable _beneficiary,\r\n address _affiliateAccount,\r\n uint256 _affiliateFee\r\n )\r\n public\r\n returns (uint256)\r\n {\r\n return convertByPath(_path, _amount, _minReturn, _beneficiary, _affiliateAccount, _affiliateFee);\r\n }\r\n}\r\n",
"sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/BancorNetwork.sol",
"ast": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/BancorNetwork.sol",
"exportedSymbols": {
"BancorNetwork": [
1976
],
"ILegacyConverter": [
26
]
},
"id": 1977,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:0"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/IConversionPathFinder.sol",
"file": "./IConversionPathFinder.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 2547,
"src": "77:37:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverter.sol",
"file": "./converter/interfaces/IConverter.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13341,
"src": "116:47:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterAnchor.sol",
"file": "./converter/interfaces/IConverterAnchor.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13350,
"src": "165:53:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol",
"file": "./converter/interfaces/IBancorFormula.sol",
"id": 5,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13178,
"src": "220:51:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ContractRegistryClient.sol",
"file": "./utility/ContractRegistryClient.sol",
"id": 6,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21720,
"src": "273:46:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol",
"file": "./utility/ReentrancyGuard.sol",
"id": 7,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22243,
"src": "321:39:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHolder.sol",
"file": "./utility/TokenHolder.sol",
"id": 8,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22576,
"src": "362:35:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/SafeMath.sol",
"file": "./utility/SafeMath.sol",
"id": 9,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22355,
"src": "399:32:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IEtherToken.sol",
"file": "./token/interfaces/IEtherToken.sol",
"id": 10,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21154,
"src": "433:44:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "./token/interfaces/ISmartToken.sol",
"id": 11,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21183,
"src": "479:44:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/bancorx/interfaces/IBancorX.sol",
"file": "./bancorx/interfaces/IBancorX.sol",
"id": 12,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 3552,
"src": "525:43:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 26,
"linearizedBaseContracts": [
26
],
"name": "ILegacyConverter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "5e5144eb",
"id": 25,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "change",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 21,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "683:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "683:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "709:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "709:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "735:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 17,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "735:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 20,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "752:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "752:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "682:89:0"
},
"returnParameters": {
"id": 24,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 23,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "790:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "790:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "789:9:0"
},
"scope": 26,
"src": "667:132:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1977,
"src": "633:169:0"
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 28,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "1982:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
},
"id": 29,
"nodeType": "InheritanceSpecifier",
"src": "1982:11:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 30,
"name": "ContractRegistryClient",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21719,
"src": "1995:22:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ContractRegistryClient_$21719",
"typeString": "contract ContractRegistryClient"
}
},
"id": 31,
"nodeType": "InheritanceSpecifier",
"src": "1995:22:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 32,
"name": "ReentrancyGuard",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22242,
"src": "2019:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ReentrancyGuard_$22242",
"typeString": "contract ReentrancyGuard"
}
},
"id": 33,
"nodeType": "InheritanceSpecifier",
"src": "2019:15:0"
}
],
"contractDependencies": [
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 27,
"nodeType": "StructuredDocumentation",
"src": "806:1148:0",
"text": " @dev The BancorNetwork contract is the main entry point for Bancor token conversions.\n It also allows for the conversion of any token in the Bancor Network to any other token in a single\n transaction by providing a conversion path.\n A note on Conversion Path: Conversion path is a data structure that is used when converting a token\n to another token in the Bancor Network, when the conversion cannot necessarily be done by a single\n converter and might require multiple 'hops'.\n The path defines which converters should be used and what kind of conversion should be done in each step.\n The path format doesn't include complex structure; instead, it is represented by a single array\n in which each 'hop' is represented by a 2-tuple - converter anchor & target token.\n In addition, the first element is always the source token.\n The converter anchor is only used as a pointer to a converter (since converter addresses are more\n likely to change as opposed to anchor addresses).\n Format:\n [source token, converter anchor, target token, converter anchor, target token...]"
},
"fullyImplemented": true,
"id": 1976,
"linearizedBaseContracts": [
1976,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
22847
],
"name": "BancorNetwork",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 36,
"libraryName": {
"contractScope": null,
"id": 34,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22354,
"src": "2048:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$22354",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "2042:27:0",
"typeName": {
"id": 35,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2061:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"id": 39,
"mutability": "constant",
"name": "PPM_RESOLUTION",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2077:49:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 37,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2077:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31303030303030",
"id": 38,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2119:7:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000_by_1",
"typeString": "int_const 1000000"
},
"value": "1000000"
},
"visibility": "private"
},
{
"constant": true,
"id": 44,
"mutability": "constant",
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2133:106:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 40,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2133:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307845656565654565656545654565654565456545656545454565656565456565656565656545456545",
"id": 42,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2196:42:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 41,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "2184:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2184:55:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"visibility": "private"
},
{
"canonicalName": "BancorNetwork.ConversionStep",
"id": 59,
"members": [
{
"constant": false,
"id": 46,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2281:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 45,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "2281:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 48,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2312:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 47,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "2312:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 50,
"mutability": "mutable",
"name": "sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2346:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 49,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2346:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 52,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2380:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 51,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2380:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 54,
"mutability": "mutable",
"name": "beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2414:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 53,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2414:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 56,
"mutability": "mutable",
"name": "isV28OrHigherConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2452:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 55,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2452:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 58,
"mutability": "mutable",
"name": "processAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2490:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 57,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2490:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "ConversionStep",
"nodeType": "StructDefinition",
"scope": 1976,
"src": "2248:274:0",
"visibility": "public"
},
{
"constant": false,
"functionSelector": "5d732ff2",
"id": 62,
"mutability": "mutable",
"name": "maxAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2530:38:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 60,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2530:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3330303030",
"id": 61,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2563:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_30000_by_1",
"typeString": "int_const 30000"
},
"value": "30000"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "8077ccf7",
"id": 66,
"mutability": "mutable",
"name": "etherTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2606:48:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
},
"typeName": {
"id": 65,
"keyType": {
"contractScope": null,
"id": 63,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2615:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Mapping",
"src": "2606:29:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
},
"valueType": {
"id": 64,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2630:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 67,
"nodeType": "StructuredDocumentation",
"src": "2703:441:0",
"text": " @dev triggered when a conversion between two tokens occurs\n @param _smartToken anchor governed by the converter\n @param _fromToken source ERC20 token\n @param _toToken target ERC20 token\n @param _fromAmount amount converted, in the source token\n @param _toAmount amount returned, minus conversion fee\n @param _trader wallet that initiated the trade"
},
"id": 81,
"name": "Conversion",
"nodeType": "EventDefinition",
"parameters": {
"id": 80,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 69,
"indexed": true,
"mutability": "mutable",
"name": "_smartToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3177:36:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 68,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "3177:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"indexed": true,
"mutability": "mutable",
"name": "_fromToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3224:30:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 70,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3224:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 73,
"indexed": true,
"mutability": "mutable",
"name": "_toToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3265:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 72,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3265:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 75,
"indexed": false,
"mutability": "mutable",
"name": "_fromAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3304:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 74,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3304:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 77,
"indexed": false,
"mutability": "mutable",
"name": "_toAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3334:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 76,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3334:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 79,
"indexed": false,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3362:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 78,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3362:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3166:218:0"
},
"src": "3150:235:0"
},
{
"body": {
"id": 96,
"nodeType": "Block",
"src": "3625:58:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 94,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 90,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "3636:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 92,
"indexExpression": {
"argumentTypes": null,
"id": 91,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "3648:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3636:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 93,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3671:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "3636:39:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 95,
"nodeType": "ExpressionStatement",
"src": "3636:39:0"
}
]
},
"documentation": {
"id": 82,
"nodeType": "StructuredDocumentation",
"src": "3393:144:0",
"text": " @dev initializes a new BancorNetwork instance\n @param _registry address of a contract registry contract"
},
"id": 97,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 87,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 84,
"src": "3607:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
}
],
"id": 88,
"modifierName": {
"argumentTypes": null,
"id": 86,
"name": "ContractRegistryClient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21719,
"src": "3584:22:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ContractRegistryClient_$21719_$",
"typeString": "type(contract ContractRegistryClient)"
}
},
"nodeType": "ModifierInvocation",
"src": "3584:33:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 85,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 84,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 97,
"src": "3555:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 83,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "3555:17:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3554:29:0"
},
"returnParameters": {
"id": 89,
"nodeType": "ParameterList",
"parameters": [],
"src": "3625:0:0"
},
"scope": 1976,
"src": "3543:140:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 116,
"nodeType": "Block",
"src": "3935:136:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 106,
"name": "_maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 100,
"src": "3954:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 107,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "3974:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3954:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3990:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 105,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "3946:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3946:72:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 111,
"nodeType": "ExpressionStatement",
"src": "3946:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 112,
"name": "maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62,
"src": "4029:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 113,
"name": "_maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 100,
"src": "4047:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4029:34:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 115,
"nodeType": "ExpressionStatement",
"src": "4029:34:0"
}
]
},
"documentation": {
"id": 98,
"nodeType": "StructuredDocumentation",
"src": "3691:144:0",
"text": " @dev allows the owner to update the maximum affiliate-fee\n @param _maxAffiliateFee maximum affiliate-fee"
},
"functionSelector": "f3bc7d2a",
"id": 117,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 103,
"modifierName": {
"argumentTypes": null,
"id": 102,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "3920:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3920:9:0"
}
],
"name": "setMaxAffiliateFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 101,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 100,
"mutability": "mutable",
"name": "_maxAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 117,
"src": "3869:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 99,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3869:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3868:26:0"
},
"returnParameters": {
"id": 104,
"nodeType": "ParameterList",
"parameters": [],
"src": "3935:0:0"
},
"scope": 1976,
"src": "3841:230:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 145,
"nodeType": "Block",
"src": "4474:50:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 139,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "4485:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 141,
"indexExpression": {
"argumentTypes": null,
"id": 140,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4497:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4485:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 142,
"name": "_register",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 122,
"src": "4507:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4485:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 144,
"nodeType": "ExpressionStatement",
"src": "4485:31:0"
}
]
},
"documentation": {
"id": 118,
"nodeType": "StructuredDocumentation",
"src": "4079:212:0",
"text": " @dev allows the owner to register/unregister ether tokens\n @param _token ether token contract address\n @param _register true to register, false to unregister"
},
"functionSelector": "02ef521e",
"id": 146,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 125,
"modifierName": {
"argumentTypes": null,
"id": 124,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "4386:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4386:9:0"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 129,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4426:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
],
"id": 128,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4418:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 127,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4418:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4418:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 131,
"modifierName": {
"argumentTypes": null,
"id": 126,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "4405:12:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "4405:29:0"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 135,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4460:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
],
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4452:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 133,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4452:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4452:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 137,
"modifierName": {
"argumentTypes": null,
"id": 132,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "4444:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "4444:24:0"
}
],
"name": "registerEtherToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 123,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 120,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 146,
"src": "4325:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
},
"typeName": {
"contractScope": null,
"id": 119,
"name": "IEtherToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21153,
"src": "4325:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 122,
"mutability": "mutable",
"name": "_register",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 146,
"src": "4345:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 121,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "4345:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4324:36:0"
},
"returnParameters": {
"id": 138,
"nodeType": "ParameterList",
"parameters": [],
"src": "4474:0:0"
},
"scope": 1976,
"src": "4297:227:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 171,
"nodeType": "Block",
"src": "5021:175:0",
"statements": [
{
"assignments": [
158
],
"declarations": [
{
"constant": false,
"id": 158,
"mutability": "mutable",
"name": "pathFinder",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 171,
"src": "5032:32:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
},
"typeName": {
"contractScope": null,
"id": 157,
"name": "IConversionPathFinder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2546,
"src": "5032:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 164,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 161,
"name": "CONVERSION_PATH_FINDER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21539,
"src": "5099:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 160,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5089:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 162,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5089:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 159,
"name": "IConversionPathFinder",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2546,
"src": "5067:21:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConversionPathFinder_$2546_$",
"typeString": "type(contract IConversionPathFinder)"
}
},
"id": 163,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5067:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5032:91:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 167,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 149,
"src": "5161:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 168,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 151,
"src": "5175:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 165,
"name": "pathFinder",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "5141:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "findPath",
"nodeType": "MemberAccess",
"referencedDeclaration": 2545,
"src": "5141:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$returns$_t_array$_t_address_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token,contract IERC20Token) view external returns (address[] memory)"
}
},
"id": 169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5141:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"functionReturnParameters": 156,
"id": 170,
"nodeType": "Return",
"src": "5134:54:0"
}
]
},
"documentation": {
"id": 147,
"nodeType": "StructuredDocumentation",
"src": "4532:368:0",
"text": " @dev returns the conversion path between two tokens in the network\n note that this method is quite expensive in terms of gas and should generally be called off-chain\n @param _sourceToken source token address\n @param _targetToken target token address\n @return conversion path between the two tokens"
},
"functionSelector": "d734fa19",
"id": 172,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "conversionPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 152,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 149,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "4930:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 148,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4930:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 151,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "4956:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 150,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4956:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4929:52:0"
},
"returnParameters": {
"id": 156,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 155,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "5003:16:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 153,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5003:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 154,
"length": null,
"nodeType": "ArrayTypeName",
"src": "5003:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5002:18:0"
},
"scope": 1976,
"src": "4906:290:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 461,
"nodeType": "Block",
"src": "5682:2762:0",
"statements": [
{
"assignments": [
184
],
"declarations": [
{
"constant": false,
"id": 184,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5693:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 183,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5693:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 185,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5693:14:0"
},
{
"assignments": [
187
],
"declarations": [
{
"constant": false,
"id": 187,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5718:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 186,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5718:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 188,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5718:11:0"
},
{
"assignments": [
190
],
"declarations": [
{
"constant": false,
"id": 190,
"mutability": "mutable",
"name": "supply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5740:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 189,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5740:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 191,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5740:14:0"
},
{
"assignments": [
193
],
"declarations": [
{
"constant": false,
"id": 193,
"mutability": "mutable",
"name": "balance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5765:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 192,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5765:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 194,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5765:15:0"
},
{
"assignments": [
196
],
"declarations": [
{
"constant": false,
"id": 196,
"mutability": "mutable",
"name": "weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5791:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 195,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5791:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 197,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5791:13:0"
},
{
"assignments": [
199
],
"declarations": [
{
"constant": false,
"id": 199,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5815:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 198,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "5815:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 200,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5815:20:0"
},
{
"assignments": [
202
],
"declarations": [
{
"constant": false,
"id": 202,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5846:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 201,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "5846:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 208,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 205,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "5896:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 204,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5886:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5886:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 203,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "5871:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5871:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5846:66:0"
},
{
"expression": {
"argumentTypes": null,
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 209,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "5925:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 210,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 178,
"src": "5934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5925:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 212,
"nodeType": "ExpressionStatement",
"src": "5925:16:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 214,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6034:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6034:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 216,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6049:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6034:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 223,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 221,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 218,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6054:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6054:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 220,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6069:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6054:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 222,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6074:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "6054:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6034:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f50415448",
"id": 225,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6077:18:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
},
"value": "ERR_INVALID_PATH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
}
],
"id": 213,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6026:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 226,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6026:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 227,
"nodeType": "ExpressionStatement",
"src": "6026:70:0"
},
{
"body": {
"id": 457,
"nodeType": "Block",
"src": "6200:2211:0",
"statements": [
{
"assignments": [
241
],
"declarations": [
{
"constant": false,
"id": 241,
"mutability": "mutable",
"name": "sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6215:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 240,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6215:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 249,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 243,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6253:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 247,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 244,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6259:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6263:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6259:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6253:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 242,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "6241:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6241:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6215:51:0"
},
{
"assignments": [
251
],
"declarations": [
{
"constant": false,
"id": 251,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6281:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 250,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6281:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 257,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 252,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6298:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 256,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 253,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6304:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 254,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6308:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "6304:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6298:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6281:29:0"
},
{
"assignments": [
259
],
"declarations": [
{
"constant": false,
"id": 259,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6325:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 258,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6325:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 265,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 261,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6363:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 263,
"indexExpression": {
"argumentTypes": null,
"id": 262,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6369:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6363:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 260,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "6351:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 264,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6351:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6325:47:0"
},
{
"expression": {
"argumentTypes": null,
"id": 277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 266,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6389:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 271,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6437:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 270,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "6420:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 272,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6420:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 273,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "6420:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 274,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6420:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 269,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6412:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 268,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6412:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6412:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 267,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "6401:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6401:53:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"src": "6389:65:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 278,
"nodeType": "ExpressionStatement",
"src": "6389:65:0"
},
{
"expression": {
"argumentTypes": null,
"id": 284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 279,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "6510:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 281,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6549:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 282,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "6560:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 280,
"name": "getConverterTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "6524:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter,contract IERC20Token) view returns (contract IERC20Token)"
}
},
"id": 283,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6524:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "6510:62:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 285,
"nodeType": "ExpressionStatement",
"src": "6510:62:0"
},
{
"expression": {
"argumentTypes": null,
"id": 291,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 286,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6587:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 288,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6626:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 289,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6637:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 287,
"name": "getConverterTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "6601:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter,contract IERC20Token) view returns (contract IERC20Token)"
}
},
"id": 290,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6601:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "6587:62:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 292,
"nodeType": "ExpressionStatement",
"src": "6587:62:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 295,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6678:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 294,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6670:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 293,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6670:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6670:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 297,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6694:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "6670:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 373,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 370,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7480:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 369,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "7472:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 368,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7472:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 371,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7472:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 372,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7496:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "7472:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 454,
"nodeType": "Block",
"src": "8267:133:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 443,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8315:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 444,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8323:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 445,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "8314:13:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 447,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "8340:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 448,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "8351:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 449,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "8364:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 450,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8377:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 446,
"name": "getReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1664,
"src": "8330:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IConverter,contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8330:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"src": "8314:70:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 453,
"nodeType": "ExpressionStatement",
"src": "8314:70:0"
}
]
},
"id": 455,
"nodeType": "IfStatement",
"src": "7468:932:0",
"trueBody": {
"id": 442,
"nodeType": "Block",
"src": "7504:744:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 384,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 376,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 374,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "7616:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 375,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7620:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "7616:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 377,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7625:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 378,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "7635:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 382,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 381,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 379,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "7641:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 380,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7645:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "7641:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7635:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "7625:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "7616:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 393,
"nodeType": "IfStatement",
"src": "7612:100:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 385,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7670:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 387,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7691:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 386,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "7679:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7679:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "7679:31:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7679:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7670:42:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 392,
"nodeType": "ExpressionStatement",
"src": "7670:42:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 394,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7789:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 397,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "7829:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 395,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7799:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 396,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getConnectorBalance",
"nodeType": "MemberAccess",
"referencedDeclaration": 13327,
"src": "7799:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view external returns (uint256)"
}
},
"id": 398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7799:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7789:52:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 400,
"nodeType": "ExpressionStatement",
"src": "7789:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 407,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
null,
{
"argumentTypes": null,
"id": 401,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7863:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
null,
null,
null
],
"id": 402,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "7860:16:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$_t_uint32_$__$__$__$",
"typeString": "tuple(,uint32,,,)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 405,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "7900:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 403,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7879:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectors",
"nodeType": "MemberAccess",
"referencedDeclaration": 13320,
"src": "7879:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "function (contract IERC20Token) view external returns (uint256,uint32,bool,bool,bool)"
}
},
"id": 406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7879:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"src": "7860:52:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 408,
"nodeType": "ExpressionStatement",
"src": "7860:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 417,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 409,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7931:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 412,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7965:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 413,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7973:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 414,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7982:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 415,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7990:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 410,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 202,
"src": "7940:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "saleTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13105,
"src": "7940:24:0",
"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": 416,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7940:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7931:66:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 418,
"nodeType": "ExpressionStatement",
"src": "7931:66:0"
},
{
"expression": {
"argumentTypes": null,
"id": 429,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 419,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8016:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 427,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "8064:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 422,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "8033:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "conversionFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 13238,
"src": "8033:23:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint32_$",
"typeString": "function () view external returns (uint32)"
}
},
"id": 424,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8033:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 420,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8022:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 421,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "8022:10:0",
"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": 425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8022:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 426,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "8022:41:0",
"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": 428,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8022:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8016:63:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 430,
"nodeType": "ExpressionStatement",
"src": "8016:63:0"
},
{
"expression": {
"argumentTypes": null,
"id": 433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 431,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8098:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 432,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8108:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8098:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 434,
"nodeType": "ExpressionStatement",
"src": "8098:13:0"
},
{
"expression": {
"argumentTypes": null,
"id": 440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 435,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "8205:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 438,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8225:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 436,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "8214:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 437,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "8214:10:0",
"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": 439,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8214:18:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8205:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 441,
"nodeType": "ExpressionStatement",
"src": "8205:27:0"
}
]
}
},
"id": 456,
"nodeType": "IfStatement",
"src": "6666:1734:0",
"trueBody": {
"id": 367,
"nodeType": "Block",
"src": "6702:747:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 299,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6813:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6817:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "6813:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 308,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 302,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6822:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 303,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6832:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 307,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 306,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 304,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6838:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 305,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6842:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "6838:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6832:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "6822:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6813:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 318,
"nodeType": "IfStatement",
"src": "6809:100:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 310,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "6867:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 312,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6888:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 311,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "6876:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6876:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "6876:31:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 315,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6876:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6867:42:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "6867:42:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 324,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 319,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "6986:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 322,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7026:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 320,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6996:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 321,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getConnectorBalance",
"nodeType": "MemberAccess",
"referencedDeclaration": 13327,
"src": "6996:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view external returns (uint256)"
}
},
"id": 323,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6996:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6986:52:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 325,
"nodeType": "ExpressionStatement",
"src": "6986:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 332,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
null,
{
"argumentTypes": null,
"id": 326,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7060:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
null,
null,
null
],
"id": 327,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "7057:16:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$_t_uint32_$__$__$__$",
"typeString": "tuple(,uint32,,,)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 330,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7097:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 328,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7076:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectors",
"nodeType": "MemberAccess",
"referencedDeclaration": 13320,
"src": "7076:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "function (contract IERC20Token) view external returns (uint256,uint32,bool,bool,bool)"
}
},
"id": 331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7076:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"src": "7057:52:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 333,
"nodeType": "ExpressionStatement",
"src": "7057:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 334,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7128:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 337,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7166:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 338,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7174:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 339,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7183:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 340,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7191:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 335,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 202,
"src": "7137:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "purchaseTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13092,
"src": "7137:28:0",
"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": 341,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7137:61:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7128:70:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 343,
"nodeType": "ExpressionStatement",
"src": "7128:70:0"
},
{
"expression": {
"argumentTypes": null,
"id": 354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 344,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "7217:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 352,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "7265:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 347,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7234:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 348,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "conversionFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 13238,
"src": "7234:23:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint32_$",
"typeString": "function () view external returns (uint32)"
}
},
"id": 349,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7234:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 345,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7223:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 346,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "7223:10:0",
"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": 350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7223:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 351,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "7223:41:0",
"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": 353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7223:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7217:63:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 355,
"nodeType": "ExpressionStatement",
"src": "7217:63:0"
},
{
"expression": {
"argumentTypes": null,
"id": 358,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 356,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7299:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 357,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "7309:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7299:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 359,
"nodeType": "ExpressionStatement",
"src": "7299:13:0"
},
{
"expression": {
"argumentTypes": null,
"id": 365,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 360,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7406:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 363,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7426:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 361,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7415:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22271,
"src": "7415:10:0",
"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": 364,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7415:18:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7406:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 366,
"nodeType": "ExpressionStatement",
"src": "7406:27:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 235,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 232,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6174:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 233,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6178:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6178:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6174:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 458,
"initializationExpression": {
"assignments": [
229
],
"declarations": [
{
"constant": false,
"id": 229,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 458,
"src": "6159:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 228,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6159:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 231,
"initialValue": {
"argumentTypes": null,
"hexValue": "32",
"id": 230,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6171:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "VariableDeclarationStatement",
"src": "6159:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 236,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6192:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "32",
"id": 237,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6197:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6192:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 239,
"nodeType": "ExpressionStatement",
"src": "6192:6:0"
},
"nodeType": "ForStatement",
"src": "6154:2257:0"
},
{
"expression": {
"argumentTypes": null,
"id": 459,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8430:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 182,
"id": 460,
"nodeType": "Return",
"src": "8423:13:0"
}
]
},
"documentation": {
"id": 173,
"nodeType": "StructuredDocumentation",
"src": "5204:381:0",
"text": " @dev returns the expected target amount of converting a given amount on a given path\n note that there is no support for circular paths\n @param _path conversion path (see conversion path format above)\n @param _amount amount of _path[0] tokens received from the sender\n @return expected target amount"
},
"functionSelector": "7f9c0ecd",
"id": 462,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "rateByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 179,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 176,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5611:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 174,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5611:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 175,
"length": null,
"nodeType": "ArrayTypeName",
"src": "5611:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 178,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5635:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 177,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5635:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5610:41:0"
},
"returnParameters": {
"id": 182,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 181,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5673:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 180,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5673:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5672:9:0"
},
"scope": 1976,
"src": "5591:2853:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 597,
"nodeType": "Block",
"src": "9948:1329:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 497,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 487,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10073:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 488,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10073:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 489,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10088:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "10073:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 496,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 491,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10093:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 492,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10093:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 493,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10108:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "10093:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 495,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10113:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "10093:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10073:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f50415448",
"id": 498,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10116:18:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
},
"value": "ERR_INVALID_PATH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
}
],
"id": 486,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10065:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10065:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 500,
"nodeType": "ExpressionStatement",
"src": "10065:70:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 503,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10257:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 505,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 504,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10263:1:0",
"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": "10257:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 502,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "10245:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10245:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 508,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10285:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 510,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 509,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10291:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10285:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 507,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "10268:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 511,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10268:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"id": 512,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 468,
"src": "10296:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 501,
"name": "handleSourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1110,
"src": "10227:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IConverterAnchor_$13349_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IConverterAnchor,uint256)"
}
},
"id": 513,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10227:77:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 514,
"nodeType": "ExpressionStatement",
"src": "10227:77:0"
},
{
"assignments": [
516
],
"declarations": [
{
"constant": false,
"id": 516,
"mutability": "mutable",
"name": "affiliateFeeEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10363:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 515,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "10363:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 518,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 517,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10390:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "10363:32:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 527,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 521,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 474,
"src": "10418:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 520,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10410:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 519,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10410:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10410:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 525,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10448:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 524,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10440:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 523,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10440:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10440:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10410:40:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 551,
"nodeType": "Block",
"src": "10550:159:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 543,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 537,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10573:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 538,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10577:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10573:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 540,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10594:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 541,
"name": "maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62,
"src": "10611:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10594:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10573:53:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 544,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10628:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 536,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10565:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 545,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10565:91:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 546,
"nodeType": "ExpressionStatement",
"src": "10565:91:0"
},
{
"expression": {
"argumentTypes": null,
"id": 549,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 547,
"name": "affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 516,
"src": "10671:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 548,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10693:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "10671:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 550,
"nodeType": "ExpressionStatement",
"src": "10671:26:0"
}
]
},
"id": 552,
"nodeType": "IfStatement",
"src": "10406:303:0",
"trueBody": {
"id": 535,
"nodeType": "Block",
"src": "10452:83:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 531,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 529,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10475:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 530,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10492:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "10475:18:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 532,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10495:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 528,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10467:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 533,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10467:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 534,
"nodeType": "ExpressionStatement",
"src": "10467:56:0"
}
]
}
},
{
"assignments": [
554
],
"declarations": [
{
"constant": false,
"id": 554,
"mutability": "mutable",
"name": "beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10761:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 553,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10761:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 557,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 555,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "10791:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 556,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10791:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10761:40:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"id": 563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 558,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 472,
"src": "10816:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 561,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10840:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 560,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10832:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 559,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10832:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 562,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10832:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10816:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 568,
"nodeType": "IfStatement",
"src": "10812:71:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 566,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 564,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "10857:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 565,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 472,
"src": "10871:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10857:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 567,
"nodeType": "ExpressionStatement",
"src": "10857:26:0"
}
},
{
"assignments": [
572
],
"declarations": [
{
"constant": false,
"id": 572,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10945:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 570,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "10945:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 571,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10945:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 578,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 574,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10997:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 575,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "11004:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 576,
"name": "affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 516,
"src": "11017:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 573,
"name": "createConversionData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1468,
"src": "10976:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_address_$dyn_memory_ptr_$_t_address_payable_$_t_bool_$returns$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$",
"typeString": "function (address[] memory,address payable,bool) view returns (struct BancorNetwork.ConversionStep memory[] memory)"
}
},
"id": 577,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10976:61:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10945:92:0"
},
{
"assignments": [
580
],
"declarations": [
{
"constant": false,
"id": 580,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "11048:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 579,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11048:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 588,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 582,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 572,
"src": "11078:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
{
"argumentTypes": null,
"id": 583,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 468,
"src": "11084:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 584,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 470,
"src": "11093:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 585,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 474,
"src": "11105:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 586,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "11124:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 581,
"name": "doConversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 998,
"src": "11065:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (struct BancorNetwork.ConversionStep memory[] memory,uint256,uint256,address,uint256) returns (uint256)"
}
},
"id": 587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11065:73:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11048:90:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 590,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 572,
"src": "11217:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
{
"argumentTypes": null,
"id": 591,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "11223:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 592,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "11231:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 589,
"name": "handleTargetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1174,
"src": "11199:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$_t_uint256_$_t_address_payable_$returns$__$",
"typeString": "function (struct BancorNetwork.ConversionStep memory[] memory,uint256,address payable)"
}
},
"id": 593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11199:44:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 594,
"nodeType": "ExpressionStatement",
"src": "11199:44:0"
},
{
"expression": {
"argumentTypes": null,
"id": 595,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "11263:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 485,
"id": 596,
"nodeType": "Return",
"src": "11256:13:0"
}
]
},
"documentation": {
"id": 463,
"nodeType": "StructuredDocumentation",
"src": "8452:1150:0",
"text": " @dev converts the token to any other token in the bancor network by following\n a predefined conversion path and transfers the result tokens to a target account\n affiliate account/fee can also be passed in to receive a conversion fee (on top of the liquidity provider fees)\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _beneficiary account that will receive the conversion result or 0x0 to send the result to the sender account\n @param _affiliateAccount wallet address to receive the affiliate fee or 0x0 to disable affiliate fee\n @param _affiliateFee affiliate fee in PPM or 0 to disable affiliate fee\n @return amount of tokens received from the conversion"
},
"functionSelector": "b77d239b",
"id": 598,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 479,
"modifierName": {
"argumentTypes": null,
"id": 478,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "9869:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9869:9:0"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 481,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 470,
"src": "9904:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 482,
"modifierName": {
"argumentTypes": null,
"id": 480,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "9888:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "9888:27:0"
}
],
"name": "convertByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 477,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 466,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9641:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 464,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9641:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 465,
"length": null,
"nodeType": "ArrayTypeName",
"src": "9641:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 468,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9674:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 467,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9674:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 470,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9700:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 469,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9700:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 472,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9729:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 471,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9729:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 474,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9768:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 473,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9768:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 476,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9804:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 475,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9804:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9630:196:0"
},
"returnParameters": {
"id": 485,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 484,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9934:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 483,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9933:9:0"
},
"scope": 1976,
"src": "9608:1669:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 631,
"nodeType": "Block",
"src": "12548:128:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 618,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 602,
"src": "12576:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 619,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 604,
"src": "12583:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 620,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 606,
"src": "12592:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 621,
"name": "_targetBlockchain",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 608,
"src": "12604:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 622,
"name": "_targetAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 610,
"src": "12623:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 623,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 612,
"src": "12639:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 626,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12662:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 625,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "12654:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 624,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12654:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12654:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 628,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12666:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 617,
"name": "xConvert2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 726,
"src": "12566:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,bytes32,bytes32,uint256,address,uint256) returns (uint256)"
}
},
"id": 629,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12566:102:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 616,
"id": 630,
"nodeType": "Return",
"src": "12559:109:0"
}
]
},
"documentation": {
"id": 599,
"nodeType": "StructuredDocumentation",
"src": "11285:978:0",
"text": " @dev converts any other token to BNT in the bancor network by following\na predefined conversion path and transfers the result to an account on a different blockchain\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _targetBlockchain blockchain BNT will be issued on\n @param _targetAccount address/account on the target blockchain to send the BNT to\n @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\n @return the amount of BNT received from this conversion"
},
"functionSelector": "c52173de",
"id": 632,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "xConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 613,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 602,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12297:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 600,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12297:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 601,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12297:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 604,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12330:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 603,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12330:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 606,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12356:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 605,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12356:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 608,
"mutability": "mutable",
"name": "_targetBlockchain",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12385:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 607,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "12385:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 610,
"mutability": "mutable",
"name": "_targetAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12421:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 609,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "12421:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 612,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12454:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 611,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12454:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12286:196:0"
},
"returnParameters": {
"id": 616,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 615,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12534:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 614,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12534:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12533:9:0"
},
"scope": 1976,
"src": "12269:407:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 725,
"nodeType": "Block",
"src": "14166:739:0",
"statements": [
{
"assignments": [
659
],
"declarations": [
{
"constant": false,
"id": 659,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14177:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 658,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "14177:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 668,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 661,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14215:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 666,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 662,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14221:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14221:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 664,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14236:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "14221:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14215:23:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 660,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "14203:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 667,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14203:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14177:62:0"
},
{
"assignments": [
670
],
"declarations": [
{
"constant": false,
"id": 670,
"mutability": "mutable",
"name": "bancorX",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14250:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
},
"typeName": {
"contractScope": null,
"id": 669,
"name": "IBancorX",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3551,
"src": "14250:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 676,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 673,
"name": "BANCOR_X",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21554,
"src": "14288:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 672,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14278:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 674,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14278:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 671,
"name": "IBancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3551,
"src": "14269:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorX_$3551_$",
"typeString": "type(contract IBancorX)"
}
},
"id": 675,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14269:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14250:48:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 684,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 678,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 659,
"src": "14372:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 681,
"name": "BNT_TOKEN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21551,
"src": "14409:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 680,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14399:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 682,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14399:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 679,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "14387:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 683,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14387:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "14372:48:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f5441524745545f544f4b454e",
"id": 685,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14422:26:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_506dba30f9da1ed4da3626f556faadafab0575131908ae8223c813a59e0707f3",
"typeString": "literal_string \"ERR_INVALID_TARGET_TOKEN\""
},
"value": "ERR_INVALID_TARGET_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_506dba30f9da1ed4da3626f556faadafab0575131908ae8223c813a59e0707f3",
"typeString": "literal_string \"ERR_INVALID_TARGET_TOKEN\""
}
],
"id": 677,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "14364:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14364:85:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 687,
"nodeType": "ExpressionStatement",
"src": "14364:85:0"
},
{
"assignments": [
689
],
"declarations": [
{
"constant": false,
"id": 689,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14511:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 688,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14511:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 704,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 691,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14542:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 692,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 638,
"src": "14549:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 693,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 640,
"src": "14558:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 698,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "14586:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 697,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14578:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 696,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14578:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 699,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14578:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 695,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14570:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 694,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14570:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 700,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14570:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 701,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 648,
"src": "14594:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 702,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 650,
"src": "14613:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 690,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "14528:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 703,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14528:99:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14511:116:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 706,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 659,
"src": "14692:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 709,
"name": "bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 670,
"src": "14713:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
],
"id": 708,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14705:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 707,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14705:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 710,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14705:16:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 711,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14723:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 705,
"name": "ensureAllowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1511,
"src": "14676:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14676:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 713,
"nodeType": "ExpressionStatement",
"src": "14676:54:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 717,
"name": "_targetBlockchain",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 642,
"src": "14814:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 718,
"name": "_targetAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 644,
"src": "14833:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 719,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14849:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 720,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 646,
"src": "14857:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 714,
"name": "bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 670,
"src": "14796:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 716,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "xTransfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 3541,
"src": "14796:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (bytes32,bytes32,uint256,uint256) external"
}
},
"id": 721,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14796:75:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 722,
"nodeType": "ExpressionStatement",
"src": "14796:75:0"
},
{
"expression": {
"argumentTypes": null,
"id": 723,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14891:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 657,
"id": 724,
"nodeType": "Return",
"src": "14884:13:0"
}
]
},
"documentation": {
"id": 633,
"nodeType": "StructuredDocumentation",
"src": "12684:1091:0",
"text": " @dev converts any other token to BNT in the bancor network by following\na predefined conversion path and transfers the result to an account on a different blockchain\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _targetBlockchain blockchain BNT will be issued on\n @param _targetAccount address/account on the target blockchain to send the BNT to\n @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\n @param _affiliateAccount affiliate account\n @param _affiliateFee affiliate fee in PPM\n @return the amount of BNT received from this conversion"
},
"functionSelector": "cb32564e",
"id": 726,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 653,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 640,
"src": "14122:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 654,
"modifierName": {
"argumentTypes": null,
"id": 652,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "14106:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "14106:27:0"
}
],
"name": "xConvert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 651,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 636,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13810:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 634,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13810:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 635,
"length": null,
"nodeType": "ArrayTypeName",
"src": "13810:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 638,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13843:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 637,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13843:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 640,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13869:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 639,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13869:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 642,
"mutability": "mutable",
"name": "_targetBlockchain",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13898:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 641,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "13898:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 644,
"mutability": "mutable",
"name": "_targetAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13934:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 643,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "13934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 646,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13967:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 648,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13999:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 647,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13999:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 650,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "14035:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 649,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14035:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13799:264:0"
},
"returnParameters": {
"id": 657,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 656,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "14152:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 655,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "14151:9:0"
},
"scope": 1976,
"src": "13781:1124:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 777,
"nodeType": "Block",
"src": "16040:423:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 745,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 730,
"src": "16133:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 747,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 746,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16139:1:0",
"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": "16133:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 744,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "16121:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16121:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 749,
"name": "_bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 732,
"src": "16146:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 750,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "token",
"nodeType": "MemberAccess",
"referencedDeclaration": 3530,
"src": "16146:14:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function () view external returns (contract IERC20Token)"
}
},
"id": 751,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16146:16:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "16121:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f534f555243455f544f4b454e",
"id": 753,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16164:26:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0f690a2bdb8b25e0198ca38056ef0e9f045e379ec977ffdcb1486f3c53b6e8fa",
"typeString": "literal_string \"ERR_INVALID_SOURCE_TOKEN\""
},
"value": "ERR_INVALID_SOURCE_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_0f690a2bdb8b25e0198ca38056ef0e9f045e379ec977ffdcb1486f3c53b6e8fa",
"typeString": "literal_string \"ERR_INVALID_SOURCE_TOKEN\""
}
],
"id": 743,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "16113:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 754,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16113:78:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 755,
"nodeType": "ExpressionStatement",
"src": "16113:78:0"
},
{
"assignments": [
757
],
"declarations": [
{
"constant": false,
"id": 757,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 777,
"src": "16260:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 756,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16260:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 764,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 760,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 734,
"src": "16305:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 761,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "16320:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16320:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 758,
"name": "_bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 732,
"src": "16277:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 759,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getXTransferAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 3550,
"src": "16277:27:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_address_$returns$_t_uint256_$",
"typeString": "function (uint256,address) view external returns (uint256)"
}
},
"id": 763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16277:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "16260:71:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 766,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 730,
"src": "16400:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 767,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "16407:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 768,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 736,
"src": "16415:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 769,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 738,
"src": "16427:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 772,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16449:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "16441:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 770,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "16441:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 773,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16441:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 774,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16453:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 765,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "16386:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16386:69:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 742,
"id": 776,
"nodeType": "Return",
"src": "16379:76:0"
}
]
},
"documentation": {
"id": 727,
"nodeType": "StructuredDocumentation",
"src": "14913:937:0",
"text": " @dev allows a user to convert a token that was sent from another blockchain into any other\n token on the BancorNetwork\n ideally this transaction is created before the previous conversion is even complete, so\n so the input amount isn't known at that point - the amount is actually take from the\n BancorX contract directly by specifying the conversion id\n @param _path conversion path\n @param _bancorX address of the BancorX contract for the source token\n @param _conversionId pre-determined unique (if non zero) id which refers to this conversion\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received from the conversion"
},
"functionSelector": "89f9cc61",
"id": 778,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "completeXConversion",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 730,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15885:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 728,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15885:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 729,
"length": null,
"nodeType": "ArrayTypeName",
"src": "15885:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 732,
"mutability": "mutable",
"name": "_bancorX",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15909:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
},
"typeName": {
"contractScope": null,
"id": 731,
"name": "IBancorX",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3551,
"src": "15909:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 734,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15928:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 733,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15928:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 736,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15951:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 735,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15951:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 738,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15971:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 737,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15971:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "15884:116:0"
},
"returnParameters": {
"id": 742,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 741,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "16026:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 740,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16026:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16025:9:0"
},
"scope": 1976,
"src": "15856:607:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 997,
"nodeType": "Block",
"src": "17298:2483:0",
"statements": [
{
"assignments": [
796
],
"declarations": [
{
"constant": false,
"id": 796,
"mutability": "mutable",
"name": "toAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 997,
"src": "17309:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 795,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17309:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 797,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "17309:16:0"
},
{
"assignments": [
799
],
"declarations": [
{
"constant": false,
"id": 799,
"mutability": "mutable",
"name": "fromAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 997,
"src": "17336:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 798,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17336:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 801,
"initialValue": {
"argumentTypes": null,
"id": 800,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 784,
"src": "17357:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17336:28:0"
},
{
"body": {
"id": 986,
"nodeType": "Block",
"src": "17465:2151:0",
"statements": [
{
"assignments": [
814
],
"declarations": [
{
"constant": false,
"id": 814,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 986,
"src": "17480:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 813,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "17480:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 818,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 815,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17513:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 817,
"indexExpression": {
"argumentTypes": null,
"id": 816,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17519:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17513:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17480:41:0"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 819,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17574:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 820,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "17574:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 864,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 855,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18191:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 856,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18191:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 860,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18235:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 861,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "anchor",
"nodeType": "MemberAccess",
"referencedDeclaration": 48,
"src": "18235:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 859,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18227:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 858,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18227:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 862,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18227:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 857,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "18215:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 863,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18215:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "18191:61:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 877,
"nodeType": "IfStatement",
"src": "18187:272:0",
"trueBody": {
"id": 876,
"nodeType": "Block",
"src": "18254:205:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 866,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18381:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 867,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18381:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 870,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18411:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 871,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18411:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 869,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18403:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 868,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18403:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 872,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18403:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 873,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18432:10:0",
"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": 865,
"name": "ensureAllowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1511,
"src": "18365:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18365:78:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 875,
"nodeType": "ExpressionStatement",
"src": "18365:78:0"
}
]
}
},
"id": 878,
"nodeType": "IfStatement",
"src": "17570:889:0",
"trueBody": {
"id": 854,
"nodeType": "Block",
"src": "17607:416:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 841,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 835,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 823,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 821,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17820:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17825:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "17820:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 824,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17830:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 828,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 827,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 825,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17836:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 826,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17840:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "17836:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17830:12:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 829,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "17830:24:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 832,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "17866:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 831,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17858:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 830,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17858:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17858:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "17830:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "17820:51:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "17875:34:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 836,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "17876:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 839,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 837,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17888:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 838,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "17888:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17876:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "17820:89:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 853,
"nodeType": "IfStatement",
"src": "17816:191:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 843,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17945:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 844,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "17945:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 847,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17975:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 848,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "17975:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 846,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 845,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17967:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 849,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17967:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 850,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "17996:10:0",
"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": 842,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "17932:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 851,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17932:75:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 852,
"nodeType": "ExpressionStatement",
"src": "17932:75:0"
}
}
]
}
},
{
"condition": {
"argumentTypes": null,
"id": 881,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "18513:32:0",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 879,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18514:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 880,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "18514:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 900,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "18710:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 903,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 901,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18722:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 902,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18722:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18710:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 937,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 923,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18946:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 927,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18984:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 928,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18984:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 929,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19006:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 930,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19006:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 931,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19028:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 932,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "19040:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 933,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "19040:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 934,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19052:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 935,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "19052:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 924,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18957:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 925,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18957:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 926,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "convert",
"nodeType": "MemberAccess",
"referencedDeclaration": 13228,
"src": "18957:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18957:116:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18946:127:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 938,
"nodeType": "ExpressionStatement",
"src": "18946:127:0"
},
"id": 939,
"nodeType": "IfStatement",
"src": "18706:367:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 921,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 904,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18762:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 911,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18820:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 912,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18820:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 913,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18842:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 914,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "18842:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 915,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18864:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 916,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "18876:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 917,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18876:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 918,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18888:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 919,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "18888:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 905,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18773:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 906,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18773:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 907,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "convert",
"nodeType": "MemberAccess",
"referencedDeclaration": 13228,
"src": "18773:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 910,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"value"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 908,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "18808:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 909,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18808:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"src": "18773:46:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$value",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 920,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18773:136:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18762:147:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 922,
"nodeType": "ExpressionStatement",
"src": "18762:147:0"
}
},
"id": 940,
"nodeType": "IfStatement",
"src": "18509:564:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 898,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 882,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18564:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 891,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18628:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 892,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18628:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 893,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18650:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 894,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "18650:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 895,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18672:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "31",
"id": 896,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18684:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 886,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18600:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 887,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18600:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 885,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18592:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 884,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18592:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 888,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18592:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 883,
"name": "ILegacyConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "18575:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ILegacyConverter_$26_$",
"typeString": "type(contract ILegacyConverter)"
}
},
"id": 889,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18575:45:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ILegacyConverter_$26",
"typeString": "contract ILegacyConverter"
}
},
"id": 890,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "change",
"nodeType": "MemberAccess",
"referencedDeclaration": 25,
"src": "18575:52:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256) external returns (uint256)"
}
},
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18575:111:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18564:122:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 899,
"nodeType": "ExpressionStatement",
"src": "18564:122:0"
}
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 941,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19138:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 942,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "processAffiliateFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 58,
"src": "19138:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 968,
"nodeType": "IfStatement",
"src": "19134:308:0",
"trueBody": {
"id": 967,
"nodeType": "Block",
"src": "19168:274:0",
"statements": [
{
"assignments": [
944
],
"declarations": [
{
"constant": false,
"id": 944,
"mutability": "mutable",
"name": "affiliateAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 967,
"src": "19187:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 943,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19187:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 952,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 950,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "19245:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 947,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 790,
"src": "19226:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 945,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19213:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 946,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "19213:12:0",
"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": 948,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19213:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 949,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "19213:31:0",
"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": 951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19213:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19187:73:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 957,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 788,
"src": "19317:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 958,
"name": "affiliateAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 944,
"src": "19336:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 954,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19287:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 955,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19287:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 21106,
"src": "19287:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19287:65:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4645455f5452414e534645525f4641494c4544",
"id": 960,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19354:25:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_adc6d664872bc68defa0e975019744f9c0f552331af13f5f130791cee181d10c",
"typeString": "literal_string \"ERR_FEE_TRANSFER_FAILED\""
},
"value": "ERR_FEE_TRANSFER_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_adc6d664872bc68defa0e975019744f9c0f552331af13f5f130791cee181d10c",
"typeString": "literal_string \"ERR_FEE_TRANSFER_FAILED\""
}
],
"id": 953,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "19279:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19279:101:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 962,
"nodeType": "ExpressionStatement",
"src": "19279:101:0"
},
{
"expression": {
"argumentTypes": null,
"id": 965,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 963,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19399:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 964,
"name": "affiliateAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 944,
"src": "19411:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19399:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 966,
"nodeType": "ExpressionStatement",
"src": "19399:27:0"
}
]
}
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 970,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19474:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 971,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "anchor",
"nodeType": "MemberAccess",
"referencedDeclaration": 48,
"src": "19474:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 972,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19491:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 973,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "19491:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 974,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19513:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 975,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19513:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 976,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19535:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 977,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19547:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 978,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "19557:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 979,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "19557:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 969,
"name": "Conversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 81,
"src": "19463:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IConverterAnchor_$13349_$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$_t_address_$returns$__$",
"typeString": "function (contract IConverterAnchor,contract IERC20Token,contract IERC20Token,uint256,uint256,address)"
}
},
"id": 980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19463:105:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 981,
"nodeType": "EmitStatement",
"src": "19458:110:0"
},
{
"expression": {
"argumentTypes": null,
"id": 984,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 982,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19583:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 983,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19596:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19583:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 985,
"nodeType": "ExpressionStatement",
"src": "19583:21:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 806,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17442:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 807,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17446:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 808,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17446:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "17442:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 987,
"initializationExpression": {
"assignments": [
803
],
"declarations": [
{
"constant": false,
"id": 803,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 987,
"src": "17427:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 802,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17427:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 805,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 804,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17439:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "17427:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "17460:3:0",
"subExpression": {
"argumentTypes": null,
"id": 810,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17460:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 812,
"nodeType": "ExpressionStatement",
"src": "17460:3:0"
},
"nodeType": "ForStatement",
"src": "17422:2194:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 991,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 989,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19700:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 990,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 786,
"src": "19712:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19700:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f52455455524e5f544f4f5f4c4f57",
"id": 992,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19724:20:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
},
"value": "ERR_RETURN_TOO_LOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
}
],
"id": 988,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "19692:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 993,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19692:53:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 994,
"nodeType": "ExpressionStatement",
"src": "19692:53:0"
},
{
"expression": {
"argumentTypes": null,
"id": 995,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19765:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 794,
"id": 996,
"nodeType": "Return",
"src": "19758:15:0"
}
]
},
"documentation": {
"id": 779,
"nodeType": "StructuredDocumentation",
"src": "16471:603:0",
"text": " @dev executes the actual conversion by following the conversion path\n @param _data conversion data, see ConversionStep struct above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _affiliateAccount affiliate account\n @param _affiliateFee affiliate fee in PPM\n @return amount of tokens received from the conversion"
},
"id": 998,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConversion",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 791,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 782,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17112:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 780,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "17112:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 781,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17112:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 784,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17152:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 783,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 786,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17178:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 785,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17178:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 788,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17207:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 787,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17207:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 790,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17243:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 789,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17243:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17101:170:0"
},
"returnParameters": {
"id": 794,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 793,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17289:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 792,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17289:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17288:9:0"
},
"scope": 1976,
"src": "17080:2701:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1109,
"nodeType": "Block",
"src": "20232:1606:0",
"statements": [
{
"assignments": [
1009
],
"declarations": [
{
"constant": false,
"id": 1009,
"mutability": "mutable",
"name": "firstConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1109,
"src": "20243:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1008,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "20243:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1018,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1013,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1003,
"src": "20290:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 1014,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "20290:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 1015,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20290:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1012,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20282:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1011,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20282:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1016,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20282:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 1010,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "20271:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 1017,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20271:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20243:64:0"
},
{
"assignments": [
1020
],
"declarations": [
{
"constant": false,
"id": 1020,
"mutability": "mutable",
"name": "isNewerConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1109,
"src": "20318:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1019,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "20318:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1024,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1022,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "20365:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1021,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "20342:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1023,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20342:38:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20318:62:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1028,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1025,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20413:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1026,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20413:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1027,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20425:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "20413:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1055,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "20955:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1057,
"indexExpression": {
"argumentTypes": null,
"id": 1056,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "20967:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20955:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1106,
"nodeType": "Block",
"src": "21447:384:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1082,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "21605:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1095,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21770:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1096,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21784:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1097,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21784:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1100,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "21804:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1099,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21796:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1098,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21796:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21796:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1102,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21811:7:0",
"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_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1094,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21753:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21753:66:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1104,
"nodeType": "ExpressionStatement",
"src": "21753:66:0"
},
"id": 1105,
"nodeType": "IfStatement",
"src": "21601:218:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1084,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21657:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21671:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1086,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21671:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1089,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "21691:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1088,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21683:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1087,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21683:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1090,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21683:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1091,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21708:7:0",
"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_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1083,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21640:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21640:76:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1093,
"nodeType": "ExpressionStatement",
"src": "21640:76:0"
}
}
]
},
"id": 1107,
"nodeType": "IfStatement",
"src": "20951:880:0",
"trueBody": {
"id": 1081,
"nodeType": "Block",
"src": "20982:420:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1059,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21184:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1060,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21198:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21198:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1064,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "21218:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1063,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21210:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1062,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21210:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1065,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21210:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1066,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21225:7:0",
"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_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1058,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21167:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1067,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21167:66:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1068,
"nodeType": "ExpressionStatement",
"src": "21167:66:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1069,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "21303:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1080,
"nodeType": "IfStatement",
"src": "21299:91:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1077,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21382:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1073,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21358:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1072,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21350:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1071,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21350:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1074,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21350:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1070,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "21338:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1075,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21338:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1076,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdraw",
"nodeType": "MemberAccess",
"referencedDeclaration": 21140,
"src": "21338:43:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21338:52:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1079,
"nodeType": "ExpressionStatement",
"src": "21338:52:0"
}
}
]
}
},
"id": 1108,
"nodeType": "IfStatement",
"src": "20409:1422:0",
"trueBody": {
"id": 1054,
"nodeType": "Block",
"src": "20428:485:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1033,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1030,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20486:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1031,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20486:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1032,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "20499:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20486:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 1034,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20508:25:0",
"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": 1029,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "20478:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 1035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20478:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1036,
"nodeType": "ExpressionStatement",
"src": "20478:56:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "20768:17:0",
"subExpression": {
"argumentTypes": null,
"id": 1037,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "20769:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1053,
"nodeType": "IfStatement",
"src": "20764:137:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1043,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "20854:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1042,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "20824:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1044,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20824:45:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1041,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20816:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1040,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20816:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1045,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20816:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1039,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "20804:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1046,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20804:67:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1047,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "deposit",
"nodeType": "MemberAccess",
"referencedDeclaration": 21135,
"src": "20804:75:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$__$returns$__$",
"typeString": "function () payable external"
}
},
"id": 1050,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"value"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1048,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20888:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1049,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20888:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"src": "20804:95:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$__$returns$__$value",
"typeString": "function () payable external"
}
},
"id": 1051,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20804:97:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1052,
"nodeType": "ExpressionStatement",
"src": "20804:97:0"
}
}
]
}
}
]
},
"documentation": {
"id": 999,
"nodeType": "StructuredDocumentation",
"src": "19789:333:0",
"text": " @dev validates msg.value and prepares the conversion source token for the conversion\n @param _sourceToken source token of the first conversion step\n @param _anchor converter anchor of the first conversion step\n @param _amount amount to convert from, in the source token"
},
"id": 1110,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "handleSourceToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1006,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1001,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20155:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1000,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "20155:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1003,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20181:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 1002,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "20181:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1005,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20207:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1004,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20207:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20154:69:0"
},
"returnParameters": {
"id": 1007,
"nodeType": "ParameterList",
"parameters": [],
"src": "20232:0:0"
},
"scope": 1976,
"src": "20128:1710:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1173,
"nodeType": "Block",
"src": "22295:780:0",
"statements": [
{
"assignments": [
1122
],
"declarations": [
{
"constant": false,
"id": 1122,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1173,
"src": "22306:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 1121,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "22306:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1129,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1123,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1114,
"src": "22339:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1128,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1124,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1114,
"src": "22345:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1125,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "22345:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22360:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "22345:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22339:23:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22306:56:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1130,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22444:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1131,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "22444:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1134,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "22476:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1133,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "22468:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1132,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22468:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1135,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22468:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "22444:37:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1138,
"nodeType": "IfStatement",
"src": "22440:63:0",
"trueBody": {
"expression": null,
"functionReturnParameters": 1120,
"id": 1137,
"nodeType": "Return",
"src": "22496:7:0"
}
},
{
"assignments": [
1140
],
"declarations": [
{
"constant": false,
"id": 1140,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1173,
"src": "22515:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1139,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22515:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1143,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1141,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22541:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1142,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "22541:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22515:46:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1144,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "22607:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1146,
"indexExpression": {
"argumentTypes": null,
"id": 1145,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "22619:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22607:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1171,
"nodeType": "Block",
"src": "22993:75:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1166,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "23021:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1167,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1118,
"src": "23034:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1168,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1116,
"src": "23048:7:0",
"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": 1165,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "23008:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23008:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1170,
"nodeType": "ExpressionStatement",
"src": "23008:48:0"
}
]
},
"id": 1172,
"nodeType": "IfStatement",
"src": "22603:465:0",
"trueBody": {
"id": 1164,
"nodeType": "Block",
"src": "22633:315:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "22731:32:0",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1148,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22732:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1149,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "22732:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1147,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "22724:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1151,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22724:40:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1152,
"nodeType": "ExpressionStatement",
"src": "22724:40:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1160,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1118,
"src": "22914:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1161,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1116,
"src": "22928:7:0",
"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": 1156,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "22889:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1155,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "22881:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1154,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22881:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22881:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1153,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "22869:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22869:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTo",
"nodeType": "MemberAccess",
"referencedDeclaration": 21152,
"src": "22869:44:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_payable_$_t_uint256_$returns$__$",
"typeString": "function (address payable,uint256) external"
}
},
"id": 1162,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22869:67:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1163,
"nodeType": "ExpressionStatement",
"src": "22869:67:0"
}
]
}
}
]
},
"documentation": {
"id": 1111,
"nodeType": "StructuredDocumentation",
"src": "21846:330:0",
"text": " @dev handles the conversion target token if the network still holds it at the end of the conversion\n @param _data conversion data, see ConversionStep struct above\n @param _amount conversion target amount\n @param _beneficiary wallet to receive the conversion result"
},
"id": 1174,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "handleTargetToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1119,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1114,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22209:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1112,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "22209:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1113,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22209:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1116,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22240:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1115,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22240:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1118,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22257:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1117,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22257:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22208:78:0"
},
"returnParameters": {
"id": 1120,
"nodeType": "ParameterList",
"parameters": [],
"src": "22295:0:0"
},
"scope": 1976,
"src": "22182:893:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1467,
"nodeType": "Block",
"src": "23760:4093:0",
"statements": [
{
"assignments": [
1191
],
"declarations": [
{
"constant": false,
"id": 1191,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23771:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1189,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23771:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1190,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23771:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1200,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1195,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "23823:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23823:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1197,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23848:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "23823:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1194,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "23802:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (struct BancorNetwork.ConversionStep memory[] memory)"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1192,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23806:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1193,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23806:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
}
},
"id": 1199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23802:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23771:79:0"
},
{
"assignments": [
1202
],
"declarations": [
{
"constant": false,
"id": 1202,
"mutability": "mutable",
"name": "affiliateFeeProcessed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23863:26:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1201,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "23863:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1204,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1203,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23892:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "23863:34:0"
},
{
"assignments": [
1206
],
"declarations": [
{
"constant": false,
"id": 1206,
"mutability": "mutable",
"name": "bntToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23908:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1205,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23908:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1212,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1209,
"name": "BNT_TOKEN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21551,
"src": "23953:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1208,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "23943:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 1210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23943:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1207,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "23931:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23931:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23908:56:0"
},
{
"assignments": [
1214
],
"declarations": [
{
"constant": false,
"id": 1214,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "24060:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1213,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24060:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1215,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "24060:9:0"
},
{
"body": {
"id": 1303,
"nodeType": "Block",
"src": "24132:1199:0",
"statements": [
{
"assignments": [
1231
],
"declarations": [
{
"constant": false,
"id": 1231,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24147:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 1230,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "24147:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1239,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1233,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24190:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1237,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1236,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1234,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24206:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1235,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24210:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "24206:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24190:22:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1232,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "24173:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 1238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24173:40:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24147:66:0"
},
{
"assignments": [
1241
],
"declarations": [
{
"constant": false,
"id": 1241,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24228:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1240,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "24228:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1250,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1245,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1231,
"src": "24270:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 1246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "24270:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 1247,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24270:14:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1244,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "24262:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1243,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "24262:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24262:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 1242,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "24251:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 1249,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24251:35:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24228:58:0"
},
{
"assignments": [
1252
],
"declarations": [
{
"constant": false,
"id": 1252,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24301:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1251,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "24301:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1260,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1254,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24339:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1258,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1257,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1255,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24355:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1256,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24359:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24355:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24339:22:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1253,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "24327:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24327:35:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24301:61:0"
},
{
"assignments": [
1262
],
"declarations": [
{
"constant": false,
"id": 1262,
"mutability": "mutable",
"name": "processAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24455:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1261,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "24455:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1271,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1270,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1263,
"name": "_affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1182,
"src": "24482:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1265,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "24506:22:0",
"subExpression": {
"argumentTypes": null,
"id": 1264,
"name": "affiliateFeeProcessed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1202,
"src": "24507:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "24482:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 1269,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1267,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1252,
"src": "24532:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1268,
"name": "bntToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1206,
"src": "24547:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "24532:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "24482:73:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24455:100:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1272,
"name": "processAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1262,
"src": "24574:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1277,
"nodeType": "IfStatement",
"src": "24570:70:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1273,
"name": "affiliateFeeProcessed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1202,
"src": "24612:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1274,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24636:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "24612:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1276,
"nodeType": "ExpressionStatement",
"src": "24612:28:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 1301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1278,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "24657:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1282,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1281,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1279,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24662:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1280,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24666:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24662:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "24657:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1284,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1231,
"src": "24758:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"id": 1285,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1241,
"src": "24834:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1287,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24938:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1289,
"indexExpression": {
"argumentTypes": null,
"id": 1288,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24954:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24938:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1286,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "24926:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1290,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24926:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1291,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1252,
"src": "24989:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1294,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25134:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1293,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "25126:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1292,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "25126:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1295,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25126:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1297,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1241,
"src": "25234:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1296,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "25211:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25211:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"id": 1299,
"name": "processAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1262,
"src": "25284:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1283,
"name": "ConversionStep",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "24671:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_ConversionStep_$59_storage_ptr_$",
"typeString": "type(struct BancorNetwork.ConversionStep storage pointer)"
}
},
"id": 1300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"anchor",
"converter",
"sourceToken",
"targetToken",
"beneficiary",
"isV28OrHigherConverter",
"processAffiliateFee"
],
"nodeType": "FunctionCall",
"src": "24671:648:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "24657:662:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1302,
"nodeType": "ExpressionStatement",
"src": "24657:662:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1220,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24092:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1221,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24096:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "24096:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1223,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24121:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "24096:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "24092:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1304,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 1218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1216,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24085:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 1217,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24089:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "24085:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1219,
"nodeType": "ExpressionStatement",
"src": "24085:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1228,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1226,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24124:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "32",
"id": 1227,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24129:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24124:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1229,
"nodeType": "ExpressionStatement",
"src": "24124:6:0"
},
"nodeType": "ForStatement",
"src": "24080:1251:0"
},
{
"assignments": [
1306
],
"declarations": [
{
"constant": false,
"id": 1306,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "25393:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 1305,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "25393:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1310,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1307,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25426:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1309,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1308,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25431:1:0",
"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": "25426:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25393:40:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1311,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "25448:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1314,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1312,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25460:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1313,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25460:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25448:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1334,
"nodeType": "IfStatement",
"src": "25444:472:0",
"trueBody": {
"id": 1333,
"nodeType": "Block",
"src": "25483:433:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1315,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25594:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1316,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "25594:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1330,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1323,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25832:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1325,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25832:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1327,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25885:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1328,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "25885:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1326,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "25855:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25855:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "25832:72:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1331,
"nodeType": "ExpressionStatement",
"src": "25832:72:0"
},
"id": 1332,
"nodeType": "IfStatement",
"src": "25590:314:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1321,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1317,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25644:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1319,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25644:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1320,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "25667:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "25644:42:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1322,
"nodeType": "ExpressionStatement",
"src": "25644:42:0"
}
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1335,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25954:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1336,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25965:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1341,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1340,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1337,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25970:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1338,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25970:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1339,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25984:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "25970:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25965:21:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "25954:32:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1343,
"nodeType": "ExpressionStatement",
"src": "25954:32:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1344,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "26001:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1347,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1345,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26013:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1346,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26013:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26001:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1367,
"nodeType": "IfStatement",
"src": "25997:472:0",
"trueBody": {
"id": 1366,
"nodeType": "Block",
"src": "26036:433:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1348,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26147:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1349,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "26147:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1363,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1356,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26385:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1358,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26385:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1360,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26438:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1361,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "26438:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1359,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "26408:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26408:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "26385:72:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1364,
"nodeType": "ExpressionStatement",
"src": "26385:72:0"
},
"id": 1365,
"nodeType": "IfStatement",
"src": "26143:314:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1350,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26197:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1352,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26197:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1353,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "26220:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "26197:42:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1355,
"nodeType": "ExpressionStatement",
"src": "26197:42:0"
}
}
]
}
},
{
"body": {
"id": 1463,
"nodeType": "Block",
"src": "26561:1261:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1379,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26576:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1380,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "26587:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1382,
"indexExpression": {
"argumentTypes": null,
"id": 1381,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26592:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26587:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "26576:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1384,
"nodeType": "ExpressionStatement",
"src": "26576:18:0"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1385,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26746:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1386,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "26746:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1461,
"nodeType": "Block",
"src": "27642:169:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1459,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1449,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27750:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1451,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27750:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1456,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "27789:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1455,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27781:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1454,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27781:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1457,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27781:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1453,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27773:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1452,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27773:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1458,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27773:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27750:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1460,
"nodeType": "ExpressionStatement",
"src": "27750:45:0"
}
]
},
"id": 1462,
"nodeType": "IfStatement",
"src": "26742:1069:0",
"trueBody": {
"id": 1448,
"nodeType": "Block",
"src": "26779:844:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1387,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26902:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1388,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "processAffiliateFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 58,
"src": "26902:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1401,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27106:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1402,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27111:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1403,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27111:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1404,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27125:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27111:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27106:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1413,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27310:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1417,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1416,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1414,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27315:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1415,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27319:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27315:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27310:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1418,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "27310:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1443,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1433,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27562:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1435,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27562:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1440,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "27601:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27593:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1438,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27593:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1441,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27593:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1437,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27585:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1436,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27585:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27585:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27562:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1444,
"nodeType": "ExpressionStatement",
"src": "27562:45:0"
},
"id": 1445,
"nodeType": "IfStatement",
"src": "27306:301:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1419,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27367:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1421,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27367:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1424,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27398:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1428,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1427,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1425,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27403:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1426,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27407:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27403:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27398:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1429,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "27398:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1423,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27390:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1422,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27390:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1430,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27390:30:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27367:53:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1432,
"nodeType": "ExpressionStatement",
"src": "27367:53:0"
}
},
"id": 1446,
"nodeType": "IfStatement",
"src": "27102:505:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1407,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27149:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1409,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27149:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1410,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1180,
"src": "27172:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27149:35:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1412,
"nodeType": "ExpressionStatement",
"src": "27149:35:0"
}
},
"id": 1447,
"nodeType": "IfStatement",
"src": "26898:709:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1389,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26953:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1391,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "26953:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1396,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "26992:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1395,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26984:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1394,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26984:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1397,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26984:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1393,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26976:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1392,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26976:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26976:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "26953:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1400,
"nodeType": "ExpressionStatement",
"src": "26953:45:0"
}
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1375,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1372,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26539:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1373,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "26543:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1374,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26543:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26539:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1464,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 1370,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1368,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26532:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 1369,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "26536:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "26532:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1371,
"nodeType": "ExpressionStatement",
"src": "26532:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1377,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "26556:3:0",
"subExpression": {
"argumentTypes": null,
"id": 1376,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26556:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1378,
"nodeType": "ExpressionStatement",
"src": "26556:3:0"
},
"nodeType": "ForStatement",
"src": "26527:1295:0"
},
{
"expression": {
"argumentTypes": null,
"id": 1465,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27841:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"functionReturnParameters": 1187,
"id": 1466,
"nodeType": "Return",
"src": "27834:11:0"
}
]
},
"documentation": {
"id": 1175,
"nodeType": "StructuredDocumentation",
"src": "23083:503:0",
"text": " @dev creates a memory cache of all conversion steps data to minimize logic and external calls during conversions\n @param _conversionPath conversion path, see conversion path format above\n @param _beneficiary wallet to receive the conversion result\n @param _affiliateFeeEnabled true if affiliate fee was requested by the sender, false if not\n @return cached conversion data to be ingested later on by the conversion flow"
},
"id": 1468,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "createConversionData",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1183,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1178,
"mutability": "mutable",
"name": "_conversionPath",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23622:32:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1176,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23622:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1177,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23622:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1180,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23656:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1179,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23656:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1182,
"mutability": "mutable",
"name": "_affiliateFeeEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23686:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1181,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "23686:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23621:91:0"
},
"returnParameters": {
"id": 1187,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1186,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23735:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1184,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23735:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1185,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23735:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23734:25:0"
},
"scope": 1976,
"src": "23592:4261:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1510,
"nodeType": "Block",
"src": "28406:261:0",
"statements": [
{
"assignments": [
1479
],
"declarations": [
{
"constant": false,
"id": 1479,
"mutability": "mutable",
"name": "allowance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1510,
"src": "28417:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1478,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28417:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1488,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1484,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "28462:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1483,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "28454:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1482,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "28454:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1485,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28454:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1486,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28469:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1480,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28437:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1481,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "allowance",
"nodeType": "MemberAccess",
"referencedDeclaration": 21097,
"src": "28437:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (address,address) view external returns (uint256)"
}
},
"id": 1487,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28437:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28417:61:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1489,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1479,
"src": "28493:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 1490,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1475,
"src": "28505:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28493:18:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1509,
"nodeType": "IfStatement",
"src": "28489:171:0",
"trueBody": {
"id": 1508,
"nodeType": "Block",
"src": "28513:147:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1492,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1479,
"src": "28532:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1493,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28544:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "28532:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1501,
"nodeType": "IfStatement",
"src": "28528:68:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1496,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28576:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1497,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28584:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1498,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28594:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1495,
"name": "safeApprove",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22428,
"src": "28564:11:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28564:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1500,
"nodeType": "ExpressionStatement",
"src": "28564:32:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1503,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28623:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1504,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28631:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1505,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1475,
"src": "28641:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1502,
"name": "safeApprove",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22428,
"src": "28611:11:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28611:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1507,
"nodeType": "ExpressionStatement",
"src": "28611:37:0"
}
]
}
}
]
},
"documentation": {
"id": 1469,
"nodeType": "StructuredDocumentation",
"src": "27861:452:0",
"text": " @dev utility, checks whether allowance for the given spender exists and approves one if it doesn't.\n Note that we use the non standard erc-20 interface in which `approve` has no return value so that\n this function will work for both standard and non standard tokens\n @param _token token to check the allowance in\n @param _spender approved address\n @param _value allowance amount"
},
"id": 1511,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "ensureAllowance",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1476,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1471,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28344:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1470,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28344:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1473,
"mutability": "mutable",
"name": "_spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28364:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1472,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "28364:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1475,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28382:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1474,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28382:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28343:54:0"
},
"returnParameters": {
"id": 1477,
"nodeType": "ParameterList",
"parameters": [],
"src": "28406:0:0"
},
"scope": 1976,
"src": "28319:348:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1551,
"nodeType": "Block",
"src": "28848:352:0",
"statements": [
{
"assignments": [
1519
],
"declarations": [
{
"constant": false,
"id": 1519,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1551,
"src": "28859:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1518,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28859:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1523,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1520,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1513,
"src": "28882:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 1521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectorTokenCount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13339,
"src": "28882:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint16_$",
"typeString": "function () view external returns (uint16)"
}
},
"id": 1522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28882:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28859:55:0"
},
{
"body": {
"id": 1547,
"nodeType": "Block",
"src": "28968:186:0",
"statements": [
{
"assignments": [
1535
],
"declarations": [
{
"constant": false,
"id": 1535,
"mutability": "mutable",
"name": "reserveTokenAddress",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1547,
"src": "28983:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1534,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28983:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1540,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1538,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "29044:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1536,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1513,
"src": "29017:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 1537,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectorTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 13334,
"src": "29017:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (uint256) view external returns (contract IERC20Token)"
}
},
"id": 1539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29017:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28983:63:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1541,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "29065:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1543,
"indexExpression": {
"argumentTypes": null,
"id": 1542,
"name": "reserveTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1535,
"src": "29077:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29065:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1546,
"nodeType": "IfStatement",
"src": "29061:81:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1544,
"name": "reserveTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1535,
"src": "29123:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1517,
"id": 1545,
"nodeType": "Return",
"src": "29116:26:0"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1528,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "28945:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 1529,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1519,
"src": "28949:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28945:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1548,
"initializationExpression": {
"assignments": [
1525
],
"declarations": [
{
"constant": false,
"id": 1525,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1548,
"src": "28930:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1524,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28930:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1527,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28942:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "28930:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1532,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "28963:3:0",
"subExpression": {
"argumentTypes": null,
"id": 1531,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "28963:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1533,
"nodeType": "ExpressionStatement",
"src": "28963:3:0"
},
"nodeType": "ForStatement",
"src": "28925:229:0"
},
{
"expression": {
"argumentTypes": null,
"id": 1549,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "29173:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1517,
"id": 1550,
"nodeType": "Return",
"src": "29166:26:0"
}
]
},
"documentation": null,
"id": 1552,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConverterEtherTokenAddress",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1514,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1513,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1552,
"src": "28790:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1512,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "28790:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28789:23:0"
},
"returnParameters": {
"id": 1517,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1516,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1552,
"src": "28835:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1515,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28835:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28834:13:0"
},
"scope": 1976,
"src": "28751:449:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1578,
"nodeType": "Block",
"src": "29474:224:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1564,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "29489:20:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1561,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "29490:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1563,
"indexExpression": {
"argumentTypes": null,
"id": 1562,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1556,
"src": "29502:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29490:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1567,
"nodeType": "IfStatement",
"src": "29485:52:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1565,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1556,
"src": "29531:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1566,
"nodeType": "Return",
"src": "29524:13:0"
}
},
{
"condition": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1569,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1554,
"src": "29577:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1568,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "29554:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29554:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1573,
"nodeType": "IfStatement",
"src": "29550:79:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1571,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "29610:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1572,
"nodeType": "Return",
"src": "29603:26:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1575,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1554,
"src": "29679:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1574,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "29649:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29649:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1577,
"nodeType": "Return",
"src": "29642:48:0"
}
]
},
"documentation": null,
"id": 1579,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConverterTokenAddress",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1557,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1554,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29396:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1553,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "29396:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1556,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29419:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1555,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29419:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29395:43:0"
},
"returnParameters": {
"id": 1560,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1559,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29461:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1558,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29461:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29460:13:0"
},
"scope": 1976,
"src": "29362:336:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"constant": true,
"id": 1587,
"mutability": "constant",
"name": "GET_RETURN_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "29706:106:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1580,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "29706:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "67657452657475726e28616464726573732c616464726573732c75696e7432353629",
"id": 1584,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "29774:36:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_1e1401f8329fe5eb5c7e76277d3c971ffeee3a41a0eef7c00afeb0a286cef0af",
"typeString": "literal_string \"getReturn(address,address,uint256)\""
},
"value": "getReturn(address,address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_1e1401f8329fe5eb5c7e76277d3c971ffeee3a41a0eef7c00afeb0a286cef0af",
"typeString": "literal_string \"getReturn(address,address,uint256)\""
}
],
"id": 1583,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "29764:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 1585,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29764:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1582,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "29757:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 1581,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "29757:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1586,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29757:55:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 1663,
"nodeType": "Block",
"src": "30036:523:0",
"statements": [
{
"assignments": [
1603
],
"declarations": [
{
"constant": false,
"id": 1603,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30047:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1602,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30047:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1611,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1606,
"name": "GET_RETURN_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1587,
"src": "30090:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 1607,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1591,
"src": "30116:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1608,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1593,
"src": "30130:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1609,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1595,
"src": "30144:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1604,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30067:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1605,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30067:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 1610,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30067:85:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30047:105:0"
},
{
"assignments": [
1613,
1615
],
"declarations": [
{
"constant": false,
"id": 1613,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30164:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1612,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "30164:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1615,
"mutability": "mutable",
"name": "returnData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30178:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1614,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30178:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1623,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1621,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1603,
"src": "30231:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1618,
"name": "_dest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1589,
"src": "30213:5:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1617,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30205:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1616,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "30205:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30205:14:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1620,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30205:25:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30205:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30163:73:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1624,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1613,
"src": "30253:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1658,
"nodeType": "IfStatement",
"src": "30249:277:0",
"trueBody": {
"id": 1657,
"nodeType": "Block",
"src": "30262:264:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1628,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1625,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30281:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1626,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30281:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3634",
"id": 1627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30302:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "30281:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1640,
"nodeType": "IfStatement",
"src": "30277:113:0",
"trueBody": {
"id": 1639,
"nodeType": "Block",
"src": "30306:84:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1631,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30343:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1633,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30356:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1632,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30356:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
{
"argumentTypes": null,
"id": 1635,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30365:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1634,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30365:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1636,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30355:18:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$",
"typeString": "tuple(type(uint256),type(uint256))"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$",
"typeString": "tuple(type(uint256),type(uint256))"
}
],
"expression": {
"argumentTypes": null,
"id": 1629,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30332:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1630,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30332:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1637,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30332:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 1601,
"id": 1638,
"nodeType": "Return",
"src": "30325:49:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1641,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30410:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1642,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30410:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 1643,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30431:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "30410:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1656,
"nodeType": "IfStatement",
"src": "30406:109:0",
"trueBody": {
"id": 1655,
"nodeType": "Block",
"src": "30435:80:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1647,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30473:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1649,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30486:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1648,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30486:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1650,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30485:9:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
}
],
"expression": {
"argumentTypes": null,
"id": 1645,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30462:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1646,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30462:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30462:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1652,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30497:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1653,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30461:38:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 1601,
"id": 1654,
"nodeType": "Return",
"src": "30454:45:0"
}
]
}
}
]
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1659,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30546:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1660,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30549:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1661,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30545:6:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_rational_0_by_1_$_t_rational_0_by_1_$",
"typeString": "tuple(int_const 0,int_const 0)"
}
},
"functionReturnParameters": 1601,
"id": 1662,
"nodeType": "Return",
"src": "30538:13:0"
}
]
},
"documentation": null,
"id": 1664,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1596,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1589,
"mutability": "mutable",
"name": "_dest",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29908:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1588,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "29908:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1591,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29926:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1590,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29926:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1593,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29952:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1592,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29952:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1595,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29978:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1594,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29978:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29907:87:0"
},
"returnParameters": {
"id": 1601,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1598,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "30018:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1597,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30018:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1600,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "30027:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1599,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30027:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30017:18:0"
},
"scope": 1976,
"src": "29889:670:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"constant": true,
"id": 1672,
"mutability": "constant",
"name": "IS_V28_OR_HIGHER_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "30567:93:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1665,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "30567:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "69735632384f724869676865722829",
"id": 1669,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30641:17:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d260529c8620a59d78f2e58cfd1294673bb6cba228ad1f34ac7731003ab870dd",
"typeString": "literal_string \"isV28OrHigher()\""
},
"value": "isV28OrHigher()"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_d260529c8620a59d78f2e58cfd1294673bb6cba228ad1f34ac7731003ab870dd",
"typeString": "literal_string \"isV28OrHigher()\""
}
],
"id": 1668,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "30631:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 1670,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30631:28:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1667,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30624:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 1666,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "30624:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1671,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30624:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 1718,
"nodeType": "Block",
"src": "30917:336:0",
"statements": [
{
"assignments": [
1680
],
"declarations": [
{
"constant": false,
"id": 1680,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "30928:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1679,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30928:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1685,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1683,
"name": "IS_V28_OR_HIGHER_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1672,
"src": "30971:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
],
"expression": {
"argumentTypes": null,
"id": 1681,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30948:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1682,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30948:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 1684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30948:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30928:74:0"
},
{
"assignments": [
1687,
1689
],
"declarations": [
{
"constant": false,
"id": 1687,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "31014:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1686,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "31014:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1689,
"mutability": "mutable",
"name": "returnData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "31028:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1688,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "31028:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1699,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1697,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1680,
"src": "31099:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1692,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1674,
"src": "31063:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1691,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31055:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1690,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31055:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1693,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31055:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1694,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31055:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1696,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"gas"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"hexValue": "34303030",
"id": 1695,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31092:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4000_by_1",
"typeString": "int_const 4000"
},
"value": "4000"
}
],
"src": "31055:43:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$gas",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1698,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31055:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "31013:91:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1700,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1687,
"src": "31121:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1701,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1689,
"src": "31132:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1702,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31132:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 1703,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31153:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "31132:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "31121:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1715,
"nodeType": "IfStatement",
"src": "31117:104:0",
"trueBody": {
"id": 1714,
"nodeType": "Block",
"src": "31157:64:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1708,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1689,
"src": "31190:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1710,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31203:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 1709,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "31203:4:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1711,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31202:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 1706,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "31179:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1707,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31179:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31179:30:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1678,
"id": 1713,
"nodeType": "Return",
"src": "31172:37:0"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1716,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31240:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 1678,
"id": 1717,
"nodeType": "Return",
"src": "31233:12:0"
}
]
},
"documentation": null,
"id": 1719,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isV28OrHigherConverter",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1675,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1674,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1719,
"src": "30865:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1673,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "30865:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30864:23:0"
},
"returnParameters": {
"id": 1678,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1677,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1719,
"src": "30911:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1676,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "30911:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30910:6:0"
},
"scope": 1976,
"src": "30833:420:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 1739,
"nodeType": "Block",
"src": "31432:57:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1733,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1723,
"src": "31462:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1734,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1725,
"src": "31469:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1732,
"name": "rateByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 462,
"src": "31451:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256) view returns (uint256)"
}
},
"id": 1735,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31451:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1736,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31479:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1737,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31450:31:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 1731,
"id": 1738,
"nodeType": "Return",
"src": "31443:38:0"
}
]
},
"documentation": {
"id": 1720,
"nodeType": "StructuredDocumentation",
"src": "31261:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "0c8496cc",
"id": 1740,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturnByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1726,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1723,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31352:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1721,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31352:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1722,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31352:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1725,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31376:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1724,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31376:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31351:41:0"
},
"returnParameters": {
"id": 1731,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1728,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31414:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1727,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31414:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1730,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31423:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1729,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31423:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31413:18:0"
},
"scope": 1976,
"src": "31327:162:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1768,
"nodeType": "Block",
"src": "31674:94:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1754,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1744,
"src": "31706:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1755,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1746,
"src": "31713:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1756,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1748,
"src": "31722:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1759,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31742:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1758,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31734:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1757,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31734:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1760,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31734:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1763,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31754:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1762,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31746:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1761,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31746:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1764,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31746:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1765,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31758:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1753,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "31692:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31692:68:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1752,
"id": 1767,
"nodeType": "Return",
"src": "31685:75:0"
}
]
},
"documentation": {
"id": 1741,
"nodeType": "StructuredDocumentation",
"src": "31497:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "f3898a97",
"id": 1769,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1749,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1744,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31580:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1742,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31580:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1743,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31580:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1746,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31604:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1745,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31604:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1748,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31621:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1747,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31621:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31579:61:0"
},
"returnParameters": {
"id": 1752,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1751,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31665:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1750,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31665:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31664:9:0"
},
"scope": 1976,
"src": "31563:205:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1798,
"nodeType": "Block",
"src": "32088:113:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1787,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1773,
"src": "32120:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1788,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1775,
"src": "32127:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1789,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1777,
"src": "32136:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1792,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32156:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1791,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32148:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1790,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32148:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1793,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32148:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1794,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1779,
"src": "32160:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1795,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "32179:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1786,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32106:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1796,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32106:87:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1785,
"id": 1797,
"nodeType": "Return",
"src": "32099:94:0"
}
]
},
"documentation": {
"id": 1770,
"nodeType": "StructuredDocumentation",
"src": "31776:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "569706eb",
"id": 1799,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1782,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1773,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31870:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1771,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31870:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1772,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31870:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1775,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31903:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1774,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31903:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1777,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31929:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1776,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31929:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1779,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31958:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1778,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31958:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1781,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31994:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1780,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31994:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31859:163:0"
},
"returnParameters": {
"id": 1785,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1784,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "32074:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1783,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32074:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32073:9:0"
},
"scope": 1976,
"src": "31842:359:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1826,
"nodeType": "Block",
"src": "32419:96:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1815,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1803,
"src": "32451:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1816,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1805,
"src": "32458:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1817,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1807,
"src": "32467:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1818,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1809,
"src": "32479:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1821,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32501:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1820,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32493:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1819,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32493:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32493:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1823,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32505:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1814,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32437:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32437:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1813,
"id": 1825,
"nodeType": "Return",
"src": "32430:77:0"
}
]
},
"documentation": {
"id": 1800,
"nodeType": "StructuredDocumentation",
"src": "32209:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "c98fefed",
"id": 1827,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convertFor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1803,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32295:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1801,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32295:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1802,
"length": null,
"nodeType": "ArrayTypeName",
"src": "32295:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1805,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32319:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32319:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1807,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32336:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1806,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32336:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1809,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32356:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1808,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32356:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32294:91:0"
},
"returnParameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1812,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32410:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1811,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32410:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32409:9:0"
},
"scope": 1976,
"src": "32275:240:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1858,
"nodeType": "Block",
"src": "32914:115:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1850,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1831,
"src": "32946:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1851,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1833,
"src": "32953:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1852,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1835,
"src": "32962:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1853,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1837,
"src": "32974:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1854,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1839,
"src": "32988:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1855,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1841,
"src": "33007:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1849,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32932:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1856,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32932:89:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1848,
"id": 1857,
"nodeType": "Return",
"src": "32925:96:0"
}
]
},
"documentation": {
"id": 1828,
"nodeType": "StructuredDocumentation",
"src": "32523:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "ab6214ce",
"id": 1859,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 1844,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1835,
"src": "32870:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 1845,
"modifierName": {
"argumentTypes": null,
"id": 1843,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "32854:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "32854:27:0"
}
],
"name": "convertFor2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1842,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1831,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32620:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1829,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32620:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1830,
"length": null,
"nodeType": "ArrayTypeName",
"src": "32620:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1833,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32653:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1832,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32653:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1835,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32679:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1834,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32679:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1837,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32708:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1836,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32708:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1839,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32747:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1838,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32747:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1841,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32783:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1840,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32783:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32609:202:0"
},
"returnParameters": {
"id": 1848,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1847,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32900:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1846,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32900:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32899:9:0"
},
"scope": 1976,
"src": "32589:440:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1887,
"nodeType": "Block",
"src": "33214:94:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1873,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1863,
"src": "33246:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1874,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1865,
"src": "33253:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1875,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1867,
"src": "33262:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1878,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33282:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1877,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33274:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1876,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33274:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1879,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33274:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1882,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33294:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1881,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33286:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1880,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33286:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1883,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33286:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1884,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33298:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1872,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33232:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33232:68:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1871,
"id": 1886,
"nodeType": "Return",
"src": "33225:75:0"
}
]
},
"documentation": {
"id": 1860,
"nodeType": "StructuredDocumentation",
"src": "33037:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "c7ba24bc",
"id": 1888,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1868,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1863,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33128:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1861,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33128:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1862,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33128:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1865,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33152:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1864,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1867,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33169:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1866,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33169:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33127:61:0"
},
"returnParameters": {
"id": 1871,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1870,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33205:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1869,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33205:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33204:9:0"
},
"scope": 1976,
"src": "33103:205:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1917,
"nodeType": "Block",
"src": "33619:113:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1906,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1892,
"src": "33651:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1907,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1894,
"src": "33658:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1908,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1896,
"src": "33667:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1911,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33687:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1910,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33679:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1909,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33679:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1912,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33679:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1913,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1898,
"src": "33691:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1914,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1900,
"src": "33710:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1905,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33637:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1915,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33637:87:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1904,
"id": 1916,
"nodeType": "Return",
"src": "33630:94:0"
}
]
},
"documentation": {
"id": 1889,
"nodeType": "StructuredDocumentation",
"src": "33316:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "e57738e5",
"id": 1918,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1901,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1892,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33418:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1890,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33418:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1891,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33418:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1894,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33451:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1893,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33451:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1896,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33477:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1895,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33477:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1898,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33506:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1897,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33506:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1900,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33542:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1899,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33542:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33407:163:0"
},
"returnParameters": {
"id": 1904,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1903,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33605:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1902,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33605:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33604:9:0"
},
"scope": 1976,
"src": "33382:350:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1945,
"nodeType": "Block",
"src": "33950:96:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1934,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1922,
"src": "33982:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1935,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1924,
"src": "33989:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1936,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1926,
"src": "33998:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1937,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1928,
"src": "34010:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1940,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "34032:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1939,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "34024:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1938,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34024:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1941,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34024:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1942,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "34036:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1933,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33968:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1943,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33968:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1932,
"id": 1944,
"nodeType": "Return",
"src": "33961:77:0"
}
]
},
"documentation": {
"id": 1919,
"nodeType": "StructuredDocumentation",
"src": "33740:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "b1e9932b",
"id": 1946,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvertFor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1929,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1922,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33834:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1920,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33834:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1921,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33834:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1924,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33858:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1923,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33858:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1926,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33875:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1925,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33875:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1928,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33895:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1927,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33895:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33833:91:0"
},
"returnParameters": {
"id": 1932,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1931,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33941:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1930,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33941:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33940:9:0"
},
"scope": 1976,
"src": "33806:240:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1974,
"nodeType": "Block",
"src": "34399:115:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1966,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1950,
"src": "34431:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1967,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1952,
"src": "34438:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1968,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1954,
"src": "34447:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1969,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1956,
"src": "34459:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1970,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1958,
"src": "34473:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1971,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1960,
"src": "34492:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1965,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "34417:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1972,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34417:89:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1964,
"id": 1973,
"nodeType": "Return",
"src": "34410:96:0"
}
]
},
"documentation": {
"id": 1947,
"nodeType": "StructuredDocumentation",
"src": "34054:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "2978c10e",
"id": 1975,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvertFor2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1961,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1950,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34159:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1948,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34159:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1949,
"length": null,
"nodeType": "ArrayTypeName",
"src": "34159:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1952,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34192:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1951,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34192:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1954,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34218:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1953,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34218:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1956,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34247:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1955,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34247:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1958,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34286:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1957,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34286:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1960,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34322:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1959,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34322:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34148:202:0"
},
"returnParameters": {
"id": 1964,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1963,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34385:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1962,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34385:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34384:9:0"
},
"scope": 1976,
"src": "34120:394:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 1977,
"src": "1956:32561:0"
}
],
"src": "52:34467:0"
},
"legacyAST": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/BancorNetwork.sol",
"exportedSymbols": {
"BancorNetwork": [
1976
],
"ILegacyConverter": [
26
]
},
"id": 1977,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:0"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/IConversionPathFinder.sol",
"file": "./IConversionPathFinder.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 2547,
"src": "77:37:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverter.sol",
"file": "./converter/interfaces/IConverter.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13341,
"src": "116:47:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterAnchor.sol",
"file": "./converter/interfaces/IConverterAnchor.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13350,
"src": "165:53:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol",
"file": "./converter/interfaces/IBancorFormula.sol",
"id": 5,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 13178,
"src": "220:51:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ContractRegistryClient.sol",
"file": "./utility/ContractRegistryClient.sol",
"id": 6,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21720,
"src": "273:46:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol",
"file": "./utility/ReentrancyGuard.sol",
"id": 7,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22243,
"src": "321:39:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHolder.sol",
"file": "./utility/TokenHolder.sol",
"id": 8,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22576,
"src": "362:35:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/SafeMath.sol",
"file": "./utility/SafeMath.sol",
"id": 9,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 22355,
"src": "399:32:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IEtherToken.sol",
"file": "./token/interfaces/IEtherToken.sol",
"id": 10,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21154,
"src": "433:44:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/ISmartToken.sol",
"file": "./token/interfaces/ISmartToken.sol",
"id": 11,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 21183,
"src": "479:44:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/bancorx/interfaces/IBancorX.sol",
"file": "./bancorx/interfaces/IBancorX.sol",
"id": 12,
"nodeType": "ImportDirective",
"scope": 1977,
"sourceUnit": 3552,
"src": "525:43:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 26,
"linearizedBaseContracts": [
26
],
"name": "ILegacyConverter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "5e5144eb",
"id": 25,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "change",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 21,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "683:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 13,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "683:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "709:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 15,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "709:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "735:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 17,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "735:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 20,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "752:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "752:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "682:89:0"
},
"returnParameters": {
"id": 24,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 23,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 25,
"src": "790:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 22,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "790:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "789:9:0"
},
"scope": 26,
"src": "667:132:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1977,
"src": "633:169:0"
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 28,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "1982:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
},
"id": 29,
"nodeType": "InheritanceSpecifier",
"src": "1982:11:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 30,
"name": "ContractRegistryClient",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21719,
"src": "1995:22:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ContractRegistryClient_$21719",
"typeString": "contract ContractRegistryClient"
}
},
"id": 31,
"nodeType": "InheritanceSpecifier",
"src": "1995:22:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 32,
"name": "ReentrancyGuard",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22242,
"src": "2019:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ReentrancyGuard_$22242",
"typeString": "contract ReentrancyGuard"
}
},
"id": 33,
"nodeType": "InheritanceSpecifier",
"src": "2019:15:0"
}
],
"contractDependencies": [
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 27,
"nodeType": "StructuredDocumentation",
"src": "806:1148:0",
"text": " @dev The BancorNetwork contract is the main entry point for Bancor token conversions.\n It also allows for the conversion of any token in the Bancor Network to any other token in a single\n transaction by providing a conversion path.\n A note on Conversion Path: Conversion path is a data structure that is used when converting a token\n to another token in the Bancor Network, when the conversion cannot necessarily be done by a single\n converter and might require multiple 'hops'.\n The path defines which converters should be used and what kind of conversion should be done in each step.\n The path format doesn't include complex structure; instead, it is represented by a single array\n in which each 'hop' is represented by a 2-tuple - converter anchor & target token.\n In addition, the first element is always the source token.\n The converter anchor is only used as a pointer to a converter (since converter addresses are more\n likely to change as opposed to anchor addresses).\n Format:\n [source token, converter anchor, target token, converter anchor, target token...]"
},
"fullyImplemented": true,
"id": 1976,
"linearizedBaseContracts": [
1976,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
22847
],
"name": "BancorNetwork",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 36,
"libraryName": {
"contractScope": null,
"id": 34,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22354,
"src": "2048:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$22354",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "2042:27:0",
"typeName": {
"id": 35,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2061:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"id": 39,
"mutability": "constant",
"name": "PPM_RESOLUTION",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2077:49:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 37,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2077:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31303030303030",
"id": 38,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2119:7:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000_by_1",
"typeString": "int_const 1000000"
},
"value": "1000000"
},
"visibility": "private"
},
{
"constant": true,
"id": 44,
"mutability": "constant",
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2133:106:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 40,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2133:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307845656565654565656545654565654565456545656545454565656565456565656565656545456545",
"id": 42,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2196:42:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 41,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "2184:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2184:55:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"visibility": "private"
},
{
"canonicalName": "BancorNetwork.ConversionStep",
"id": 59,
"members": [
{
"constant": false,
"id": 46,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2281:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 45,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "2281:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 48,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2312:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 47,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "2312:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 50,
"mutability": "mutable",
"name": "sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2346:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 49,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2346:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 52,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2380:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 51,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2380:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 54,
"mutability": "mutable",
"name": "beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2414:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 53,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2414:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 56,
"mutability": "mutable",
"name": "isV28OrHigherConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2452:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 55,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2452:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 58,
"mutability": "mutable",
"name": "processAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 59,
"src": "2490:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 57,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2490:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "ConversionStep",
"nodeType": "StructDefinition",
"scope": 1976,
"src": "2248:274:0",
"visibility": "public"
},
{
"constant": false,
"functionSelector": "5d732ff2",
"id": 62,
"mutability": "mutable",
"name": "maxAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2530:38:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 60,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2530:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3330303030",
"id": 61,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2563:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_30000_by_1",
"typeString": "int_const 30000"
},
"value": "30000"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "8077ccf7",
"id": 66,
"mutability": "mutable",
"name": "etherTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "2606:48:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
},
"typeName": {
"id": 65,
"keyType": {
"contractScope": null,
"id": 63,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2615:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Mapping",
"src": "2606:29:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
},
"valueType": {
"id": 64,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2630:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 67,
"nodeType": "StructuredDocumentation",
"src": "2703:441:0",
"text": " @dev triggered when a conversion between two tokens occurs\n @param _smartToken anchor governed by the converter\n @param _fromToken source ERC20 token\n @param _toToken target ERC20 token\n @param _fromAmount amount converted, in the source token\n @param _toAmount amount returned, minus conversion fee\n @param _trader wallet that initiated the trade"
},
"id": 81,
"name": "Conversion",
"nodeType": "EventDefinition",
"parameters": {
"id": 80,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 69,
"indexed": true,
"mutability": "mutable",
"name": "_smartToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3177:36:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 68,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "3177:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"indexed": true,
"mutability": "mutable",
"name": "_fromToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3224:30:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 70,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3224:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 73,
"indexed": true,
"mutability": "mutable",
"name": "_toToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3265:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 72,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "3265:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 75,
"indexed": false,
"mutability": "mutable",
"name": "_fromAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3304:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 74,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3304:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 77,
"indexed": false,
"mutability": "mutable",
"name": "_toAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3334:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 76,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3334:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 79,
"indexed": false,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 81,
"src": "3362:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 78,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3362:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3166:218:0"
},
"src": "3150:235:0"
},
{
"body": {
"id": 96,
"nodeType": "Block",
"src": "3625:58:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 94,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 90,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "3636:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 92,
"indexExpression": {
"argumentTypes": null,
"id": 91,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "3648:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3636:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 93,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3671:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "3636:39:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 95,
"nodeType": "ExpressionStatement",
"src": "3636:39:0"
}
]
},
"documentation": {
"id": 82,
"nodeType": "StructuredDocumentation",
"src": "3393:144:0",
"text": " @dev initializes a new BancorNetwork instance\n @param _registry address of a contract registry contract"
},
"id": 97,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 87,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 84,
"src": "3607:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
}
],
"id": 88,
"modifierName": {
"argumentTypes": null,
"id": 86,
"name": "ContractRegistryClient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21719,
"src": "3584:22:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ContractRegistryClient_$21719_$",
"typeString": "type(contract ContractRegistryClient)"
}
},
"nodeType": "ModifierInvocation",
"src": "3584:33:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 85,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 84,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 97,
"src": "3555:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 83,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "3555:17:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3554:29:0"
},
"returnParameters": {
"id": 89,
"nodeType": "ParameterList",
"parameters": [],
"src": "3625:0:0"
},
"scope": 1976,
"src": "3543:140:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 116,
"nodeType": "Block",
"src": "3935:136:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 106,
"name": "_maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 100,
"src": "3954:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 107,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "3974:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3954:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3990:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 105,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "3946:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3946:72:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 111,
"nodeType": "ExpressionStatement",
"src": "3946:72:0"
},
{
"expression": {
"argumentTypes": null,
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 112,
"name": "maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62,
"src": "4029:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 113,
"name": "_maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 100,
"src": "4047:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4029:34:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 115,
"nodeType": "ExpressionStatement",
"src": "4029:34:0"
}
]
},
"documentation": {
"id": 98,
"nodeType": "StructuredDocumentation",
"src": "3691:144:0",
"text": " @dev allows the owner to update the maximum affiliate-fee\n @param _maxAffiliateFee maximum affiliate-fee"
},
"functionSelector": "f3bc7d2a",
"id": 117,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 103,
"modifierName": {
"argumentTypes": null,
"id": 102,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "3920:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3920:9:0"
}
],
"name": "setMaxAffiliateFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 101,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 100,
"mutability": "mutable",
"name": "_maxAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 117,
"src": "3869:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 99,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3869:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3868:26:0"
},
"returnParameters": {
"id": 104,
"nodeType": "ParameterList",
"parameters": [],
"src": "3935:0:0"
},
"scope": 1976,
"src": "3841:230:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 145,
"nodeType": "Block",
"src": "4474:50:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 139,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "4485:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 141,
"indexExpression": {
"argumentTypes": null,
"id": 140,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4497:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4485:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 142,
"name": "_register",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 122,
"src": "4507:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4485:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 144,
"nodeType": "ExpressionStatement",
"src": "4485:31:0"
}
]
},
"documentation": {
"id": 118,
"nodeType": "StructuredDocumentation",
"src": "4079:212:0",
"text": " @dev allows the owner to register/unregister ether tokens\n @param _token ether token contract address\n @param _register true to register, false to unregister"
},
"functionSelector": "02ef521e",
"id": 146,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 125,
"modifierName": {
"argumentTypes": null,
"id": 124,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "4386:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4386:9:0"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 129,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4426:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
],
"id": 128,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4418:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 127,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4418:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4418:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 131,
"modifierName": {
"argumentTypes": null,
"id": 126,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "4405:12:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "4405:29:0"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 135,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "4460:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
],
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4452:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 133,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4452:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4452:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 137,
"modifierName": {
"argumentTypes": null,
"id": 132,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "4444:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "4444:24:0"
}
],
"name": "registerEtherToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 123,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 120,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 146,
"src": "4325:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
},
"typeName": {
"contractScope": null,
"id": 119,
"name": "IEtherToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21153,
"src": "4325:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 122,
"mutability": "mutable",
"name": "_register",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 146,
"src": "4345:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 121,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "4345:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4324:36:0"
},
"returnParameters": {
"id": 138,
"nodeType": "ParameterList",
"parameters": [],
"src": "4474:0:0"
},
"scope": 1976,
"src": "4297:227:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 171,
"nodeType": "Block",
"src": "5021:175:0",
"statements": [
{
"assignments": [
158
],
"declarations": [
{
"constant": false,
"id": 158,
"mutability": "mutable",
"name": "pathFinder",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 171,
"src": "5032:32:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
},
"typeName": {
"contractScope": null,
"id": 157,
"name": "IConversionPathFinder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2546,
"src": "5032:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 164,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 161,
"name": "CONVERSION_PATH_FINDER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21539,
"src": "5099:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 160,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5089:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 162,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5089:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 159,
"name": "IConversionPathFinder",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2546,
"src": "5067:21:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConversionPathFinder_$2546_$",
"typeString": "type(contract IConversionPathFinder)"
}
},
"id": 163,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5067:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5032:91:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 167,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 149,
"src": "5161:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 168,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 151,
"src": "5175:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 165,
"name": "pathFinder",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 158,
"src": "5141:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConversionPathFinder_$2546",
"typeString": "contract IConversionPathFinder"
}
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "findPath",
"nodeType": "MemberAccess",
"referencedDeclaration": 2545,
"src": "5141:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$returns$_t_array$_t_address_$dyn_memory_ptr_$",
"typeString": "function (contract IERC20Token,contract IERC20Token) view external returns (address[] memory)"
}
},
"id": 169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5141:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"functionReturnParameters": 156,
"id": 170,
"nodeType": "Return",
"src": "5134:54:0"
}
]
},
"documentation": {
"id": 147,
"nodeType": "StructuredDocumentation",
"src": "4532:368:0",
"text": " @dev returns the conversion path between two tokens in the network\n note that this method is quite expensive in terms of gas and should generally be called off-chain\n @param _sourceToken source token address\n @param _targetToken target token address\n @return conversion path between the two tokens"
},
"functionSelector": "d734fa19",
"id": 172,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "conversionPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 152,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 149,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "4930:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 148,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4930:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 151,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "4956:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 150,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4956:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4929:52:0"
},
"returnParameters": {
"id": 156,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 155,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 172,
"src": "5003:16:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 153,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5003:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 154,
"length": null,
"nodeType": "ArrayTypeName",
"src": "5003:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5002:18:0"
},
"scope": 1976,
"src": "4906:290:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 461,
"nodeType": "Block",
"src": "5682:2762:0",
"statements": [
{
"assignments": [
184
],
"declarations": [
{
"constant": false,
"id": 184,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5693:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 183,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5693:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 185,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5693:14:0"
},
{
"assignments": [
187
],
"declarations": [
{
"constant": false,
"id": 187,
"mutability": "mutable",
"name": "fee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5718:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 186,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5718:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 188,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5718:11:0"
},
{
"assignments": [
190
],
"declarations": [
{
"constant": false,
"id": 190,
"mutability": "mutable",
"name": "supply",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5740:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 189,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5740:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 191,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5740:14:0"
},
{
"assignments": [
193
],
"declarations": [
{
"constant": false,
"id": 193,
"mutability": "mutable",
"name": "balance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5765:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 192,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5765:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 194,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5765:15:0"
},
{
"assignments": [
196
],
"declarations": [
{
"constant": false,
"id": 196,
"mutability": "mutable",
"name": "weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5791:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 195,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5791:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 197,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5791:13:0"
},
{
"assignments": [
199
],
"declarations": [
{
"constant": false,
"id": 199,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5815:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 198,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "5815:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 200,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "5815:20:0"
},
{
"assignments": [
202
],
"declarations": [
{
"constant": false,
"id": 202,
"mutability": "mutable",
"name": "formula",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 461,
"src": "5846:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
},
"typeName": {
"contractScope": null,
"id": 201,
"name": "IBancorFormula",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13177,
"src": "5846:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 208,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 205,
"name": "BANCOR_FORMULA",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21533,
"src": "5896:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 204,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "5886:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5886:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 203,
"name": "IBancorFormula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13177,
"src": "5871:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorFormula_$13177_$",
"typeString": "type(contract IBancorFormula)"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5871:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5846:66:0"
},
{
"expression": {
"argumentTypes": null,
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 209,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "5925:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 210,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 178,
"src": "5934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5925:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 212,
"nodeType": "ExpressionStatement",
"src": "5925:16:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 214,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6034:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6034:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 216,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6049:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6034:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 223,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 221,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 218,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6054:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6054:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 220,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6069:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6054:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 222,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6074:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "6054:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6034:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f50415448",
"id": 225,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6077:18:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
},
"value": "ERR_INVALID_PATH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
}
],
"id": 213,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6026:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 226,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6026:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 227,
"nodeType": "ExpressionStatement",
"src": "6026:70:0"
},
{
"body": {
"id": 457,
"nodeType": "Block",
"src": "6200:2211:0",
"statements": [
{
"assignments": [
241
],
"declarations": [
{
"constant": false,
"id": 241,
"mutability": "mutable",
"name": "sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6215:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 240,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6215:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 249,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 243,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6253:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 247,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 244,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6259:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6263:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6259:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6253:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 242,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "6241:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6241:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6215:51:0"
},
{
"assignments": [
251
],
"declarations": [
{
"constant": false,
"id": 251,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6281:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 250,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6281:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 257,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 252,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6298:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 256,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 253,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6304:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 254,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6308:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "6304:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6298:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6281:29:0"
},
{
"assignments": [
259
],
"declarations": [
{
"constant": false,
"id": 259,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 457,
"src": "6325:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 258,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6325:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 265,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 261,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6363:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 263,
"indexExpression": {
"argumentTypes": null,
"id": 262,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6369:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6363:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 260,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "6351:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 264,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6351:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6325:47:0"
},
{
"expression": {
"argumentTypes": null,
"id": 277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 266,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6389:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 271,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6437:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 270,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "6420:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 272,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6420:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 273,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "6420:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 274,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6420:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 269,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6412:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 268,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6412:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6412:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 267,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "6401:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6401:53:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"src": "6389:65:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 278,
"nodeType": "ExpressionStatement",
"src": "6389:65:0"
},
{
"expression": {
"argumentTypes": null,
"id": 284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 279,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "6510:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 281,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6549:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 282,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "6560:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 280,
"name": "getConverterTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "6524:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter,contract IERC20Token) view returns (contract IERC20Token)"
}
},
"id": 283,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6524:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "6510:62:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 285,
"nodeType": "ExpressionStatement",
"src": "6510:62:0"
},
{
"expression": {
"argumentTypes": null,
"id": 291,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 286,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6587:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 288,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6626:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 289,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6637:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 287,
"name": "getConverterTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "6601:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter,contract IERC20Token) view returns (contract IERC20Token)"
}
},
"id": 290,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6601:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "6587:62:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 292,
"nodeType": "ExpressionStatement",
"src": "6587:62:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 295,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "6678:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 294,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6670:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 293,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6670:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6670:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 297,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6694:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "6670:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 373,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 370,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7480:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 369,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "7472:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 368,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7472:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 371,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7472:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 372,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7496:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "7472:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 454,
"nodeType": "Block",
"src": "8267:133:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 443,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8315:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 444,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8323:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 445,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "8314:13:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 447,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "8340:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"id": 448,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "8351:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 449,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "8364:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 450,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8377:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 446,
"name": "getReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1664,
"src": "8330:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IConverter,contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8330:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"src": "8314:70:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 453,
"nodeType": "ExpressionStatement",
"src": "8314:70:0"
}
]
},
"id": 455,
"nodeType": "IfStatement",
"src": "7468:932:0",
"trueBody": {
"id": 442,
"nodeType": "Block",
"src": "7504:744:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 384,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 376,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 374,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "7616:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 375,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7620:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "7616:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 377,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7625:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 378,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "7635:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 382,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 381,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 379,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "7641:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 380,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7645:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "7641:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7635:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "7625:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "7616:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 393,
"nodeType": "IfStatement",
"src": "7612:100:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 385,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7670:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 387,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "7691:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 386,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "7679:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7679:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "7679:31:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7679:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7670:42:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 392,
"nodeType": "ExpressionStatement",
"src": "7670:42:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 394,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7789:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 397,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "7829:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 395,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7799:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 396,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getConnectorBalance",
"nodeType": "MemberAccess",
"referencedDeclaration": 13327,
"src": "7799:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view external returns (uint256)"
}
},
"id": 398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7799:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7789:52:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 400,
"nodeType": "ExpressionStatement",
"src": "7789:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 407,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
null,
{
"argumentTypes": null,
"id": 401,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7863:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
null,
null,
null
],
"id": 402,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "7860:16:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$_t_uint32_$__$__$__$",
"typeString": "tuple(,uint32,,,)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 405,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 259,
"src": "7900:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 403,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7879:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectors",
"nodeType": "MemberAccess",
"referencedDeclaration": 13320,
"src": "7879:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "function (contract IERC20Token) view external returns (uint256,uint32,bool,bool,bool)"
}
},
"id": 406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7879:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"src": "7860:52:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 408,
"nodeType": "ExpressionStatement",
"src": "7860:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 417,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 409,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7931:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 412,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7965:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 413,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7973:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 414,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7982:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 415,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7990:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 410,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 202,
"src": "7940:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "saleTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13105,
"src": "7940:24:0",
"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": 416,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7940:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7931:66:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 418,
"nodeType": "ExpressionStatement",
"src": "7931:66:0"
},
{
"expression": {
"argumentTypes": null,
"id": 429,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 419,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8016:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 427,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "8064:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 422,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "8033:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "conversionFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 13238,
"src": "8033:23:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint32_$",
"typeString": "function () view external returns (uint32)"
}
},
"id": 424,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8033:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 420,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8022:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 421,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "8022:10:0",
"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": 425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8022:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 426,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "8022:41:0",
"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": 428,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8022:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8016:63:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 430,
"nodeType": "ExpressionStatement",
"src": "8016:63:0"
},
{
"expression": {
"argumentTypes": null,
"id": 433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 431,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8098:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 432,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "8108:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8098:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 434,
"nodeType": "ExpressionStatement",
"src": "8098:13:0"
},
{
"expression": {
"argumentTypes": null,
"id": 440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 435,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "8205:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 438,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8225:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 436,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "8214:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 437,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 22293,
"src": "8214:10:0",
"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": 439,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8214:18:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8205:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 441,
"nodeType": "ExpressionStatement",
"src": "8205:27:0"
}
]
}
},
"id": 456,
"nodeType": "IfStatement",
"src": "6666:1734:0",
"trueBody": {
"id": 367,
"nodeType": "Block",
"src": "6702:747:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 299,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6813:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6817:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "6813:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 308,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 302,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6822:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 303,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6832:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 307,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 306,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 304,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6838:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 305,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6842:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "6838:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6832:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "6822:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6813:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 318,
"nodeType": "IfStatement",
"src": "6809:100:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 310,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "6867:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 312,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 251,
"src": "6888:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 311,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "6876:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6876:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "totalSupply",
"nodeType": "MemberAccess",
"referencedDeclaration": 21081,
"src": "6876:31:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 315,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6876:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6867:42:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "6867:42:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 324,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 319,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "6986:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 322,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7026:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 320,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "6996:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 321,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getConnectorBalance",
"nodeType": "MemberAccess",
"referencedDeclaration": 13327,
"src": "6996:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view external returns (uint256)"
}
},
"id": 323,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6996:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6986:52:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 325,
"nodeType": "ExpressionStatement",
"src": "6986:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 332,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"components": [
null,
{
"argumentTypes": null,
"id": 326,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7060:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
null,
null,
null
],
"id": 327,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "7057:16:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$_t_uint32_$__$__$__$",
"typeString": "tuple(,uint32,,,)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 330,
"name": "sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 241,
"src": "7097:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 328,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7076:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectors",
"nodeType": "MemberAccess",
"referencedDeclaration": 13320,
"src": "7076:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "function (contract IERC20Token) view external returns (uint256,uint32,bool,bool,bool)"
}
},
"id": 331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7076:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"src": "7057:52:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 333,
"nodeType": "ExpressionStatement",
"src": "7057:52:0"
},
{
"expression": {
"argumentTypes": null,
"id": 342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 334,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7128:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 337,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7166:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 338,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 193,
"src": "7174:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 339,
"name": "weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 196,
"src": "7183:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 340,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7191:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 335,
"name": "formula",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 202,
"src": "7137:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorFormula_$13177",
"typeString": "contract IBancorFormula"
}
},
"id": 336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "purchaseTargetAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13092,
"src": "7137:28:0",
"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": 341,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7137:61:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7128:70:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 343,
"nodeType": "ExpressionStatement",
"src": "7128:70:0"
},
{
"expression": {
"argumentTypes": null,
"id": 354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 344,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "7217:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 352,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "7265:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 347,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 199,
"src": "7234:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 348,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "conversionFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 13238,
"src": "7234:23:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint32_$",
"typeString": "function () view external returns (uint32)"
}
},
"id": 349,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7234:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 345,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7223:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 346,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "7223:10:0",
"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": 350,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7223:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 351,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "7223:41:0",
"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": 353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7223:57:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7217:63:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 355,
"nodeType": "ExpressionStatement",
"src": "7217:63:0"
},
{
"expression": {
"argumentTypes": null,
"id": 358,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 356,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7299:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 357,
"name": "fee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "7309:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7299:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 359,
"nodeType": "ExpressionStatement",
"src": "7299:13:0"
},
{
"expression": {
"argumentTypes": null,
"id": 365,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 360,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7406:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 363,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "7426:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 361,
"name": "supply",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "7415:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 22271,
"src": "7415:10:0",
"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": 364,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7415:18:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "7406:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 366,
"nodeType": "ExpressionStatement",
"src": "7406:27:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 235,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 232,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6174:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 233,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "6178:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6178:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6174:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 458,
"initializationExpression": {
"assignments": [
229
],
"declarations": [
{
"constant": false,
"id": 229,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 458,
"src": "6159:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 228,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6159:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 231,
"initialValue": {
"argumentTypes": null,
"hexValue": "32",
"id": 230,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6171:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "VariableDeclarationStatement",
"src": "6159:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 236,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 229,
"src": "6192:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "32",
"id": 237,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6197:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "6192:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 239,
"nodeType": "ExpressionStatement",
"src": "6192:6:0"
},
"nodeType": "ForStatement",
"src": "6154:2257:0"
},
{
"expression": {
"argumentTypes": null,
"id": 459,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "8430:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 182,
"id": 460,
"nodeType": "Return",
"src": "8423:13:0"
}
]
},
"documentation": {
"id": 173,
"nodeType": "StructuredDocumentation",
"src": "5204:381:0",
"text": " @dev returns the expected target amount of converting a given amount on a given path\n note that there is no support for circular paths\n @param _path conversion path (see conversion path format above)\n @param _amount amount of _path[0] tokens received from the sender\n @return expected target amount"
},
"functionSelector": "7f9c0ecd",
"id": 462,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "rateByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 179,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 176,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5611:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 174,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5611:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 175,
"length": null,
"nodeType": "ArrayTypeName",
"src": "5611:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 178,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5635:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 177,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5635:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5610:41:0"
},
"returnParameters": {
"id": 182,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 181,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 462,
"src": "5673:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 180,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5673:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5672:9:0"
},
"scope": 1976,
"src": "5591:2853:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 597,
"nodeType": "Block",
"src": "9948:1329:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 497,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 487,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10073:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 488,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10073:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 489,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10088:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "10073:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 496,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 491,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10093:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 492,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10093:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 493,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10108:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "10093:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 495,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10113:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "10093:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10073:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f50415448",
"id": 498,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10116:18:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
},
"value": "ERR_INVALID_PATH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_db637d0ca669449dd352e97481d5a38953b8126ef5f657bdd830d33ff33d5b16",
"typeString": "literal_string \"ERR_INVALID_PATH\""
}
],
"id": 486,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10065:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10065:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 500,
"nodeType": "ExpressionStatement",
"src": "10065:70:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 503,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10257:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 505,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 504,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10263:1:0",
"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": "10257:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 502,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "10245:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10245:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 508,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10285:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 510,
"indexExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 509,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10291:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10285:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 507,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "10268:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 511,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10268:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"id": 512,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 468,
"src": "10296:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 501,
"name": "handleSourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1110,
"src": "10227:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IConverterAnchor_$13349_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IConverterAnchor,uint256)"
}
},
"id": 513,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10227:77:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 514,
"nodeType": "ExpressionStatement",
"src": "10227:77:0"
},
{
"assignments": [
516
],
"declarations": [
{
"constant": false,
"id": 516,
"mutability": "mutable",
"name": "affiliateFeeEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10363:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 515,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "10363:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 518,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 517,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10390:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "10363:32:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 527,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 521,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 474,
"src": "10418:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 520,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10410:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 519,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10410:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10410:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 525,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10448:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 524,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10440:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 523,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10440:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10440:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10410:40:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 551,
"nodeType": "Block",
"src": "10550:159:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 543,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 537,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10573:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 538,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10577:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10573:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 540,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10594:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 541,
"name": "maxAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62,
"src": "10611:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "10594:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "10573:53:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 544,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10628:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 536,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10565:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 545,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10565:91:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 546,
"nodeType": "ExpressionStatement",
"src": "10565:91:0"
},
{
"expression": {
"argumentTypes": null,
"id": 549,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 547,
"name": "affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 516,
"src": "10671:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 548,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10693:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "10671:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 550,
"nodeType": "ExpressionStatement",
"src": "10671:26:0"
}
]
},
"id": 552,
"nodeType": "IfStatement",
"src": "10406:303:0",
"trueBody": {
"id": 535,
"nodeType": "Block",
"src": "10452:83:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 531,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 529,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "10475:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 530,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10492:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "10475:18:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f414646494c494154455f464545",
"id": 532,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10495:27:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
},
"value": "ERR_INVALID_AFFILIATE_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5421a6ae0116cbc310697cd7899b77d6a7bc1fb10cd896c84c63fd20f8fbd382",
"typeString": "literal_string \"ERR_INVALID_AFFILIATE_FEE\""
}
],
"id": 528,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "10467:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 533,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10467:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 534,
"nodeType": "ExpressionStatement",
"src": "10467:56:0"
}
]
}
},
{
"assignments": [
554
],
"declarations": [
{
"constant": false,
"id": 554,
"mutability": "mutable",
"name": "beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10761:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 553,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10761:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 557,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 555,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "10791:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 556,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "10791:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10761:40:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"id": 563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 558,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 472,
"src": "10816:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 561,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10840:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 560,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10832:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 559,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10832:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 562,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10832:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10816:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 568,
"nodeType": "IfStatement",
"src": "10812:71:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 566,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 564,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "10857:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 565,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 472,
"src": "10871:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10857:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 567,
"nodeType": "ExpressionStatement",
"src": "10857:26:0"
}
},
{
"assignments": [
572
],
"declarations": [
{
"constant": false,
"id": 572,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "10945:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 570,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "10945:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 571,
"length": null,
"nodeType": "ArrayTypeName",
"src": "10945:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 578,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 574,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 466,
"src": "10997:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 575,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "11004:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 576,
"name": "affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 516,
"src": "11017:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 573,
"name": "createConversionData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1468,
"src": "10976:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_address_$dyn_memory_ptr_$_t_address_payable_$_t_bool_$returns$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$",
"typeString": "function (address[] memory,address payable,bool) view returns (struct BancorNetwork.ConversionStep memory[] memory)"
}
},
"id": 577,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10976:61:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "10945:92:0"
},
{
"assignments": [
580
],
"declarations": [
{
"constant": false,
"id": 580,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 597,
"src": "11048:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 579,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "11048:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 588,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 582,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 572,
"src": "11078:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
{
"argumentTypes": null,
"id": 583,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 468,
"src": "11084:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 584,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 470,
"src": "11093:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 585,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 474,
"src": "11105:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 586,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 476,
"src": "11124:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 581,
"name": "doConversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 998,
"src": "11065:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (struct BancorNetwork.ConversionStep memory[] memory,uint256,uint256,address,uint256) returns (uint256)"
}
},
"id": 587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11065:73:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "11048:90:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 590,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 572,
"src": "11217:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
{
"argumentTypes": null,
"id": 591,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "11223:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 592,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 554,
"src": "11231:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 589,
"name": "handleTargetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1174,
"src": "11199:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$_t_uint256_$_t_address_payable_$returns$__$",
"typeString": "function (struct BancorNetwork.ConversionStep memory[] memory,uint256,address payable)"
}
},
"id": 593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11199:44:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 594,
"nodeType": "ExpressionStatement",
"src": "11199:44:0"
},
{
"expression": {
"argumentTypes": null,
"id": 595,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "11263:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 485,
"id": 596,
"nodeType": "Return",
"src": "11256:13:0"
}
]
},
"documentation": {
"id": 463,
"nodeType": "StructuredDocumentation",
"src": "8452:1150:0",
"text": " @dev converts the token to any other token in the bancor network by following\n a predefined conversion path and transfers the result tokens to a target account\n affiliate account/fee can also be passed in to receive a conversion fee (on top of the liquidity provider fees)\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _beneficiary account that will receive the conversion result or 0x0 to send the result to the sender account\n @param _affiliateAccount wallet address to receive the affiliate fee or 0x0 to disable affiliate fee\n @param _affiliateFee affiliate fee in PPM or 0 to disable affiliate fee\n @return amount of tokens received from the conversion"
},
"functionSelector": "b77d239b",
"id": 598,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 479,
"modifierName": {
"argumentTypes": null,
"id": 478,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "9869:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9869:9:0"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 481,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 470,
"src": "9904:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 482,
"modifierName": {
"argumentTypes": null,
"id": 480,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "9888:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "9888:27:0"
}
],
"name": "convertByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 477,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 466,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9641:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 464,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9641:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 465,
"length": null,
"nodeType": "ArrayTypeName",
"src": "9641:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 468,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9674:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 467,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9674:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 470,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9700:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 469,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9700:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 472,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9729:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 471,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9729:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 474,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9768:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 473,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9768:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 476,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9804:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 475,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9804:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9630:196:0"
},
"returnParameters": {
"id": 485,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 484,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 598,
"src": "9934:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 483,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "9934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9933:9:0"
},
"scope": 1976,
"src": "9608:1669:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 631,
"nodeType": "Block",
"src": "12548:128:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 618,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 602,
"src": "12576:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 619,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 604,
"src": "12583:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 620,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 606,
"src": "12592:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 621,
"name": "_targetBlockchain",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 608,
"src": "12604:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 622,
"name": "_targetAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 610,
"src": "12623:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 623,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 612,
"src": "12639:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 626,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12662:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 625,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "12654:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 624,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12654:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12654:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 628,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12666:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 617,
"name": "xConvert2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 726,
"src": "12566:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,bytes32,bytes32,uint256,address,uint256) returns (uint256)"
}
},
"id": 629,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12566:102:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 616,
"id": 630,
"nodeType": "Return",
"src": "12559:109:0"
}
]
},
"documentation": {
"id": 599,
"nodeType": "StructuredDocumentation",
"src": "11285:978:0",
"text": " @dev converts any other token to BNT in the bancor network by following\na predefined conversion path and transfers the result to an account on a different blockchain\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _targetBlockchain blockchain BNT will be issued on\n @param _targetAccount address/account on the target blockchain to send the BNT to\n @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\n @return the amount of BNT received from this conversion"
},
"functionSelector": "c52173de",
"id": 632,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "xConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 613,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 602,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12297:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 600,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12297:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 601,
"length": null,
"nodeType": "ArrayTypeName",
"src": "12297:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 604,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12330:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 603,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12330:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 606,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12356:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 605,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12356:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 608,
"mutability": "mutable",
"name": "_targetBlockchain",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12385:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 607,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "12385:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 610,
"mutability": "mutable",
"name": "_targetAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12421:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 609,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "12421:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 612,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12454:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 611,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12454:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12286:196:0"
},
"returnParameters": {
"id": 616,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 615,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 632,
"src": "12534:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 614,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12534:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12533:9:0"
},
"scope": 1976,
"src": "12269:407:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 725,
"nodeType": "Block",
"src": "14166:739:0",
"statements": [
{
"assignments": [
659
],
"declarations": [
{
"constant": false,
"id": 659,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14177:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 658,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "14177:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 668,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 661,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14215:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 666,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 662,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14221:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14221:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 664,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14236:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "14221:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "14215:23:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 660,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "14203:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 667,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14203:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14177:62:0"
},
{
"assignments": [
670
],
"declarations": [
{
"constant": false,
"id": 670,
"mutability": "mutable",
"name": "bancorX",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14250:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
},
"typeName": {
"contractScope": null,
"id": 669,
"name": "IBancorX",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3551,
"src": "14250:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 676,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 673,
"name": "BANCOR_X",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21554,
"src": "14288:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 672,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14278:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 674,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14278:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 671,
"name": "IBancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3551,
"src": "14269:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IBancorX_$3551_$",
"typeString": "type(contract IBancorX)"
}
},
"id": 675,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14269:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14250:48:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 684,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 678,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 659,
"src": "14372:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 681,
"name": "BNT_TOKEN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21551,
"src": "14409:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 680,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14399:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 682,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14399:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 679,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "14387:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 683,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14387:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "14372:48:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f5441524745545f544f4b454e",
"id": 685,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14422:26:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_506dba30f9da1ed4da3626f556faadafab0575131908ae8223c813a59e0707f3",
"typeString": "literal_string \"ERR_INVALID_TARGET_TOKEN\""
},
"value": "ERR_INVALID_TARGET_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_506dba30f9da1ed4da3626f556faadafab0575131908ae8223c813a59e0707f3",
"typeString": "literal_string \"ERR_INVALID_TARGET_TOKEN\""
}
],
"id": 677,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "14364:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14364:85:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 687,
"nodeType": "ExpressionStatement",
"src": "14364:85:0"
},
{
"assignments": [
689
],
"declarations": [
{
"constant": false,
"id": 689,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 725,
"src": "14511:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 688,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14511:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 704,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 691,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 636,
"src": "14542:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 692,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 638,
"src": "14549:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 693,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 640,
"src": "14558:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 698,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "14586:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 697,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14578:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 696,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14578:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 699,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14578:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 695,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14570:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 694,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14570:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 700,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14570:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 701,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 648,
"src": "14594:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 702,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 650,
"src": "14613:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 690,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "14528:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 703,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14528:99:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14511:116:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 706,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 659,
"src": "14692:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 709,
"name": "bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 670,
"src": "14713:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
],
"id": 708,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14705:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 707,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14705:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 710,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14705:16:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 711,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14723:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 705,
"name": "ensureAllowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1511,
"src": "14676:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14676:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 713,
"nodeType": "ExpressionStatement",
"src": "14676:54:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 717,
"name": "_targetBlockchain",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 642,
"src": "14814:17:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 718,
"name": "_targetAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 644,
"src": "14833:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 719,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14849:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 720,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 646,
"src": "14857:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 714,
"name": "bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 670,
"src": "14796:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 716,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "xTransfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 3541,
"src": "14796:17:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_uint256_$returns$__$",
"typeString": "function (bytes32,bytes32,uint256,uint256) external"
}
},
"id": 721,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14796:75:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 722,
"nodeType": "ExpressionStatement",
"src": "14796:75:0"
},
{
"expression": {
"argumentTypes": null,
"id": 723,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 689,
"src": "14891:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 657,
"id": 724,
"nodeType": "Return",
"src": "14884:13:0"
}
]
},
"documentation": {
"id": 633,
"nodeType": "StructuredDocumentation",
"src": "12684:1091:0",
"text": " @dev converts any other token to BNT in the bancor network by following\na predefined conversion path and transfers the result to an account on a different blockchain\n note that the network should already have been given allowance of the source token (if not ETH)\n @param _path conversion path, see conversion path format above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _targetBlockchain blockchain BNT will be issued on\n @param _targetAccount address/account on the target blockchain to send the BNT to\n @param _conversionId pre-determined unique (if non zero) id which refers to this transaction\n @param _affiliateAccount affiliate account\n @param _affiliateFee affiliate fee in PPM\n @return the amount of BNT received from this conversion"
},
"functionSelector": "cb32564e",
"id": 726,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 653,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 640,
"src": "14122:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 654,
"modifierName": {
"argumentTypes": null,
"id": 652,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "14106:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "14106:27:0"
}
],
"name": "xConvert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 651,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 636,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13810:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 634,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13810:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 635,
"length": null,
"nodeType": "ArrayTypeName",
"src": "13810:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 638,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13843:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 637,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13843:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 640,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13869:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 639,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13869:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 642,
"mutability": "mutable",
"name": "_targetBlockchain",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13898:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 641,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "13898:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 644,
"mutability": "mutable",
"name": "_targetAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13934:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 643,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "13934:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 646,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13967:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 648,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "13999:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 647,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13999:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 650,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "14035:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 649,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14035:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13799:264:0"
},
"returnParameters": {
"id": 657,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 656,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 726,
"src": "14152:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 655,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "14151:9:0"
},
"scope": 1976,
"src": "13781:1124:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 777,
"nodeType": "Block",
"src": "16040:423:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 745,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 730,
"src": "16133:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 747,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 746,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16139:1:0",
"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": "16133:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 744,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "16121:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16121:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 749,
"name": "_bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 732,
"src": "16146:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 750,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "token",
"nodeType": "MemberAccess",
"referencedDeclaration": 3530,
"src": "16146:14:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function () view external returns (contract IERC20Token)"
}
},
"id": 751,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16146:16:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "16121:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f534f555243455f544f4b454e",
"id": 753,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16164:26:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0f690a2bdb8b25e0198ca38056ef0e9f045e379ec977ffdcb1486f3c53b6e8fa",
"typeString": "literal_string \"ERR_INVALID_SOURCE_TOKEN\""
},
"value": "ERR_INVALID_SOURCE_TOKEN"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_0f690a2bdb8b25e0198ca38056ef0e9f045e379ec977ffdcb1486f3c53b6e8fa",
"typeString": "literal_string \"ERR_INVALID_SOURCE_TOKEN\""
}
],
"id": 743,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "16113:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 754,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16113:78:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 755,
"nodeType": "ExpressionStatement",
"src": "16113:78:0"
},
{
"assignments": [
757
],
"declarations": [
{
"constant": false,
"id": 757,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 777,
"src": "16260:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 756,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16260:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 764,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 760,
"name": "_conversionId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 734,
"src": "16305:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 761,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "16320:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16320:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 758,
"name": "_bancorX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 732,
"src": "16277:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"id": 759,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getXTransferAmount",
"nodeType": "MemberAccess",
"referencedDeclaration": 3550,
"src": "16277:27:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$_t_address_$returns$_t_uint256_$",
"typeString": "function (uint256,address) view external returns (uint256)"
}
},
"id": 763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16277:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "16260:71:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 766,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 730,
"src": "16400:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 767,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "16407:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 768,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 736,
"src": "16415:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 769,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 738,
"src": "16427:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 772,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16449:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "16441:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 770,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "16441:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 773,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16441:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 774,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16453:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 765,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "16386:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16386:69:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 742,
"id": 776,
"nodeType": "Return",
"src": "16379:76:0"
}
]
},
"documentation": {
"id": 727,
"nodeType": "StructuredDocumentation",
"src": "14913:937:0",
"text": " @dev allows a user to convert a token that was sent from another blockchain into any other\n token on the BancorNetwork\n ideally this transaction is created before the previous conversion is even complete, so\n so the input amount isn't known at that point - the amount is actually take from the\n BancorX contract directly by specifying the conversion id\n @param _path conversion path\n @param _bancorX address of the BancorX contract for the source token\n @param _conversionId pre-determined unique (if non zero) id which refers to this conversion\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received from the conversion"
},
"functionSelector": "89f9cc61",
"id": 778,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "completeXConversion",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 730,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15885:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 728,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15885:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 729,
"length": null,
"nodeType": "ArrayTypeName",
"src": "15885:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 732,
"mutability": "mutable",
"name": "_bancorX",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15909:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
},
"typeName": {
"contractScope": null,
"id": 731,
"name": "IBancorX",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3551,
"src": "15909:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IBancorX_$3551",
"typeString": "contract IBancorX"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 734,
"mutability": "mutable",
"name": "_conversionId",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15928:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 733,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15928:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 736,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15951:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 735,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "15951:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 738,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "15971:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 737,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15971:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "15884:116:0"
},
"returnParameters": {
"id": 742,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 741,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 778,
"src": "16026:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 740,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16026:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16025:9:0"
},
"scope": 1976,
"src": "15856:607:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 997,
"nodeType": "Block",
"src": "17298:2483:0",
"statements": [
{
"assignments": [
796
],
"declarations": [
{
"constant": false,
"id": 796,
"mutability": "mutable",
"name": "toAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 997,
"src": "17309:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 795,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17309:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 797,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "17309:16:0"
},
{
"assignments": [
799
],
"declarations": [
{
"constant": false,
"id": 799,
"mutability": "mutable",
"name": "fromAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 997,
"src": "17336:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 798,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17336:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 801,
"initialValue": {
"argumentTypes": null,
"id": 800,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 784,
"src": "17357:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17336:28:0"
},
{
"body": {
"id": 986,
"nodeType": "Block",
"src": "17465:2151:0",
"statements": [
{
"assignments": [
814
],
"declarations": [
{
"constant": false,
"id": 814,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 986,
"src": "17480:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 813,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "17480:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 818,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 815,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17513:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 817,
"indexExpression": {
"argumentTypes": null,
"id": 816,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17519:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17513:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "17480:41:0"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 819,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17574:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 820,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "17574:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 864,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 855,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18191:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 856,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18191:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 860,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18235:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 861,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "anchor",
"nodeType": "MemberAccess",
"referencedDeclaration": 48,
"src": "18235:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 859,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18227:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 858,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18227:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 862,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18227:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 857,
"name": "ISmartToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21182,
"src": "18215:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ISmartToken_$21182_$",
"typeString": "type(contract ISmartToken)"
}
},
"id": 863,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18215:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISmartToken_$21182",
"typeString": "contract ISmartToken"
}
},
"src": "18191:61:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 877,
"nodeType": "IfStatement",
"src": "18187:272:0",
"trueBody": {
"id": 876,
"nodeType": "Block",
"src": "18254:205:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 866,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18381:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 867,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18381:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 870,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18411:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 871,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18411:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 869,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18403:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 868,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18403:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 872,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18403:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 873,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18432:10:0",
"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": 865,
"name": "ensureAllowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1511,
"src": "18365:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 874,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18365:78:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 875,
"nodeType": "ExpressionStatement",
"src": "18365:78:0"
}
]
}
},
"id": 878,
"nodeType": "IfStatement",
"src": "17570:889:0",
"trueBody": {
"id": 854,
"nodeType": "Block",
"src": "17607:416:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 841,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 835,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 823,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 821,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17820:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17825:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "17820:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 824,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17830:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 828,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 827,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 825,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17836:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 826,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17840:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "17836:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17830:12:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 829,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "17830:24:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 832,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "17866:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 831,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17858:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 830,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17858:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17858:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "17830:41:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "17820:51:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "17875:34:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 836,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "17876:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 839,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 837,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17888:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 838,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "17888:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17876:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "17820:89:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 853,
"nodeType": "IfStatement",
"src": "17816:191:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 843,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17945:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 844,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "17945:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 847,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "17975:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 848,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "17975:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 846,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "17967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 845,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17967:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 849,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17967:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 850,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "17996:10:0",
"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": 842,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "17932:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 851,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "17932:75:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 852,
"nodeType": "ExpressionStatement",
"src": "17932:75:0"
}
}
]
}
},
{
"condition": {
"argumentTypes": null,
"id": 881,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "18513:32:0",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 879,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18514:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 880,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "18514:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 900,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "18710:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 903,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 901,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18722:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 902,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18722:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "18710:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 937,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 923,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18946:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 927,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18984:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 928,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18984:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 929,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19006:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 930,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19006:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 931,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19028:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 932,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "19040:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 933,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "19040:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 934,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19052:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 935,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "19052:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 924,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18957:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 925,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18957:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 926,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "convert",
"nodeType": "MemberAccess",
"referencedDeclaration": 13228,
"src": "18957:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 936,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18957:116:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18946:127:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 938,
"nodeType": "ExpressionStatement",
"src": "18946:127:0"
},
"id": 939,
"nodeType": "IfStatement",
"src": "18706:367:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 921,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 904,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18762:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 911,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18820:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 912,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18820:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 913,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18842:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 914,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "18842:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 915,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18864:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 916,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "18876:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 917,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18876:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 918,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18888:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 919,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "18888:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 905,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18773:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 906,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18773:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 907,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "convert",
"nodeType": "MemberAccess",
"referencedDeclaration": 13228,
"src": "18773:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 910,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"value"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 908,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "18808:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 909,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "18808:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"src": "18773:46:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_address_$_t_address_payable_$returns$_t_uint256_$value",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,address,address payable) payable external returns (uint256)"
}
},
"id": 920,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18773:136:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18762:147:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 922,
"nodeType": "ExpressionStatement",
"src": "18762:147:0"
}
},
"id": 940,
"nodeType": "IfStatement",
"src": "18509:564:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 898,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 882,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "18564:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 891,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18628:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 892,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "18628:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 893,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18650:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 894,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "18650:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 895,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "18672:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "31",
"id": 896,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18684:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 886,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "18600:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 887,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "18600:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 885,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18592:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 884,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18592:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 888,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18592:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 883,
"name": "ILegacyConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "18575:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ILegacyConverter_$26_$",
"typeString": "type(contract ILegacyConverter)"
}
},
"id": 889,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18575:45:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_ILegacyConverter_$26",
"typeString": "contract ILegacyConverter"
}
},
"id": 890,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "change",
"nodeType": "MemberAccess",
"referencedDeclaration": 25,
"src": "18575:52:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256,uint256) external returns (uint256)"
}
},
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18575:111:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "18564:122:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 899,
"nodeType": "ExpressionStatement",
"src": "18564:122:0"
}
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 941,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19138:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 942,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "processAffiliateFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 58,
"src": "19138:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 968,
"nodeType": "IfStatement",
"src": "19134:308:0",
"trueBody": {
"id": 967,
"nodeType": "Block",
"src": "19168:274:0",
"statements": [
{
"assignments": [
944
],
"declarations": [
{
"constant": false,
"id": 944,
"mutability": "mutable",
"name": "affiliateAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 967,
"src": "19187:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 943,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19187:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 952,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 950,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "19245:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 947,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 790,
"src": "19226:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 945,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19213:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 946,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "19213:12:0",
"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": 948,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19213:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 949,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "19213:31:0",
"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": 951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19213:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "19187:73:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 957,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 788,
"src": "19317:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 958,
"name": "affiliateAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 944,
"src": "19336:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 954,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19287:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 955,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19287:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 956,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": 21106,
"src": "19287:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,uint256) external returns (bool)"
}
},
"id": 959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19287:65:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4645455f5452414e534645525f4641494c4544",
"id": 960,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19354:25:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_adc6d664872bc68defa0e975019744f9c0f552331af13f5f130791cee181d10c",
"typeString": "literal_string \"ERR_FEE_TRANSFER_FAILED\""
},
"value": "ERR_FEE_TRANSFER_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_adc6d664872bc68defa0e975019744f9c0f552331af13f5f130791cee181d10c",
"typeString": "literal_string \"ERR_FEE_TRANSFER_FAILED\""
}
],
"id": 953,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "19279:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19279:101:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 962,
"nodeType": "ExpressionStatement",
"src": "19279:101:0"
},
{
"expression": {
"argumentTypes": null,
"id": 965,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 963,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19399:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"id": 964,
"name": "affiliateAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 944,
"src": "19411:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19399:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 966,
"nodeType": "ExpressionStatement",
"src": "19399:27:0"
}
]
}
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 970,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19474:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 971,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "anchor",
"nodeType": "MemberAccess",
"referencedDeclaration": 48,
"src": "19474:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 972,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19491:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 973,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "19491:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 974,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 814,
"src": "19513:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 975,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "19513:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 976,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19535:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 977,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19547:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 978,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "19557:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 979,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "19557:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 969,
"name": "Conversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 81,
"src": "19463:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IConverterAnchor_$13349_$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$_t_uint256_$_t_address_$returns$__$",
"typeString": "function (contract IConverterAnchor,contract IERC20Token,contract IERC20Token,uint256,uint256,address)"
}
},
"id": 980,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19463:105:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 981,
"nodeType": "EmitStatement",
"src": "19458:110:0"
},
{
"expression": {
"argumentTypes": null,
"id": 984,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 982,
"name": "fromAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "19583:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 983,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19596:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19583:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 985,
"nodeType": "ExpressionStatement",
"src": "19583:21:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 806,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17442:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 807,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 782,
"src": "17446:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 808,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "17446:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "17442:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 987,
"initializationExpression": {
"assignments": [
803
],
"declarations": [
{
"constant": false,
"id": 803,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 987,
"src": "17427:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 802,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17427:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 805,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 804,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "17439:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "17427:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "17460:3:0",
"subExpression": {
"argumentTypes": null,
"id": 810,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 803,
"src": "17460:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 812,
"nodeType": "ExpressionStatement",
"src": "17460:3:0"
},
"nodeType": "ForStatement",
"src": "17422:2194:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 991,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 989,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19700:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 990,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 786,
"src": "19712:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19700:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f52455455524e5f544f4f5f4c4f57",
"id": 992,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19724:20:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
},
"value": "ERR_RETURN_TOO_LOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c3237cc40443cfd1e0e9492ef35b7447eab6349fb6eac5eb1ec626edd3c555aa",
"typeString": "literal_string \"ERR_RETURN_TOO_LOW\""
}
],
"id": 988,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "19692:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 993,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19692:53:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 994,
"nodeType": "ExpressionStatement",
"src": "19692:53:0"
},
{
"expression": {
"argumentTypes": null,
"id": 995,
"name": "toAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 796,
"src": "19765:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 794,
"id": 996,
"nodeType": "Return",
"src": "19758:15:0"
}
]
},
"documentation": {
"id": 779,
"nodeType": "StructuredDocumentation",
"src": "16471:603:0",
"text": " @dev executes the actual conversion by following the conversion path\n @param _data conversion data, see ConversionStep struct above\n @param _amount amount to convert from, in the source token\n @param _minReturn if the conversion results in an amount smaller than the minimum return - it is cancelled, must be greater than zero\n @param _affiliateAccount affiliate account\n @param _affiliateFee affiliate fee in PPM\n @return amount of tokens received from the conversion"
},
"id": 998,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "doConversion",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 791,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 782,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17112:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 780,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "17112:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 781,
"length": null,
"nodeType": "ArrayTypeName",
"src": "17112:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 784,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17152:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 783,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 786,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17178:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 785,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17178:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 788,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17207:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 787,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17207:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 790,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17243:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 789,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17243:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17101:170:0"
},
"returnParameters": {
"id": 794,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 793,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 998,
"src": "17289:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 792,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17289:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17288:9:0"
},
"scope": 1976,
"src": "17080:2701:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1109,
"nodeType": "Block",
"src": "20232:1606:0",
"statements": [
{
"assignments": [
1009
],
"declarations": [
{
"constant": false,
"id": 1009,
"mutability": "mutable",
"name": "firstConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1109,
"src": "20243:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1008,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "20243:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1018,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1013,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1003,
"src": "20290:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 1014,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "20290:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 1015,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20290:15:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1012,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20282:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1011,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20282:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1016,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20282:24:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 1010,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "20271:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 1017,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20271:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20243:64:0"
},
{
"assignments": [
1020
],
"declarations": [
{
"constant": false,
"id": 1020,
"mutability": "mutable",
"name": "isNewerConverter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1109,
"src": "20318:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1019,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "20318:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1024,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1022,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "20365:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1021,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "20342:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1023,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20342:38:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20318:62:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1028,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1025,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20413:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1026,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20413:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1027,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20425:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "20413:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1055,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "20955:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1057,
"indexExpression": {
"argumentTypes": null,
"id": 1056,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "20967:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20955:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1106,
"nodeType": "Block",
"src": "21447:384:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1082,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "21605:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1095,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21770:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1096,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21784:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1097,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21784:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1100,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "21804:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1099,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21796:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1098,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21796:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21796:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1102,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21811:7:0",
"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_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1094,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21753:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1103,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21753:66:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1104,
"nodeType": "ExpressionStatement",
"src": "21753:66:0"
},
"id": 1105,
"nodeType": "IfStatement",
"src": "21601:218:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1084,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21657:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21671:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1086,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21671:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1089,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "21691:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1088,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21683:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1087,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21683:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1090,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21683:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1091,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21708:7:0",
"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_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1083,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21640:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1092,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21640:76:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1093,
"nodeType": "ExpressionStatement",
"src": "21640:76:0"
}
}
]
},
"id": 1107,
"nodeType": "IfStatement",
"src": "20951:880:0",
"trueBody": {
"id": 1081,
"nodeType": "Block",
"src": "20982:420:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1059,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21184:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1060,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "21198:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "21198:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1064,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "21218:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1063,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21210:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1062,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21210:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1065,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21210:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1066,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21225:7:0",
"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_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1058,
"name": "safeTransferFrom",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22525,
"src": "21167:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,address,uint256)"
}
},
"id": 1067,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21167:66:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1068,
"nodeType": "ExpressionStatement",
"src": "21167:66:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1069,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "21303:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1080,
"nodeType": "IfStatement",
"src": "21299:91:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1077,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "21382:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1073,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1001,
"src": "21358:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1072,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21350:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1071,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21350:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1074,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21350:21:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1070,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "21338:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1075,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21338:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1076,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdraw",
"nodeType": "MemberAccess",
"referencedDeclaration": 21140,
"src": "21338:43:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21338:52:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1079,
"nodeType": "ExpressionStatement",
"src": "21338:52:0"
}
}
]
}
},
"id": 1108,
"nodeType": "IfStatement",
"src": "20409:1422:0",
"trueBody": {
"id": 1054,
"nodeType": "Block",
"src": "20428:485:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1033,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1030,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20486:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1031,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20486:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1032,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1005,
"src": "20499:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20486:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4554485f414d4f554e545f4d49534d41544348",
"id": 1034,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20508:25:0",
"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": 1029,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "20478:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 1035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20478:56:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1036,
"nodeType": "ExpressionStatement",
"src": "20478:56:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "20768:17:0",
"subExpression": {
"argumentTypes": null,
"id": 1037,
"name": "isNewerConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1020,
"src": "20769:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1053,
"nodeType": "IfStatement",
"src": "20764:137:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1043,
"name": "firstConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1009,
"src": "20854:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1042,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "20824:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1044,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20824:45:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1041,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20816:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1040,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20816:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1045,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20816:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1039,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "20804:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1046,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20804:67:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1047,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "deposit",
"nodeType": "MemberAccess",
"referencedDeclaration": 21135,
"src": "20804:75:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$__$returns$__$",
"typeString": "function () payable external"
}
},
"id": 1050,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"value"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1048,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "20888:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1049,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20888:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"src": "20804:95:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_payable$__$returns$__$value",
"typeString": "function () payable external"
}
},
"id": 1051,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20804:97:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1052,
"nodeType": "ExpressionStatement",
"src": "20804:97:0"
}
}
]
}
}
]
},
"documentation": {
"id": 999,
"nodeType": "StructuredDocumentation",
"src": "19789:333:0",
"text": " @dev validates msg.value and prepares the conversion source token for the conversion\n @param _sourceToken source token of the first conversion step\n @param _anchor converter anchor of the first conversion step\n @param _amount amount to convert from, in the source token"
},
"id": 1110,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "handleSourceToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1006,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1001,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20155:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1000,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "20155:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1003,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20181:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 1002,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "20181:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1005,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1110,
"src": "20207:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1004,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20207:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20154:69:0"
},
"returnParameters": {
"id": 1007,
"nodeType": "ParameterList",
"parameters": [],
"src": "20232:0:0"
},
"scope": 1976,
"src": "20128:1710:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1173,
"nodeType": "Block",
"src": "22295:780:0",
"statements": [
{
"assignments": [
1122
],
"declarations": [
{
"constant": false,
"id": 1122,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1173,
"src": "22306:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 1121,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "22306:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1129,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1123,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1114,
"src": "22339:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1128,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1124,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1114,
"src": "22345:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1125,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "22345:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22360:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "22345:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22339:23:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22306:56:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1136,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1130,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22444:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1131,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "22444:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1134,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "22476:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1133,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "22468:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1132,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22468:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1135,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22468:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "22444:37:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1138,
"nodeType": "IfStatement",
"src": "22440:63:0",
"trueBody": {
"expression": null,
"functionReturnParameters": 1120,
"id": 1137,
"nodeType": "Return",
"src": "22496:7:0"
}
},
{
"assignments": [
1140
],
"declarations": [
{
"constant": false,
"id": 1140,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1173,
"src": "22515:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1139,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22515:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1143,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1141,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22541:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1142,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "22541:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22515:46:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1144,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "22607:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1146,
"indexExpression": {
"argumentTypes": null,
"id": 1145,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "22619:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22607:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1171,
"nodeType": "Block",
"src": "22993:75:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1166,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "23021:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1167,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1118,
"src": "23034:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1168,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1116,
"src": "23048:7:0",
"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": 1165,
"name": "safeTransfer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22475,
"src": "23008:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23008:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1170,
"nodeType": "ExpressionStatement",
"src": "23008:48:0"
}
]
},
"id": 1172,
"nodeType": "IfStatement",
"src": "22603:465:0",
"trueBody": {
"id": 1164,
"nodeType": "Block",
"src": "22633:315:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "22731:32:0",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1148,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1122,
"src": "22732:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1149,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "22732:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1147,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "22724:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1151,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22724:40:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1152,
"nodeType": "ExpressionStatement",
"src": "22724:40:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1160,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1118,
"src": "22914:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1161,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1116,
"src": "22928:7:0",
"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": 1156,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1140,
"src": "22889:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 1155,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "22881:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1154,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22881:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22881:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1153,
"name": "IEtherToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21153,
"src": "22869:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IEtherToken_$21153_$",
"typeString": "type(contract IEtherToken)"
}
},
"id": 1158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22869:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IEtherToken_$21153",
"typeString": "contract IEtherToken"
}
},
"id": 1159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTo",
"nodeType": "MemberAccess",
"referencedDeclaration": 21152,
"src": "22869:44:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_payable_$_t_uint256_$returns$__$",
"typeString": "function (address payable,uint256) external"
}
},
"id": 1162,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22869:67:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1163,
"nodeType": "ExpressionStatement",
"src": "22869:67:0"
}
]
}
}
]
},
"documentation": {
"id": 1111,
"nodeType": "StructuredDocumentation",
"src": "21846:330:0",
"text": " @dev handles the conversion target token if the network still holds it at the end of the conversion\n @param _data conversion data, see ConversionStep struct above\n @param _amount conversion target amount\n @param _beneficiary wallet to receive the conversion result"
},
"id": 1174,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "handleTargetToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1119,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1114,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22209:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1112,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "22209:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1113,
"length": null,
"nodeType": "ArrayTypeName",
"src": "22209:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1116,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22240:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1115,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22240:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1118,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1174,
"src": "22257:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1117,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22257:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22208:78:0"
},
"returnParameters": {
"id": 1120,
"nodeType": "ParameterList",
"parameters": [],
"src": "22295:0:0"
},
"scope": 1976,
"src": "22182:893:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1467,
"nodeType": "Block",
"src": "23760:4093:0",
"statements": [
{
"assignments": [
1191
],
"declarations": [
{
"constant": false,
"id": 1191,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23771:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1189,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23771:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1190,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23771:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1200,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1195,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "23823:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "23823:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1197,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23848:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "23823:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1194,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "23802:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (struct BancorNetwork.ConversionStep memory[] memory)"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1192,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23806:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1193,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23806:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
}
},
"id": 1199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23802:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23771:79:0"
},
{
"assignments": [
1202
],
"declarations": [
{
"constant": false,
"id": 1202,
"mutability": "mutable",
"name": "affiliateFeeProcessed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23863:26:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1201,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "23863:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1204,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1203,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "23892:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "23863:34:0"
},
{
"assignments": [
1206
],
"declarations": [
{
"constant": false,
"id": 1206,
"mutability": "mutable",
"name": "bntToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "23908:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1205,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23908:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1212,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1209,
"name": "BNT_TOKEN",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21551,
"src": "23953:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1208,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "23943:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 1210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23943:20:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1207,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "23931:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23931:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "23908:56:0"
},
{
"assignments": [
1214
],
"declarations": [
{
"constant": false,
"id": 1214,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "24060:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1213,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "24060:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1215,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "24060:9:0"
},
{
"body": {
"id": 1303,
"nodeType": "Block",
"src": "24132:1199:0",
"statements": [
{
"assignments": [
1231
],
"declarations": [
{
"constant": false,
"id": 1231,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24147:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 1230,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "24147:16:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1239,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1233,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24190:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1237,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1236,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1234,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24206:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1235,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24210:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "24206:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24190:22:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1232,
"name": "IConverterAnchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13349,
"src": "24173:16:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterAnchor_$13349_$",
"typeString": "type(contract IConverterAnchor)"
}
},
"id": 1238,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24173:40:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24147:66:0"
},
{
"assignments": [
1241
],
"declarations": [
{
"constant": false,
"id": 1241,
"mutability": "mutable",
"name": "converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24228:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1240,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "24228:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1250,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1245,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1231,
"src": "24270:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 1246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "24270:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 1247,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24270:14:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1244,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "24262:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1243,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "24262:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1248,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24262:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 1242,
"name": "IConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13340,
"src": "24251:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverter_$13340_$",
"typeString": "type(contract IConverter)"
}
},
"id": 1249,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24251:35:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24228:58:0"
},
{
"assignments": [
1252
],
"declarations": [
{
"constant": false,
"id": 1252,
"mutability": "mutable",
"name": "targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24301:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1251,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "24301:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1260,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1254,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24339:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1258,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1257,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1255,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24355:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1256,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24359:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24355:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24339:22:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1253,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "24327:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24327:35:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24301:61:0"
},
{
"assignments": [
1262
],
"declarations": [
{
"constant": false,
"id": 1262,
"mutability": "mutable",
"name": "processAffiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1303,
"src": "24455:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1261,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "24455:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1271,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1270,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1263,
"name": "_affiliateFeeEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1182,
"src": "24482:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1265,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "24506:22:0",
"subExpression": {
"argumentTypes": null,
"id": 1264,
"name": "affiliateFeeProcessed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1202,
"src": "24507:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "24482:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 1269,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1267,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1252,
"src": "24532:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1268,
"name": "bntToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1206,
"src": "24547:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "24532:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "24482:73:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "24455:100:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1272,
"name": "processAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1262,
"src": "24574:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1277,
"nodeType": "IfStatement",
"src": "24570:70:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1273,
"name": "affiliateFeeProcessed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1202,
"src": "24612:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1274,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24636:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "24612:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1276,
"nodeType": "ExpressionStatement",
"src": "24612:28:0"
}
},
{
"expression": {
"argumentTypes": null,
"id": 1301,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1278,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "24657:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1282,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1281,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1279,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24662:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1280,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24666:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24662:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "24657:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1284,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1231,
"src": "24758:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"id": 1285,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1241,
"src": "24834:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1287,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24938:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1289,
"indexExpression": {
"argumentTypes": null,
"id": 1288,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24954:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "24938:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1286,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "24926:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 1290,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "24926:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1291,
"name": "targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1252,
"src": "24989:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1294,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25134:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1293,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "25126:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1292,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "25126:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1295,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25126:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1297,
"name": "converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1241,
"src": "25234:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1296,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "25211:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1298,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25211:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"id": 1299,
"name": "processAffiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1262,
"src": "25284:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1283,
"name": "ConversionStep",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 59,
"src": "24671:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_ConversionStep_$59_storage_ptr_$",
"typeString": "type(struct BancorNetwork.ConversionStep storage pointer)"
}
},
"id": 1300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"anchor",
"converter",
"sourceToken",
"targetToken",
"beneficiary",
"isV28OrHigherConverter",
"processAffiliateFee"
],
"nodeType": "FunctionCall",
"src": "24671:648:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "24657:662:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1302,
"nodeType": "ExpressionStatement",
"src": "24657:662:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1220,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24092:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1221,
"name": "_conversionPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1178,
"src": "24096:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
"id": 1222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "24096:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1223,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24121:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "24096:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "24092:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1304,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 1218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1216,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24085:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 1217,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24089:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "24085:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1219,
"nodeType": "ExpressionStatement",
"src": "24085:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1228,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1226,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "24124:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "32",
"id": 1227,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "24129:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "24124:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1229,
"nodeType": "ExpressionStatement",
"src": "24124:6:0"
},
"nodeType": "ForStatement",
"src": "24080:1251:0"
},
{
"assignments": [
1306
],
"declarations": [
{
"constant": false,
"id": 1306,
"mutability": "mutable",
"name": "stepData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1467,
"src": "25393:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
},
"typeName": {
"contractScope": null,
"id": 1305,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "25393:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1310,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1307,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25426:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1309,
"indexExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1308,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25431:1:0",
"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": "25426:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "25393:40:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1311,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "25448:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1314,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1312,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25460:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1313,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25460:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25448:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1334,
"nodeType": "IfStatement",
"src": "25444:472:0",
"trueBody": {
"id": 1333,
"nodeType": "Block",
"src": "25483:433:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1315,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25594:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1316,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "25594:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1330,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1323,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25832:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1325,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25832:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1327,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25885:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1328,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "25885:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1326,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "25855:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "25855:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "25832:72:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1331,
"nodeType": "ExpressionStatement",
"src": "25832:72:0"
},
"id": 1332,
"nodeType": "IfStatement",
"src": "25590:314:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1321,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1317,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25644:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1319,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "sourceToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 50,
"src": "25644:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1320,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "25667:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "25644:42:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1322,
"nodeType": "ExpressionStatement",
"src": "25644:42:0"
}
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1335,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "25954:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1336,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25965:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1341,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1340,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1337,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "25970:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1338,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "25970:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1339,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "25984:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "25970:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "25965:21:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "25954:32:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1343,
"nodeType": "ExpressionStatement",
"src": "25954:32:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1344,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "26001:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1347,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1345,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26013:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1346,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26013:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26001:33:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1367,
"nodeType": "IfStatement",
"src": "25997:472:0",
"trueBody": {
"id": 1366,
"nodeType": "Block",
"src": "26036:433:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1348,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26147:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1349,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "26147:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1363,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1356,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26385:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1358,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26385:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1360,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26438:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1361,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "26438:18:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1359,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "26408:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26408:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "26385:72:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1364,
"nodeType": "ExpressionStatement",
"src": "26385:72:0"
},
"id": 1365,
"nodeType": "IfStatement",
"src": "26143:314:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1350,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26197:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1352,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "targetToken",
"nodeType": "MemberAccess",
"referencedDeclaration": 52,
"src": "26197:20:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1353,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "26220:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "26197:42:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1355,
"nodeType": "ExpressionStatement",
"src": "26197:42:0"
}
}
]
}
},
{
"body": {
"id": 1463,
"nodeType": "Block",
"src": "26561:1261:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1379,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26576:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1380,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "26587:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1382,
"indexExpression": {
"argumentTypes": null,
"id": 1381,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26592:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "26587:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"src": "26576:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1384,
"nodeType": "ExpressionStatement",
"src": "26576:18:0"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1385,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26746:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1386,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "26746:31:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1461,
"nodeType": "Block",
"src": "27642:169:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1459,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1449,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27750:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1451,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27750:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1456,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "27789:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1455,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27781:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1454,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27781:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1457,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27781:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1453,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27773:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1452,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27773:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1458,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27773:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27750:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1460,
"nodeType": "ExpressionStatement",
"src": "27750:45:0"
}
]
},
"id": 1462,
"nodeType": "IfStatement",
"src": "26742:1069:0",
"trueBody": {
"id": 1448,
"nodeType": "Block",
"src": "26779:844:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1387,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26902:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1388,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "processAffiliateFee",
"nodeType": "MemberAccess",
"referencedDeclaration": 58,
"src": "26902:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1401,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27106:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1402,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27111:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1403,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "27111:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1404,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27125:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27111:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "27106:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1413,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27310:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1417,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1416,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1414,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27315:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1415,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27319:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27315:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27310:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1418,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isV28OrHigherConverter",
"nodeType": "MemberAccess",
"referencedDeclaration": 56,
"src": "27310:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 1443,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1433,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27562:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1435,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27562:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1440,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "27601:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27593:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1438,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27593:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1441,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27593:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1437,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27585:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1436,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27585:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27585:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27562:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1444,
"nodeType": "ExpressionStatement",
"src": "27562:45:0"
},
"id": 1445,
"nodeType": "IfStatement",
"src": "27306:301:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1419,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27367:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1421,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27367:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1424,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27398:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1428,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1427,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1425,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "27403:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1426,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "27407:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "27403:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "27398:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1429,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "converter",
"nodeType": "MemberAccess",
"referencedDeclaration": 46,
"src": "27398:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1423,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "27390:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1422,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "27390:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1430,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "27390:30:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27367:53:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1432,
"nodeType": "ExpressionStatement",
"src": "27367:53:0"
}
},
"id": 1446,
"nodeType": "IfStatement",
"src": "27102:505:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1411,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1407,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "27149:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1409,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "27149:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1410,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1180,
"src": "27172:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "27149:35:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1412,
"nodeType": "ExpressionStatement",
"src": "27149:35:0"
}
},
"id": 1447,
"nodeType": "IfStatement",
"src": "26898:709:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1389,
"name": "stepData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1306,
"src": "26953:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory"
}
},
"id": 1391,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "beneficiary",
"nodeType": "MemberAccess",
"referencedDeclaration": 54,
"src": "26953:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1396,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "26992:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1395,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26984:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1394,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26984:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1397,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26984:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1393,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "26976:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName": {
"id": 1392,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "26976:8:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "26976:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "26953:45:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1400,
"nodeType": "ExpressionStatement",
"src": "26953:45:0"
}
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1375,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1372,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26539:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1373,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "26543:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"id": 1374,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "26543:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "26539:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1464,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 1370,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1368,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26532:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 1369,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "26536:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "26532:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1371,
"nodeType": "ExpressionStatement",
"src": "26532:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1377,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "26556:3:0",
"subExpression": {
"argumentTypes": null,
"id": 1376,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1214,
"src": "26556:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1378,
"nodeType": "ExpressionStatement",
"src": "26556:3:0"
},
"nodeType": "ForStatement",
"src": "26527:1295:0"
},
{
"expression": {
"argumentTypes": null,
"id": 1465,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1191,
"src": "27841:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep memory[] memory"
}
},
"functionReturnParameters": 1187,
"id": 1466,
"nodeType": "Return",
"src": "27834:11:0"
}
]
},
"documentation": {
"id": 1175,
"nodeType": "StructuredDocumentation",
"src": "23083:503:0",
"text": " @dev creates a memory cache of all conversion steps data to minimize logic and external calls during conversions\n @param _conversionPath conversion path, see conversion path format above\n @param _beneficiary wallet to receive the conversion result\n @param _affiliateFeeEnabled true if affiliate fee was requested by the sender, false if not\n @return cached conversion data to be ingested later on by the conversion flow"
},
"id": 1468,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "createConversionData",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1183,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1178,
"mutability": "mutable",
"name": "_conversionPath",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23622:32:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1176,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23622:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1177,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23622:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1180,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23656:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1179,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "23656:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1182,
"mutability": "mutable",
"name": "_affiliateFeeEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23686:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1181,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "23686:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23621:91:0"
},
"returnParameters": {
"id": 1187,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1186,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1468,
"src": "23735:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_memory_ptr_$dyn_memory_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1184,
"name": "ConversionStep",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 59,
"src": "23735:14:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_ConversionStep_$59_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep"
}
},
"id": 1185,
"length": null,
"nodeType": "ArrayTypeName",
"src": "23735:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_ConversionStep_$59_storage_$dyn_storage_ptr",
"typeString": "struct BancorNetwork.ConversionStep[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23734:25:0"
},
"scope": 1976,
"src": "23592:4261:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1510,
"nodeType": "Block",
"src": "28406:261:0",
"statements": [
{
"assignments": [
1479
],
"declarations": [
{
"constant": false,
"id": 1479,
"mutability": "mutable",
"name": "allowance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1510,
"src": "28417:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1478,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28417:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1488,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1484,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "28462:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_BancorNetwork_$1976",
"typeString": "contract BancorNetwork"
}
],
"id": 1483,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "28454:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1482,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "28454:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1485,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28454:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1486,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28469:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1480,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28437:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 1481,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "allowance",
"nodeType": "MemberAccess",
"referencedDeclaration": 21097,
"src": "28437:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (address,address) view external returns (uint256)"
}
},
"id": 1487,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28437:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28417:61:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1489,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1479,
"src": "28493:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 1490,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1475,
"src": "28505:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28493:18:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1509,
"nodeType": "IfStatement",
"src": "28489:171:0",
"trueBody": {
"id": 1508,
"nodeType": "Block",
"src": "28513:147:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1492,
"name": "allowance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1479,
"src": "28532:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1493,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28544:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "28532:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1501,
"nodeType": "IfStatement",
"src": "28528:68:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1496,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28576:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1497,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28584:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1498,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28594:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1495,
"name": "safeApprove",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22428,
"src": "28564:11:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28564:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1500,
"nodeType": "ExpressionStatement",
"src": "28564:32:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1503,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1471,
"src": "28623:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1504,
"name": "_spender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1473,
"src": "28631:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1505,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1475,
"src": "28641:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1502,
"name": "safeApprove",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22428,
"src": "28611:11:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 1506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28611:37:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1507,
"nodeType": "ExpressionStatement",
"src": "28611:37:0"
}
]
}
}
]
},
"documentation": {
"id": 1469,
"nodeType": "StructuredDocumentation",
"src": "27861:452:0",
"text": " @dev utility, checks whether allowance for the given spender exists and approves one if it doesn't.\n Note that we use the non standard erc-20 interface in which `approve` has no return value so that\n this function will work for both standard and non standard tokens\n @param _token token to check the allowance in\n @param _spender approved address\n @param _value allowance amount"
},
"id": 1511,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "ensureAllowance",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1476,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1471,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28344:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1470,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28344:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1473,
"mutability": "mutable",
"name": "_spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28364:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1472,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "28364:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1475,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1511,
"src": "28382:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1474,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28382:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28343:54:0"
},
"returnParameters": {
"id": 1477,
"nodeType": "ParameterList",
"parameters": [],
"src": "28406:0:0"
},
"scope": 1976,
"src": "28319:348:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1551,
"nodeType": "Block",
"src": "28848:352:0",
"statements": [
{
"assignments": [
1519
],
"declarations": [
{
"constant": false,
"id": 1519,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1551,
"src": "28859:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1518,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28859:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1523,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 1520,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1513,
"src": "28882:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 1521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectorTokenCount",
"nodeType": "MemberAccess",
"referencedDeclaration": 13339,
"src": "28882:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint16_$",
"typeString": "function () view external returns (uint16)"
}
},
"id": 1522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "28882:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28859:55:0"
},
{
"body": {
"id": 1547,
"nodeType": "Block",
"src": "28968:186:0",
"statements": [
{
"assignments": [
1535
],
"declarations": [
{
"constant": false,
"id": 1535,
"mutability": "mutable",
"name": "reserveTokenAddress",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1547,
"src": "28983:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1534,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28983:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1540,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1538,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "29044:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1536,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1513,
"src": "29017:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 1537,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "connectorTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 13334,
"src": "29017:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (uint256) view external returns (contract IERC20Token)"
}
},
"id": 1539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29017:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "28983:63:0"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1541,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "29065:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1543,
"indexExpression": {
"argumentTypes": null,
"id": 1542,
"name": "reserveTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1535,
"src": "29077:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29065:32:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1546,
"nodeType": "IfStatement",
"src": "29061:81:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1544,
"name": "reserveTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1535,
"src": "29123:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1517,
"id": 1545,
"nodeType": "Return",
"src": "29116:26:0"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1528,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "28945:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 1529,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1519,
"src": "28949:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "28945:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1548,
"initializationExpression": {
"assignments": [
1525
],
"declarations": [
{
"constant": false,
"id": 1525,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1548,
"src": "28930:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1524,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "28930:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1527,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1526,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "28942:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "28930:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1532,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "28963:3:0",
"subExpression": {
"argumentTypes": null,
"id": 1531,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1525,
"src": "28963:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1533,
"nodeType": "ExpressionStatement",
"src": "28963:3:0"
},
"nodeType": "ForStatement",
"src": "28925:229:0"
},
{
"expression": {
"argumentTypes": null,
"id": 1549,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "29173:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1517,
"id": 1550,
"nodeType": "Return",
"src": "29166:26:0"
}
]
},
"documentation": null,
"id": 1552,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConverterEtherTokenAddress",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1514,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1513,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1552,
"src": "28790:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1512,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "28790:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28789:23:0"
},
"returnParameters": {
"id": 1517,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1516,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1552,
"src": "28835:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1515,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "28835:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "28834:13:0"
},
"scope": 1976,
"src": "28751:449:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 1578,
"nodeType": "Block",
"src": "29474:224:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1564,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "29489:20:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1561,
"name": "etherTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "29490:11:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_bool_$",
"typeString": "mapping(contract IERC20Token => bool)"
}
},
"id": 1563,
"indexExpression": {
"argumentTypes": null,
"id": 1562,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1556,
"src": "29502:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "29490:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1567,
"nodeType": "IfStatement",
"src": "29485:52:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1565,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1556,
"src": "29531:6:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1566,
"nodeType": "Return",
"src": "29524:13:0"
}
},
{
"condition": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1569,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1554,
"src": "29577:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1568,
"name": "isV28OrHigherConverter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1719,
"src": "29554:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_bool_$",
"typeString": "function (contract IConverter) view returns (bool)"
}
},
"id": 1570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29554:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1573,
"nodeType": "IfStatement",
"src": "29550:79:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 1571,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "29610:19:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1572,
"nodeType": "Return",
"src": "29603:26:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1575,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1554,
"src": "29679:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1574,
"name": "getConverterEtherTokenAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1552,
"src": "29649:29:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IConverter_$13340_$returns$_t_contract$_IERC20Token_$21127_$",
"typeString": "function (contract IConverter) view returns (contract IERC20Token)"
}
},
"id": 1576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29649:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 1560,
"id": 1577,
"nodeType": "Return",
"src": "29642:48:0"
}
]
},
"documentation": null,
"id": 1579,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConverterTokenAddress",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1557,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1554,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29396:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1553,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "29396:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1556,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29419:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1555,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29419:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29395:43:0"
},
"returnParameters": {
"id": 1560,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1559,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1579,
"src": "29461:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1558,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29461:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29460:13:0"
},
"scope": 1976,
"src": "29362:336:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"constant": true,
"id": 1587,
"mutability": "constant",
"name": "GET_RETURN_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "29706:106:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1580,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "29706:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "67657452657475726e28616464726573732c616464726573732c75696e7432353629",
"id": 1584,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "29774:36:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_1e1401f8329fe5eb5c7e76277d3c971ffeee3a41a0eef7c00afeb0a286cef0af",
"typeString": "literal_string \"getReturn(address,address,uint256)\""
},
"value": "getReturn(address,address,uint256)"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_1e1401f8329fe5eb5c7e76277d3c971ffeee3a41a0eef7c00afeb0a286cef0af",
"typeString": "literal_string \"getReturn(address,address,uint256)\""
}
],
"id": 1583,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "29764:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 1585,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29764:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1582,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "29757:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 1581,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "29757:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1586,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "29757:55:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 1663,
"nodeType": "Block",
"src": "30036:523:0",
"statements": [
{
"assignments": [
1603
],
"declarations": [
{
"constant": false,
"id": 1603,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30047:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1602,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30047:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1611,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1606,
"name": "GET_RETURN_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1587,
"src": "30090:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
{
"argumentTypes": null,
"id": 1607,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1591,
"src": "30116:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1608,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1593,
"src": "30130:12:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 1609,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1595,
"src": "30144:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1604,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30067:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1605,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30067:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 1610,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30067:85:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30047:105:0"
},
{
"assignments": [
1613,
1615
],
"declarations": [
{
"constant": false,
"id": 1613,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30164:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1612,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "30164:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1615,
"mutability": "mutable",
"name": "returnData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1663,
"src": "30178:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1614,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30178:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1623,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1621,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1603,
"src": "30231:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1618,
"name": "_dest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1589,
"src": "30213:5:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1617,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30205:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1616,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "30205:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30205:14:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1620,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30205:25:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30205:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30163:73:0"
},
{
"condition": {
"argumentTypes": null,
"id": 1624,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1613,
"src": "30253:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1658,
"nodeType": "IfStatement",
"src": "30249:277:0",
"trueBody": {
"id": 1657,
"nodeType": "Block",
"src": "30262:264:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1628,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1625,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30281:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1626,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30281:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3634",
"id": 1627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30302:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_64_by_1",
"typeString": "int_const 64"
},
"value": "64"
},
"src": "30281:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1640,
"nodeType": "IfStatement",
"src": "30277:113:0",
"trueBody": {
"id": 1639,
"nodeType": "Block",
"src": "30306:84:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1631,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30343:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1633,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30356:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1632,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30356:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
{
"argumentTypes": null,
"id": 1635,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30365:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1634,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30365:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1636,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30355:18:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$",
"typeString": "tuple(type(uint256),type(uint256))"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_tuple$_t_type$_t_uint256_$_$_t_type$_t_uint256_$_$",
"typeString": "tuple(type(uint256),type(uint256))"
}
],
"expression": {
"argumentTypes": null,
"id": 1629,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30332:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1630,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30332:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1637,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30332:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 1601,
"id": 1638,
"nodeType": "Return",
"src": "30325:49:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1641,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30410:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1642,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30410:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 1643,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30431:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "30410:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1656,
"nodeType": "IfStatement",
"src": "30406:109:0",
"trueBody": {
"id": 1655,
"nodeType": "Block",
"src": "30435:80:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1647,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1615,
"src": "30473:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1649,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30486:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 1648,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30486:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1650,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30485:9:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
}
],
"expression": {
"argumentTypes": null,
"id": 1645,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30462:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1646,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30462:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30462:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1652,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30497:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1653,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30461:38:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 1601,
"id": 1654,
"nodeType": "Return",
"src": "30454:45:0"
}
]
}
}
]
}
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1659,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30546:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1660,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30549:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1661,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "30545:6:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_rational_0_by_1_$_t_rational_0_by_1_$",
"typeString": "tuple(int_const 0,int_const 0)"
}
},
"functionReturnParameters": 1601,
"id": 1662,
"nodeType": "Return",
"src": "30538:13:0"
}
]
},
"documentation": null,
"id": 1664,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1596,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1589,
"mutability": "mutable",
"name": "_dest",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29908:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1588,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "29908:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1591,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29926:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1590,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29926:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1593,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29952:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 1592,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "29952:11:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1595,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "29978:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1594,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "29978:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "29907:87:0"
},
"returnParameters": {
"id": 1601,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1598,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "30018:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1597,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30018:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1600,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1664,
"src": "30027:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1599,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "30027:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30017:18:0"
},
"scope": 1976,
"src": "29889:670:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"constant": true,
"id": 1672,
"mutability": "constant",
"name": "IS_V28_OR_HIGHER_FUNC_SELECTOR",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1976,
"src": "30567:93:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1665,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "30567:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "69735632384f724869676865722829",
"id": 1669,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "30641:17:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d260529c8620a59d78f2e58cfd1294673bb6cba228ad1f34ac7731003ab870dd",
"typeString": "literal_string \"isV28OrHigher()\""
},
"value": "isV28OrHigher()"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_d260529c8620a59d78f2e58cfd1294673bb6cba228ad1f34ac7731003ab870dd",
"typeString": "literal_string \"isV28OrHigher()\""
}
],
"id": 1668,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "30631:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 1670,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30631:28:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 1667,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "30624:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes4_$",
"typeString": "type(bytes4)"
},
"typeName": {
"id": 1666,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "30624:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1671,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30624:36:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "private"
},
{
"body": {
"id": 1718,
"nodeType": "Block",
"src": "30917:336:0",
"statements": [
{
"assignments": [
1680
],
"declarations": [
{
"constant": false,
"id": 1680,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "30928:17:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1679,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "30928:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1685,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1683,
"name": "IS_V28_OR_HIGHER_FUNC_SELECTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1672,
"src": "30971:30:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
],
"expression": {
"argumentTypes": null,
"id": 1681,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "30948:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1682,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodeWithSelector",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "30948:22:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes4) pure returns (bytes memory)"
}
},
"id": 1684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "30948:54:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "30928:74:0"
},
{
"assignments": [
1687,
1689
],
"declarations": [
{
"constant": false,
"id": 1687,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "31014:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1686,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "31014:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1689,
"mutability": "mutable",
"name": "returnData",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1718,
"src": "31028:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1688,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "31028:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1699,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1697,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1680,
"src": "31099:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1692,
"name": "_converter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1674,
"src": "31063:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
],
"id": 1691,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31055:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1690,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31055:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1693,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31055:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 1694,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31055:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1696,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"gas"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"argumentTypes": null,
"hexValue": "34303030",
"id": 1695,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31092:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_4000_by_1",
"typeString": "int_const 4000"
},
"value": "4000"
}
],
"src": "31055:43:0",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$gas",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 1698,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31055:49:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "31013:91:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1700,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1687,
"src": "31121:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1701,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1689,
"src": "31132:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 1702,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31132:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3332",
"id": 1703,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31153:2:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "31132:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "31121:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1715,
"nodeType": "IfStatement",
"src": "31117:104:0",
"trueBody": {
"id": 1714,
"nodeType": "Block",
"src": "31157:64:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1708,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1689,
"src": "31190:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 1710,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31203:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
},
"typeName": {
"id": 1709,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "31203:4:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 1711,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31202:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_bool_$",
"typeString": "type(bool)"
}
],
"expression": {
"argumentTypes": null,
"id": 1706,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "31179:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 1707,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "31179:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31179:30:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1678,
"id": 1713,
"nodeType": "Return",
"src": "31172:37:0"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1716,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31240:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 1678,
"id": 1717,
"nodeType": "Return",
"src": "31233:12:0"
}
]
},
"documentation": null,
"id": 1719,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isV28OrHigherConverter",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1675,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1674,
"mutability": "mutable",
"name": "_converter",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1719,
"src": "30865:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
},
"typeName": {
"contractScope": null,
"id": 1673,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "30865:10:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30864:23:0"
},
"returnParameters": {
"id": 1678,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1677,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1719,
"src": "30911:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1676,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "30911:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "30910:6:0"
},
"scope": 1976,
"src": "30833:420:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 1739,
"nodeType": "Block",
"src": "31432:57:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1733,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1723,
"src": "31462:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1734,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1725,
"src": "31469:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1732,
"name": "rateByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 462,
"src": "31451:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256) view returns (uint256)"
}
},
"id": 1735,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31451:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1736,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31479:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"id": 1737,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "31450:31:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_rational_0_by_1_$",
"typeString": "tuple(uint256,int_const 0)"
}
},
"functionReturnParameters": 1731,
"id": 1738,
"nodeType": "Return",
"src": "31443:38:0"
}
]
},
"documentation": {
"id": 1720,
"nodeType": "StructuredDocumentation",
"src": "31261:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "0c8496cc",
"id": 1740,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturnByPath",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1726,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1723,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31352:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1721,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31352:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1722,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31352:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1725,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31376:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1724,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31376:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31351:41:0"
},
"returnParameters": {
"id": 1731,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1728,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31414:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1727,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31414:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1730,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1740,
"src": "31423:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1729,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31423:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31413:18:0"
},
"scope": 1976,
"src": "31327:162:0",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1768,
"nodeType": "Block",
"src": "31674:94:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1754,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1744,
"src": "31706:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1755,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1746,
"src": "31713:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1756,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1748,
"src": "31722:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1759,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31742:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1758,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31734:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1757,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31734:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1760,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31734:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1763,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31754:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1762,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "31746:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1761,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31746:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1764,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31746:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1765,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "31758:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1753,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "31692:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "31692:68:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1752,
"id": 1767,
"nodeType": "Return",
"src": "31685:75:0"
}
]
},
"documentation": {
"id": 1741,
"nodeType": "StructuredDocumentation",
"src": "31497:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "f3898a97",
"id": 1769,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1749,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1744,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31580:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1742,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31580:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1743,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31580:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1746,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31604:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1745,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31604:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1748,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31621:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1747,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31621:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31579:61:0"
},
"returnParameters": {
"id": 1752,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1751,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1769,
"src": "31665:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1750,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31665:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31664:9:0"
},
"scope": 1976,
"src": "31563:205:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1798,
"nodeType": "Block",
"src": "32088:113:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1787,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1773,
"src": "32120:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1788,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1775,
"src": "32127:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1789,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1777,
"src": "32136:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1792,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32156:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1791,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32148:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1790,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32148:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1793,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32148:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1794,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1779,
"src": "32160:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1795,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "32179:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1786,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32106:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1796,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32106:87:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1785,
"id": 1797,
"nodeType": "Return",
"src": "32099:94:0"
}
]
},
"documentation": {
"id": 1770,
"nodeType": "StructuredDocumentation",
"src": "31776:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "569706eb",
"id": 1799,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1782,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1773,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31870:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1771,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31870:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1772,
"length": null,
"nodeType": "ArrayTypeName",
"src": "31870:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1775,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31903:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1774,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31903:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1777,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31929:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1776,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31929:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1779,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31958:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1778,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "31958:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1781,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "31994:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1780,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "31994:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "31859:163:0"
},
"returnParameters": {
"id": 1785,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1784,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1799,
"src": "32074:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1783,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32074:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32073:9:0"
},
"scope": 1976,
"src": "31842:359:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1826,
"nodeType": "Block",
"src": "32419:96:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1815,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1803,
"src": "32451:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1816,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1805,
"src": "32458:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1817,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1807,
"src": "32467:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1818,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1809,
"src": "32479:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1821,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32501:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1820,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "32493:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1819,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32493:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1822,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32493:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1823,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "32505:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1814,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32437:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32437:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1813,
"id": 1825,
"nodeType": "Return",
"src": "32430:77:0"
}
]
},
"documentation": {
"id": 1800,
"nodeType": "StructuredDocumentation",
"src": "32209:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "c98fefed",
"id": 1827,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "convertFor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1803,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32295:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1801,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32295:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1802,
"length": null,
"nodeType": "ArrayTypeName",
"src": "32295:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1805,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32319:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32319:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1807,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32336:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1806,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32336:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1809,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32356:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1808,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32356:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32294:91:0"
},
"returnParameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1812,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1827,
"src": "32410:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1811,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32410:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32409:9:0"
},
"scope": 1976,
"src": "32275:240:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1858,
"nodeType": "Block",
"src": "32914:115:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1850,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1831,
"src": "32946:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1851,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1833,
"src": "32953:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1852,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1835,
"src": "32962:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1853,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1837,
"src": "32974:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1854,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1839,
"src": "32988:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1855,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1841,
"src": "33007:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1849,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "32932:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1856,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "32932:89:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1848,
"id": 1857,
"nodeType": "Return",
"src": "32925:96:0"
}
]
},
"documentation": {
"id": 1828,
"nodeType": "StructuredDocumentation",
"src": "32523:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "ab6214ce",
"id": 1859,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 1844,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1835,
"src": "32870:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 1845,
"modifierName": {
"argumentTypes": null,
"id": 1843,
"name": "greaterThanZero",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22595,
"src": "32854:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint256_$",
"typeString": "modifier (uint256)"
}
},
"nodeType": "ModifierInvocation",
"src": "32854:27:0"
}
],
"name": "convertFor2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1842,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1831,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32620:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1829,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32620:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1830,
"length": null,
"nodeType": "ArrayTypeName",
"src": "32620:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1833,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32653:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1832,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32653:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1835,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32679:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1834,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32679:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1837,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32708:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1836,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32708:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1839,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32747:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1838,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "32747:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1841,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32783:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1840,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32783:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32609:202:0"
},
"returnParameters": {
"id": 1848,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1847,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1859,
"src": "32900:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1846,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "32900:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "32899:9:0"
},
"scope": 1976,
"src": "32589:440:0",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1887,
"nodeType": "Block",
"src": "33214:94:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1873,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1863,
"src": "33246:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1874,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1865,
"src": "33253:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1875,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1867,
"src": "33262:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1878,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33282:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1877,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33274:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1876,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33274:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1879,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33274:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1882,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33294:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1881,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33286:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1880,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33286:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1883,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33286:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1884,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33298:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1872,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33232:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33232:68:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1871,
"id": 1886,
"nodeType": "Return",
"src": "33225:75:0"
}
]
},
"documentation": {
"id": 1860,
"nodeType": "StructuredDocumentation",
"src": "33037:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "c7ba24bc",
"id": 1888,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1868,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1863,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33128:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1861,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33128:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1862,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33128:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1865,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33152:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1864,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33152:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1867,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33169:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1866,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33169:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33127:61:0"
},
"returnParameters": {
"id": 1871,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1870,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1888,
"src": "33205:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1869,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33205:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33204:9:0"
},
"scope": 1976,
"src": "33103:205:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1917,
"nodeType": "Block",
"src": "33619:113:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1906,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1892,
"src": "33651:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1907,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1894,
"src": "33658:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1908,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1896,
"src": "33667:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1911,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "33687:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1910,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "33679:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1909,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33679:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1912,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33679:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1913,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1898,
"src": "33691:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1914,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1900,
"src": "33710:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1905,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33637:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1915,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33637:87:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1904,
"id": 1916,
"nodeType": "Return",
"src": "33630:94:0"
}
]
},
"documentation": {
"id": 1889,
"nodeType": "StructuredDocumentation",
"src": "33316:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "e57738e5",
"id": 1918,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvert2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1901,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1892,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33418:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1890,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33418:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1891,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33418:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1894,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33451:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1893,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33451:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1896,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33477:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1895,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33477:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1898,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33506:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1897,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33506:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1900,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33542:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1899,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33542:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33407:163:0"
},
"returnParameters": {
"id": 1904,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1903,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1918,
"src": "33605:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1902,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33605:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33604:9:0"
},
"scope": 1976,
"src": "33382:350:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1945,
"nodeType": "Block",
"src": "33950:96:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1934,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1922,
"src": "33982:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1935,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1924,
"src": "33989:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1936,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1926,
"src": "33998:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1937,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1928,
"src": "34010:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1940,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "34032:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1939,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "34024:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 1938,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34024:7:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 1941,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34024:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"hexValue": "30",
"id": 1942,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "34036:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1933,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "33968:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1943,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "33968:70:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1932,
"id": 1944,
"nodeType": "Return",
"src": "33961:77:0"
}
]
},
"documentation": {
"id": 1919,
"nodeType": "StructuredDocumentation",
"src": "33740:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "b1e9932b",
"id": 1946,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvertFor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1929,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1922,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33834:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1920,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33834:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1921,
"length": null,
"nodeType": "ArrayTypeName",
"src": "33834:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1924,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33858:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1923,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33858:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1926,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33875:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1925,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33875:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1928,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33895:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1927,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "33895:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33833:91:0"
},
"returnParameters": {
"id": 1932,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1931,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1946,
"src": "33941:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1930,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "33941:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "33940:9:0"
},
"scope": 1976,
"src": "33806:240:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1974,
"nodeType": "Block",
"src": "34399:115:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1966,
"name": "_path",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1950,
"src": "34431:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
}
},
{
"argumentTypes": null,
"id": 1967,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1952,
"src": "34438:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1968,
"name": "_minReturn",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1954,
"src": "34447:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 1969,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1956,
"src": "34459:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 1970,
"name": "_affiliateAccount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1958,
"src": "34473:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 1971,
"name": "_affiliateFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1960,
"src": "34492:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[] memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 1965,
"name": "convertByPath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 598,
"src": "34417:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_array$_t_address_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_address_payable_$_t_address_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (address[] memory,uint256,uint256,address payable,address,uint256) returns (uint256)"
}
},
"id": 1972,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "34417:89:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1964,
"id": 1973,
"nodeType": "Return",
"src": "34410:96:0"
}
]
},
"documentation": {
"id": 1947,
"nodeType": "StructuredDocumentation",
"src": "34054:60:0",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "2978c10e",
"id": 1975,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "claimAndConvertFor2",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1961,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1950,
"mutability": "mutable",
"name": "_path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34159:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_memory_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1948,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34159:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1949,
"length": null,
"nodeType": "ArrayTypeName",
"src": "34159:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1952,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34192:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1951,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34192:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1954,
"mutability": "mutable",
"name": "_minReturn",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34218:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1953,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34218:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1956,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34247:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 1955,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34247:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1958,
"mutability": "mutable",
"name": "_affiliateAccount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34286:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1957,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "34286:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1960,
"mutability": "mutable",
"name": "_affiliateFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34322:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1959,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34322:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34148:202:0"
},
"returnParameters": {
"id": 1964,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1963,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "34385:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1962,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "34385:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "34384:9:0"
},
"scope": 1976,
"src": "34120:394:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 1977,
"src": "1956:32561:0"
}
],
"src": "52:34467:0"
},
"compiler": {
"name": "solc",
"version": "0.6.12+commit.27d51765.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-10-20T08:24:47.639Z",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}