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

28012 lines
1.1 MiB
JSON
Raw Normal View History

2021-02-01 18:12:51 +01:00
{
"contractName": "ConverterBase",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": true,
"internalType": "contract IConverterAnchor",
"name": "_anchor",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "_activated",
"type": "bool"
}
],
"name": "Activation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_fromToken",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_toToken",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_trader",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_return",
"type": "uint256"
},
{
"indexed": false,
"internalType": "int256",
"name": "_conversionFee",
"type": "int256"
}
],
"name": "Conversion",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "_prevFee",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint32",
"name": "_newFee",
"type": "uint32"
}
],
"name": "ConversionFeeUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_prevOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "OwnerUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_token1",
"type": "address"
},
{
"indexed": true,
"internalType": "contract IERC20Token",
"name": "_token2",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_rateN",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_rateD",
"type": "uint256"
}
],
"name": "TokenRateUpdate",
"type": "event"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "anchor",
"outputs": [
{
"internalType": "contract IConverterAnchor",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionFee",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionWhitelist",
"outputs": [
{
"internalType": "contract IWhitelist",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "conversionsEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxConversionFee",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "newOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "onlyOwnerCanUpdateRegistry",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "prevRegistry",
"outputs": [
{
"internalType": "contract IContractRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "registry",
"outputs": [
{
"internalType": "contract IContractRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "reserveRatio",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "reserveTokens",
"outputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"name": "reserves",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "weight",
"type": "uint32"
},
{
"internalType": "bool",
"name": "deprecated1",
"type": "bool"
},
{
"internalType": "bool",
"name": "deprecated2",
"type": "bool"
},
{
"internalType": "bool",
"name": "isSet",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "restoreRegistry",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_onlyOwnerCanUpdateRegistry",
"type": "bool"
}
],
"name": "restrictRegistryUpdate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "updateRegistry",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"inputs": [],
"name": "converterType",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "targetAmountAndFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_to",
"type": "address"
}
],
"name": "withdrawETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "isV28OrHigher",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IWhitelist",
"name": "_whitelist",
"type": "address"
}
],
"name": "setConversionWhitelist",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "isActive",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferAnchorOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "acceptAnchorOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawFromAnchor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_conversionFee",
"type": "uint32"
}
],
"name": "setConversionFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawTokens",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "reserveTokenCount",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_token",
"type": "address"
},
{
"internalType": "uint32",
"name": "_weight",
"type": "uint32"
}
],
"name": "addReserve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
}
],
"name": "reserveWeight",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_reserveToken",
"type": "address"
}
],
"name": "reserveBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hasETHReserve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_trader",
"type": "address"
},
{
"internalType": "address payable",
"name": "_beneficiary",
"type": "address"
}
],
"name": "convert",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IConverterAnchor",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newOwner",
"type": "address"
}
],
"name": "transferTokenOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "acceptTokenOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_address",
"type": "address"
}
],
"name": "connectors",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "",
"type": "uint32"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_index",
"type": "uint256"
}
],
"name": "connectorTokens",
"outputs": [
{
"internalType": "contract IERC20Token",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "connectorTokenCount",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_connectorToken",
"type": "address"
}
],
"name": "getConnectorBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20Token",
"name": "_sourceToken",
"type": "address"
},
{
"internalType": "contract IERC20Token",
"name": "_targetToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "getReturn",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IConverterAnchor\",\"name\":\"_anchor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_activated\",\"type\":\"bool\"}],\"name\":\"Activation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_fromToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_toToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_trader\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_return\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_conversionFee\",\"type\":\"int256\"}],\"name\":\"Conversion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"_prevFee\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"_newFee\",\"type\":\"uint32\"}],\"name\":\"ConversionFeeUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_prevOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_token1\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IERC20Token\",\"name\":\"_token2\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_rateN\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_rateD\",\"type\":\"uint256\"}],\"name\":\"TokenRateUpdate\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptAnchorOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptTokenOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_weight\",\"type\":\"uint32\"}],\"name\":\"addReserve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"anchor\",\"outputs\":[{\"internalType\":\"contract IConverterAnchor\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"connectorTokenCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"connectorTokens\",\"outputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20Token\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"connectors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionFee\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionWhi
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\r\npragma solidity 0.6.12;\r\nimport \"./interfaces/IConverter.sol\";\r\nimport \"./interfaces/IConverterAnchor.sol\";\r\nimport \"./interfaces/IConverterUpgrader.sol\";\r\nimport \"./interfaces/IBancorFormula.sol\";\r\nimport \"../utility/ContractRegistryClient.sol\";\r\nimport \"../utility/ReentrancyGuard.sol\";\r\nimport \"../utility/SafeMath.sol\";\r\nimport \"../utility/TokenHandler.sol\";\r\nimport \"../utility/TokenHolder.sol\";\r\nimport \"../token/interfaces/IEtherToken.sol\";\r\nimport \"../bancorx/interfaces/IBancorX.sol\";\r\n\r\n/**\r\n * @dev ConverterBase\r\n *\r\n * The converter contains the main logic for conversions between different ERC20 tokens.\r\n *\r\n * It is also the upgradable part of the mechanism (note that upgrades are opt-in).\r\n *\r\n * The anchor must be set on construction and cannot be changed afterwards.\r\n * Wrappers are provided for some of the anchor's functions, for easier access.\r\n *\r\n * Once the converter accepts ownership of the anchor, it becomes the anchor's sole controller\r\n * and can execute any of its functions.\r\n *\r\n * To upgrade the converter, anchor ownership must be transferred to a new converter, along with\r\n * any relevant data.\r\n *\r\n * Note that the converter can transfer anchor ownership to a new converter that\r\n * doesn't allow upgrades anymore, for finalizing the relationship between the converter\r\n * and the anchor.\r\n *\r\n * Converter types (defined as uint16 type) -\r\n * 0 = liquid token converter\r\n * 1 = liquidity pool v1 converter\r\n * 2 = liquidity pool v2 converter\r\n *\r\n * Note that converters don't currently support tokens with transfer fees.\r\n*/\r\nabstract contract ConverterBase is IConverter, TokenHandler, TokenHolder, ContractRegistryClient, ReentrancyGuard {\r\n using SafeMath for uint256;\r\n\r\n uint32 internal constant PPM_RESOLUTION = 1000000;\r\n IERC20Token internal constant ETH_RESERVE_ADDRESS = IERC20Token(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);\r\n\r\n struct Reserve {\r\n uint256 balance; // reserve balance\r\n uint32 weight; // reserve weight, represented in ppm, 1-1000000\r\n bool deprecated1; // deprecated\r\n bool deprecated2; // deprecated\r\n bool isSet; // true if the reserve is valid, false otherwise\r\n }\r\n\r\n /**\r\n * @dev version number\r\n */\r\n uint16 public constant version = 39;\r\n\r\n IConverterAnchor public override anchor; // converter anchor contract\r\n IWhitelist public override conversionWhitelist; // whitelist contract with list of addresses that are allowed to use the converter\r\n IERC20Token[] public reserveTokens; // ERC20 standard token addresses (prior version 17, use 'connectorTokens' instead)\r\n mapping (IERC20Token => Reserve) public reserves; // reserve token addresses -> reserve data (prior version 17, use 'connectors' instead)\r\n uint32 public reserveRatio = 0; // ratio between the reserves and the market cap, equal to the total reserve weights\r\n uint32 public override maxConversionFee = 0; // maximum conversion fee for the lifetime of the contract,\r\n // represented in ppm, 0...1000000 (0 = no fee, 100 = 0.01%, 1000000 = 100%)\r\n uint32 public override conversionFee = 0; // current conversion fee, represented in ppm, 0...maxConversionFee\r\n bool public constant conversionsEnabled = true; // deprecated, backward compatibility\r\n\r\n /**\r\n * @dev triggered when the converter is activated\r\n *\r\n * @param _type converter type\r\n * @param _anchor converter anchor\r\n * @param _activated true if the converter was activated, false if it was deactivated\r\n */\r\n event Activation(uint16 indexed _type, IConverterAnchor indexed _anchor, bool indexed _activated);\r\n\r\n /**\r\n * @
"sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol",
"ast": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol",
"exportedSymbols": {
"ConverterBase": [
10039
]
},
"id": 10040,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8979,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:8"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverter.sol",
"file": "./interfaces/IConverter.sol",
"id": 8980,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13341,
"src": "77:37:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterAnchor.sol",
"file": "./interfaces/IConverterAnchor.sol",
"id": 8981,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13350,
"src": "116:43:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterUpgrader.sol",
"file": "./interfaces/IConverterUpgrader.sol",
"id": 8982,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13661,
"src": "161:45:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol",
"file": "./interfaces/IBancorFormula.sol",
"id": 8983,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13178,
"src": "208:41:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ContractRegistryClient.sol",
"file": "../utility/ContractRegistryClient.sol",
"id": 8984,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 21720,
"src": "251:47:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol",
"file": "../utility/ReentrancyGuard.sol",
"id": 8985,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22243,
"src": "300:40:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/SafeMath.sol",
"file": "../utility/SafeMath.sol",
"id": 8986,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22355,
"src": "342:33:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol",
"file": "../utility/TokenHandler.sol",
"id": 8987,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22527,
"src": "377:37:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHolder.sol",
"file": "../utility/TokenHolder.sol",
"id": 8988,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22576,
"src": "416:36:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IEtherToken.sol",
"file": "../token/interfaces/IEtherToken.sol",
"id": 8989,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 21154,
"src": "454:45:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/bancorx/interfaces/IBancorX.sol",
"file": "../bancorx/interfaces/IBancorX.sol",
"id": 8990,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 3552,
"src": "501:44:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8992,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "1683:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 8993,
"nodeType": "InheritanceSpecifier",
"src": "1683:10:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8994,
"name": "TokenHandler",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22526,
"src": "1695:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHandler_$22526",
"typeString": "contract TokenHandler"
}
},
"id": 8995,
"nodeType": "InheritanceSpecifier",
"src": "1695:12:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8996,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "1709:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
},
"id": 8997,
"nodeType": "InheritanceSpecifier",
"src": "1709:11:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8998,
"name": "ContractRegistryClient",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21719,
"src": "1722:22:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ContractRegistryClient_$21719",
"typeString": "contract ContractRegistryClient"
}
},
"id": 8999,
"nodeType": "InheritanceSpecifier",
"src": "1722:22:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 9000,
"name": "ReentrancyGuard",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22242,
"src": "1746:15:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ReentrancyGuard_$22242",
"typeString": "contract ReentrancyGuard"
}
},
"id": 9001,
"nodeType": "InheritanceSpecifier",
"src": "1746:15:8"
}
],
"contractDependencies": [
13340,
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 8991,
"nodeType": "StructuredDocumentation",
"src": "549:1097:8",
"text": " @dev ConverterBase\n The converter contains the main logic for conversions between different ERC20 tokens.\n It is also the upgradable part of the mechanism (note that upgrades are opt-in).\n The anchor must be set on construction and cannot be changed afterwards.\n Wrappers are provided for some of the anchor's functions, for easier access.\n Once the converter accepts ownership of the anchor, it becomes the anchor's sole controller\n and can execute any of its functions.\n To upgrade the converter, anchor ownership must be transferred to a new converter, along with\n any relevant data.\n Note that the converter can transfer anchor ownership to a new converter that\n doesn't allow upgrades anymore, for finalizing the relationship between the converter\n and the anchor.\n Converter types (defined as uint16 type) -\n 0 = liquid token converter\n 1 = liquidity pool v1 converter\n 2 = liquidity pool v2 converter\n Note that converters don't currently support tokens with transfer fees."
},
"fullyImplemented": false,
"id": 10039,
"linearizedBaseContracts": [
10039,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
13340,
22847
],
"name": "ConverterBase",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 9004,
"libraryName": {
"contractScope": null,
"id": 9002,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22354,
"src": "1775:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$22354",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "1769:27:8",
"typeName": {
"id": 9003,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1788:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"id": 9007,
"mutability": "constant",
"name": "PPM_RESOLUTION",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "1804:49:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9005,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1804:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31303030303030",
"id": 9006,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1846:7:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000_by_1",
"typeString": "int_const 1000000"
},
"value": "1000000"
},
"visibility": "internal"
},
{
"constant": true,
"id": 9012,
"mutability": "constant",
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "1860:107:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9008,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "1860:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307845656565654565656545654565654565456545656545454565656565456565656565656545456545",
"id": 9010,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1924:42:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 9009,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "1912:11:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 9011,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1912:55:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"visibility": "internal"
},
{
"canonicalName": "ConverterBase.Reserve",
"id": 9023,
"members": [
{
"constant": false,
"id": 9014,
"mutability": "mutable",
"name": "balance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2002:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9013,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2002:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9016,
"mutability": "mutable",
"name": "weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2050:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9015,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2050:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9018,
"mutability": "mutable",
"name": "deprecated1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2128:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9017,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2128:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9020,
"mutability": "mutable",
"name": "deprecated2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2171:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9019,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2171:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9022,
"mutability": "mutable",
"name": "isSet",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2214:10:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9021,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2214:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Reserve",
"nodeType": "StructDefinition",
"scope": 10039,
"src": "1976:313:8",
"visibility": "public"
},
{
"constant": true,
"documentation": {
"id": 9024,
"nodeType": "StructuredDocumentation",
"src": "2297:40:8",
"text": " @dev version number"
},
"functionSelector": "54fd4d50",
"id": 9027,
"mutability": "constant",
"name": "version",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2343:35:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9025,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "2343:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3339",
"id": 9026,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2376:2:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_39_by_1",
"typeString": "int_const 39"
},
"value": "39"
},
"visibility": "public"
},
{
"baseFunctions": [
13195
],
"constant": false,
"functionSelector": "d3fb73b4",
"id": 9030,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9029,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2411:8:8"
},
"scope": 10039,
"src": "2387:39:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9028,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "2387:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "public"
},
{
"baseFunctions": [
13233
],
"constant": false,
"functionSelector": "c45d3d92",
"id": 9033,
"mutability": "mutable",
"name": "conversionWhitelist",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9032,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2491:8:8"
},
"scope": 10039,
"src": "2473:46:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
},
"typeName": {
"contractScope": null,
"id": 9031,
"name": "IWhitelist",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22917,
"src": "2473:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "d031370b",
"id": 9036,
"mutability": "mutable",
"name": "reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2613:34:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 9034,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2613:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 9035,
"length": null,
"nodeType": "ArrayTypeName",
"src": "2613:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "d66bd524",
"id": 9040,
"mutability": "mutable",
"name": "reserves",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2754:48:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve)"
},
"typeName": {
"id": 9039,
"keyType": {
"contractScope": null,
"id": 9037,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2763:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Mapping",
"src": "2754:32:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve)"
},
"valueType": {
"contractScope": null,
"id": 9038,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "2778:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "0c7d5cd8",
"id": 9043,
"mutability": "mutable",
"name": "reserveRatio",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2899:30:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9041,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2899:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9042,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2928:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"baseFunctions": [
13243
],
"constant": false,
"functionSelector": "94c275ad",
"id": 9047,
"mutability": "mutable",
"name": "maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9045,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3055:8:8"
},
"scope": 10039,
"src": "3041:43:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9044,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3041:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9046,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3083:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"baseFunctions": [
13238
],
"constant": false,
"functionSelector": "579cd3ca",
"id": 9051,
"mutability": "mutable",
"name": "conversionFee",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9049,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3306:8:8"
},
"scope": 10039,
"src": "3292:40:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9048,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3292:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9050,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3331:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "bf754558",
"id": 9054,
"mutability": "constant",
"name": "conversionsEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "3417:46:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9052,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3417:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9053,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3459:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 9055,
"nodeType": "StructuredDocumentation",
"src": "3514:260:8",
"text": " @dev triggered when the converter is activated\n @param _type converter type\n @param _anchor converter anchor\n @param _activated true if the converter was activated, false if it was deactivated"
},
"id": 9063,
"name": "Activation",
"nodeType": "EventDefinition",
"parameters": {
"id": 9062,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9057,
"indexed": true,
"mutability": "mutable",
"name": "_type",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3797:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9056,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3797:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9059,
"indexed": true,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3819:32:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9058,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "3819:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9061,
"indexed": true,
"mutability": "mutable",
"name": "_activated",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3853:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9060,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3853:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3796:81:8"
},
"src": "3780:98:8"
},
{
"anonymous": false,
"documentation": {
"id": 9064,
"nodeType": "StructuredDocumentation",
"src": "3886:447:8",
"text": " @dev triggered when a conversion between two tokens occurs\n @param _fromToken source ERC20 token\n @param _toToken target ERC20 token\n @param _trader wallet that initiated the trade\n @param _amount amount converted, in the source token\n @param _return amount returned, minus conversion fee\n @param _conversionFee conversion fee"
},
"id": 9078,
"name": "Conversion",
"nodeType": "EventDefinition",
"parameters": {
"id": 9077,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9066,
"indexed": true,
"mutability": "mutable",
"name": "_fromToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4366:30:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9065,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4366:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9068,
"indexed": true,
"mutability": "mutable",
"name": "_toToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4407:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9067,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4407:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9070,
"indexed": true,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4446:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9069,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4446:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9072,
"indexed": false,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4480:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9071,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4480:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9074,
"indexed": false,
"mutability": "mutable",
"name": "_return",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4506:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9073,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4506:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9076,
"indexed": false,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4532:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 9075,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4532:6:8",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4355:205:8"
},
"src": "4339:222:8"
},
{
"anonymous": false,
"documentation": {
"id": 9079,
"nodeType": "StructuredDocumentation",
"src": "4569:562:8",
"text": " @dev triggered when the rate between two tokens in the converter changes\n note that the event might be dispatched for rate updates between any two tokens in the converter\n note that prior to version 28, you should use the 'PriceDataUpdate' event instead\n @param _token1 address of the first token\n @param _token2 address of the second token\n @param _rateN rate of 1 unit of `_token1` in `_token2` (numerator)\n @param _rateD rate of 1 unit of `_token1` in `_token2` (denominator)"
},
"id": 9089,
"name": "TokenRateUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 9088,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9081,
"indexed": true,
"mutability": "mutable",
"name": "_token1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5169:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9080,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5169:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9083,
"indexed": true,
"mutability": "mutable",
"name": "_token2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5207:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9082,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5207:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9085,
"indexed": false,
"mutability": "mutable",
"name": "_rateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5245:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9084,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5245:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9087,
"indexed": false,
"mutability": "mutable",
"name": "_rateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5270:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9086,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5270:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5158:133:8"
},
"src": "5137:155:8"
},
{
"anonymous": false,
"documentation": {
"id": 9090,
"nodeType": "StructuredDocumentation",
"src": "5300:220:8",
"text": " @dev triggered when the conversion fee is updated\n @param _prevFee previous fee percentage, represented in ppm\n @param _newFee new fee percentage, represented in ppm"
},
"id": 9096,
"name": "ConversionFeeUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 9095,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9092,
"indexed": false,
"mutability": "mutable",
"name": "_prevFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9096,
"src": "5552:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9091,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5552:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9094,
"indexed": false,
"mutability": "mutable",
"name": "_newFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9096,
"src": "5569:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9093,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5569:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5551:33:8"
},
"src": "5526:59:8"
},
{
"body": {
"id": 9126,
"nodeType": "Block",
"src": "6192:82:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9118,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "6203:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9119,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9099,
"src": "6212:7:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"src": "6203:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9121,
"nodeType": "ExpressionStatement",
"src": "6203:16:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9122,
"name": "maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9047,
"src": "6230:16:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9123,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9103,
"src": "6249:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6230:36:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9125,
"nodeType": "ExpressionStatement",
"src": "6230:36:8"
}
]
},
"documentation": {
"id": 9097,
"nodeType": "StructuredDocumentation",
"src": "5593:313:8",
"text": " @dev used by sub-contracts to initialize a new converter\n @param _anchor anchor governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 9127,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9108,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9099,
"src": "6069:7:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 9107,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6061:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9106,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6061:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6061:16:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9110,
"modifierName": {
"argumentTypes": null,
"id": 9105,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "6048:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "6048:30:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9112,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9101,
"src": "6111:9:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
}
],
"id": 9113,
"modifierName": {
"argumentTypes": null,
"id": 9111,
"name": "ContractRegistryClient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21719,
"src": "6088:22:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ContractRegistryClient_$21719_$",
"typeString": "type(contract ContractRegistryClient)"
}
},
"nodeType": "ModifierInvocation",
"src": "6088:33:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9115,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9103,
"src": "6168:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 9116,
"modifierName": {
"argumentTypes": null,
"id": 9114,
"name": "validConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9196,
"src": "6149:18:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint32_$",
"typeString": "modifier (uint32)"
}
},
"nodeType": "ModifierInvocation",
"src": "6149:37:8"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9104,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9099,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "5934:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9098,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "5934:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9101,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "5969:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 9100,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "5969:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9103,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "6007:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9102,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "6007:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5923:115:8"
},
"returnParameters": {
"id": 9117,
"nodeType": "ParameterList",
"parameters": [],
"src": "6192:0:8"
},
"scope": 10039,
"src": "5912:362:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9133,
"nodeType": "Block",
"src": "6345:40:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9129,
"name": "_active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9144,
"src": "6356:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 9130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6356:9:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9131,
"nodeType": "ExpressionStatement",
"src": "6356:9:8"
},
{
"id": 9132,
"nodeType": "PlaceholderStatement",
"src": "6376:1:8"
}
]
},
"documentation": null,
"id": 9134,
"name": "active",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9128,
"nodeType": "ParameterList",
"parameters": [],
"src": "6342:2:8"
},
"src": "6327:58:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9143,
"nodeType": "Block",
"src": "6473:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9138,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "6492:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9139,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6492:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e414354495645",
"id": 9140,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6504:14:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a22dd8039fb80c8642cf17389b806c873aa9fbdbf3f2bd8746d8ce373ef50f9e",
"typeString": "literal_string \"ERR_INACTIVE\""
},
"value": "ERR_INACTIVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_a22dd8039fb80c8642cf17389b806c873aa9fbdbf3f2bd8746d8ce373ef50f9e",
"typeString": "literal_string \"ERR_INACTIVE\""
}
],
"id": 9137,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6484:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6484:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9142,
"nodeType": "ExpressionStatement",
"src": "6484:35:8"
}
]
},
"documentation": null,
"id": 9144,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_active",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9135,
"nodeType": "ParameterList",
"parameters": [],
"src": "6456:2:8"
},
"returnParameters": {
"id": 9136,
"nodeType": "ParameterList",
"parameters": [],
"src": "6473:0:8"
},
"scope": 10039,
"src": "6440:87:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9150,
"nodeType": "Block",
"src": "6604:42:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9146,
"name": "_inactive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9162,
"src": "6615:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 9147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6615:11:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9148,
"nodeType": "ExpressionStatement",
"src": "6615:11:8"
},
{
"id": 9149,
"nodeType": "PlaceholderStatement",
"src": "6637:1:8"
}
]
},
"documentation": null,
"id": 9151,
"name": "inactive",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9145,
"nodeType": "ParameterList",
"parameters": [],
"src": "6601:2:8"
},
"src": "6584:62:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9161,
"nodeType": "Block",
"src": "6736:53:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "6755:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9155,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "6756:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9156,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6756:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f414354495645",
"id": 9158,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6768:12:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_181d3d32638945611c2cb46b623de141c5e74a32dcd850864f64837aa849ee3f",
"typeString": "literal_string \"ERR_ACTIVE\""
},
"value": "ERR_ACTIVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_181d3d32638945611c2cb46b623de141c5e74a32dcd850864f64837aa849ee3f",
"typeString": "literal_string \"ERR_ACTIVE\""
}
],
"id": 9154,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6747:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6747:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9160,
"nodeType": "ExpressionStatement",
"src": "6747:34:8"
}
]
},
"documentation": null,
"id": 9162,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_inactive",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9152,
"nodeType": "ParameterList",
"parameters": [],
"src": "6719:2:8"
},
"returnParameters": {
"id": 9153,
"nodeType": "ParameterList",
"parameters": [],
"src": "6736:0:8"
},
"scope": 10039,
"src": "6701:88:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9171,
"nodeType": "Block",
"src": "6948:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9167,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9164,
"src": "6973:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9166,
"name": "_validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9186,
"src": "6959:13:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token) view"
}
},
"id": 9168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6959:23:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9169,
"nodeType": "ExpressionStatement",
"src": "6959:23:8"
},
{
"id": 9170,
"nodeType": "PlaceholderStatement",
"src": "6993:1:8"
}
]
},
"documentation": null,
"id": 9172,
"name": "validReserve",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9165,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9164,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9172,
"src": "6926:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9163,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6926:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6925:22:8"
},
"src": "6904:98:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9185,
"nodeType": "Block",
"src": "7116:75:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9178,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "7135:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9180,
"indexExpression": {
"argumentTypes": null,
"id": 9179,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9174,
"src": "7144:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7135:18:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9181,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "7135:24:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9182,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7161:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9177,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7127:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7127:56:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9184,
"nodeType": "ExpressionStatement",
"src": "7127:56:8"
}
]
},
"documentation": null,
"id": 9186,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validReserve",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9175,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9174,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9186,
"src": "7080:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9173,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "7080:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7079:22:8"
},
"returnParameters": {
"id": 9176,
"nodeType": "ParameterList",
"parameters": [],
"src": "7116:0:8"
},
"scope": 10039,
"src": "7057:134:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9195,
"nodeType": "Block",
"src": "7283:66:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9191,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9188,
"src": "7314:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9190,
"name": "_validConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9209,
"src": "7294:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$__$",
"typeString": "function (uint32) pure"
}
},
"id": 9192,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7294:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9193,
"nodeType": "ExpressionStatement",
"src": "7294:35:8"
},
{
"id": 9194,
"nodeType": "PlaceholderStatement",
"src": "7340:1:8"
}
]
},
"documentation": null,
"id": 9196,
"name": "validConversionFee",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9189,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9188,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9196,
"src": "7260:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9187,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7260:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7259:23:8"
},
"src": "7232:117:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9208,
"nodeType": "Block",
"src": "7470:90:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9204,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9202,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9198,
"src": "7489:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9203,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "7507:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "7489:32:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f434f4e56455253494f4e5f464545",
"id": 9205,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7523:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
},
"value": "ERR_INVALID_CONVERSION_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
}
],
"id": 9201,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7481:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7481:71:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9207,
"nodeType": "ExpressionStatement",
"src": "7481:71:8"
}
]
},
"documentation": null,
"id": 9209,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validConversionFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9199,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9198,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9209,
"src": "7433:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9197,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7433:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7432:23:8"
},
"returnParameters": {
"id": 9200,
"nodeType": "ParameterList",
"parameters": [],
"src": "7470:0:8"
},
"scope": 10039,
"src": "7404:156:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9218,
"nodeType": "Block",
"src": "7645:59:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9214,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9211,
"src": "7676:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9213,
"name": "_validReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9236,
"src": "7656:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$__$",
"typeString": "function (uint32) pure"
}
},
"id": 9215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7656:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9216,
"nodeType": "ExpressionStatement",
"src": "7656:28:8"
},
{
"id": 9217,
"nodeType": "PlaceholderStatement",
"src": "7695:1:8"
}
]
},
"documentation": null,
"id": 9219,
"name": "validReserveWeight",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9212,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9211,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9219,
"src": "7629:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9210,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7629:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7628:16:8"
},
"src": "7601:103:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9235,
"nodeType": "Block",
"src": "7818:98:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9231,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9227,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9225,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9221,
"src": "7837:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 9226,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7847:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "7837:11:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9230,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9228,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9221,
"src": "7852:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9229,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "7863:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "7852:25:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "7837:40:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f574549474854",
"id": 9232,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7879:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
},
"value": "ERR_INVALID_RESERVE_WEIGHT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
}
],
"id": 9224,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7829:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9233,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7829:79:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9234,
"nodeType": "ExpressionStatement",
"src": "7829:79:8"
}
]
},
"documentation": null,
"id": 9236,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validReserveWeight",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9222,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9221,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9236,
"src": "7788:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9220,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7788:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7787:16:8"
},
"returnParameters": {
"id": 9223,
"nodeType": "ParameterList",
"parameters": [],
"src": "7818:0:8"
},
"scope": 10039,
"src": "7759:157:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"baseFunctions": [
13190
],
"body": null,
"documentation": null,
"functionSelector": "3e8ff43f",
"id": 9242,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9238,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8009:8:8"
},
"parameters": {
"id": 9237,
"nodeType": "ParameterList",
"parameters": [],
"src": "7986:2:8"
},
"returnParameters": {
"id": 9241,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9240,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9242,
"src": "8027:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9239,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8027:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8026:8:8"
},
"scope": 10039,
"src": "7964:71:8",
"stateMutability": "pure",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13213
],
"body": null,
"documentation": null,
"functionSelector": "af94b8d8",
"id": 9256,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9250,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8236:8:8"
},
"parameters": {
"id": 9249,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9244,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8111:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9243,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8111:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9246,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8137:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9245,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8137:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9248,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8163:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9247,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8163:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8110:69:8"
},
"returnParameters": {
"id": 9255,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9252,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8263:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9251,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8263:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9254,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8272:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9253,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8272:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8262:18:8"
},
"scope": 10039,
"src": "8083:198:8",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13253
],
"body": {
"id": 9269,
"nodeType": "Block",
"src": "8435:281:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9262,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8454:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9264,
"indexExpression": {
"argumentTypes": null,
"id": 9263,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "8463:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8454:29:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9265,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "8454:35:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9266,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8491:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9261,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8446:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8446:67:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9268,
"nodeType": "ExpressionStatement",
"src": "8446:67:8"
}
]
},
"documentation": {
"id": 9257,
"nodeType": "StructuredDocumentation",
"src": "8289:104:8",
"text": " @dev deposits ether\n can only be called if the converter has an ETH reserve"
},
"id": 9270,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9259,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8418:8:8"
},
"parameters": {
"id": 9258,
"nodeType": "ParameterList",
"parameters": [],
"src": "8406:2:8"
},
"returnParameters": {
"id": 9260,
"nodeType": "ParameterList",
"parameters": [],
"src": "8435:0:8"
},
"scope": 10039,
"src": "8399:317:8",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"baseFunctions": [
13285
],
"body": {
"id": 9315,
"nodeType": "Block",
"src": "9248:392:8",
"statements": [
{
"assignments": [
9285
],
"declarations": [
{
"constant": false,
"id": 9285,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9315,
"src": "9259:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9284,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9259:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9289,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9287,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "9297:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9286,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "9287:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9288,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9287:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9259:57:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9297,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9293,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "9430:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9291,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "9431:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9292,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9431:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9294,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21728,
"src": "9445:5:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9295,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9285,
"src": "9454:17:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "9445:26:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "9430:41:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4143434553535f44454e494544",
"id": 9298,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9473:19:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
},
"value": "ERR_ACCESS_DENIED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
}
],
"id": 9290,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9422:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9422:71:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9300,
"nodeType": "ExpressionStatement",
"src": "9422:71:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9306,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "9525:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9305,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9517:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9304,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9517:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9517:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9308,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "9517:21:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 9301,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9273,
"src": "9504:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "9504:12:8",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 9309,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9504:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9310,
"nodeType": "ExpressionStatement",
"src": "9504:35:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9312,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "9612:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9311,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "9593:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9593:39:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9314,
"nodeType": "ExpressionStatement",
"src": "9593:39:8"
}
]
},
"documentation": {
"id": 9271,
"nodeType": "StructuredDocumentation",
"src": "8724:356:8",
"text": " @dev withdraws ether\n can only be called by the owner if the converter is inactive or by upgrader contract\n can only be called after the upgrader contract has accepted the ownership of this contract\n can only be called if the converter has an ETH reserve\n @param _to address to send the ETH to"
},
"functionSelector": "690d8320",
"id": 9316,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9277,
"modifierName": {
"argumentTypes": null,
"id": 9276,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "9171:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9171:9:8"
},
{
"arguments": null,
"id": 9279,
"modifierName": {
"argumentTypes": null,
"id": 9278,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "9190:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9190:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9281,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "9222:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9282,
"modifierName": {
"argumentTypes": null,
"id": 9280,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "9209:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "9209:33:8"
}
],
"name": "withdrawETH",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9275,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "9153:8:8"
},
"parameters": {
"id": 9274,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9273,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9316,
"src": "9107:19:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9272,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9107:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9106:21:8"
},
"returnParameters": {
"id": 9283,
"nodeType": "ParameterList",
"parameters": [],
"src": "9248:0:8"
},
"scope": 10039,
"src": "9086:554:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9324,
"nodeType": "Block",
"src": "9867:30:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9322,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9885:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 9321,
"id": 9323,
"nodeType": "Return",
"src": "9878:11:8"
}
]
},
"documentation": {
"id": 9317,
"nodeType": "StructuredDocumentation",
"src": "9648:161:8",
"text": " @dev checks whether or not the converter version is 28 or higher\n @return true, since the converter version is 28 or higher"
},
"functionSelector": "d260529c",
"id": 9325,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isV28OrHigher",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9318,
"nodeType": "ParameterList",
"parameters": [],
"src": "9837:2:8"
},
"returnParameters": {
"id": 9321,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9320,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9325,
"src": "9861:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9319,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "9861:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9860:6:8"
},
"scope": 10039,
"src": "9815:82:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13271
],
"body": {
"id": 9344,
"nodeType": "Block",
"src": "10419:51:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9340,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "10430:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9341,
"name": "_whitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9328,
"src": "10452:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"src": "10430:32:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9343,
"nodeType": "ExpressionStatement",
"src": "10430:32:8"
}
]
},
"documentation": {
"id": 9326,
"nodeType": "StructuredDocumentation",
"src": "9905:357:8",
"text": " @dev allows the owner to update & enable the conversion whitelist contract address\n when set, only addresses that are whitelisted are actually allowed to use the converter\n note that the whitelist check is actually done by the BancorNetwork contract\n @param _whitelist address of a whitelist contract"
},
"functionSelector": "4af80f0e",
"id": 9345,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9332,
"modifierName": {
"argumentTypes": null,
"id": 9331,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "10366:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10366:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9336,
"name": "_whitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9328,
"src": "10401:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
],
"id": 9335,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10393:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9334,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10393:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9337,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10393:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9338,
"modifierName": {
"argumentTypes": null,
"id": 9333,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "10385:7:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "10385:28:8"
}
],
"name": "setConversionWhitelist",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9330,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "10348:8:8"
},
"parameters": {
"id": 9329,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9328,
"mutability": "mutable",
"name": "_whitelist",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9345,
"src": "10300:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
},
"typeName": {
"contractScope": null,
"id": 9327,
"name": "IWhitelist",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22917,
"src": "10300:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10299:23:8"
},
"returnParameters": {
"id": 9339,
"nodeType": "ParameterList",
"parameters": [],
"src": "10419:0:8"
},
"scope": 10039,
"src": "10268:202:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13200
],
"body": {
"id": 9361,
"nodeType": "Block",
"src": "10705:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 9352,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10723:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "10723:12:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 9354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10723:14:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9357,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "10749:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9356,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10741:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9355,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10741:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9358,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10741:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10723:31:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 9351,
"id": 9360,
"nodeType": "Return",
"src": "10716:38:8"
}
]
},
"documentation": {
"id": 9346,
"nodeType": "StructuredDocumentation",
"src": "10478:157:8",
"text": " @dev returns true if the converter is active, false otherwise\n @return true if the converter is active, false otherwise"
},
"functionSelector": "22f3e2d4",
"id": 9362,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isActive",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9348,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "10681:8:8"
},
"parameters": {
"id": 9347,
"nodeType": "ParameterList",
"parameters": [],
"src": "10658:2:8"
},
"returnParameters": {
"id": 9351,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9350,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9362,
"src": "10699:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9349,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "10699:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10698:6:8"
},
"scope": 10039,
"src": "10641:121:8",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13258
],
"body": {
"id": 9380,
"nodeType": "Block",
"src": "11256:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9377,
"name": "_newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9365,
"src": "11292:9:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 9374,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11267:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9376,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transferOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 22843,
"src": "11267:24:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$",
"typeString": "function (address) external"
}
},
"id": 9378,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11267:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9379,
"nodeType": "ExpressionStatement",
"src": "11267:35:8"
}
]
},
"documentation": {
"id": 9363,
"nodeType": "StructuredDocumentation",
"src": "10770:336:8",
"text": " @dev transfers the anchor ownership\n the new owner needs to accept the transfer\n can only be called by the converter upgrder while the upgrader is the owner\n note that prior to version 28, you should use 'transferAnchorOwnership' instead\n @param _newOwner new token owner"
},
"functionSelector": "67b6d57c",
"id": 9381,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9369,
"modifierName": {
"argumentTypes": null,
"id": 9368,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "11207:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "11207:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9371,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "11231:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 9372,
"modifierName": {
"argumentTypes": null,
"id": 9370,
"name": "only",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21577,
"src": "11226:4:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "11226:24:8"
}
],
"name": "transferAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9367,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "11189:8:8"
},
"parameters": {
"id": 9366,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9365,
"mutability": "mutable",
"name": "_newOwner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9381,
"src": "11145:17:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9364,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11145:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "11144:19:8"
},
"returnParameters": {
"id": 9373,
"nodeType": "ParameterList",
"parameters": [],
"src": "11256:0:8"
},
"scope": 10039,
"src": "11112:198:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13261
],
"body": {
"id": 9404,
"nodeType": "Block",
"src": "11700:209:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 9392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9389,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "11781:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 9390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11781:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 9391,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11803:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "11781:23:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 9393,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11806:27:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 9388,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11773:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9394,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11773:61:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9395,
"nodeType": "ExpressionStatement",
"src": "11773:61:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 9396,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11845:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 22846,
"src": "11845:22:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$__$returns$__$",
"typeString": "function () external"
}
},
"id": 9399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11845:24:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9400,
"nodeType": "ExpressionStatement",
"src": "11845:24:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9401,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "11880:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9402,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11880:21:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9403,
"nodeType": "ExpressionStatement",
"src": "11880:21:8"
}
]
},
"documentation": {
"id": 9382,
"nodeType": "StructuredDocumentation",
"src": "11318:309:8",
"text": " @dev accepts ownership of the anchor after an ownership transfer\n most converters are also activated as soon as they accept the anchor ownership\n can only be called by the contract owner\n note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"functionSelector": "cdc91c69",
"id": 9405,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9386,
"modifierName": {
"argumentTypes": null,
"id": 9385,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "11690:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "11690:9:8"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9384,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "11681:8:8"
},
"parameters": {
"id": 9383,
"nodeType": "ParameterList",
"parameters": [],
"src": "11663:2:8"
},
"returnParameters": {
"id": 9387,
"nodeType": "ParameterList",
"parameters": [],
"src": "11700:0:8"
},
"scope": 10039,
"src": "11633:276:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 9425,
"nodeType": "Block",
"src": "12315:62:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9420,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9408,
"src": "12348:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9421,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9410,
"src": "12356:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9422,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9412,
"src": "12361:7:8",
"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"
}
],
"expression": {
"argumentTypes": null,
"id": 9417,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "12326:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9419,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 22906,
"src": "12326:21:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256) external"
}
},
"id": 9423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12326:43:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9424,
"nodeType": "ExpressionStatement",
"src": "12326:43:8"
}
]
},
"documentation": {
"id": 9406,
"nodeType": "StructuredDocumentation",
"src": "11917:297:8",
"text": " @dev withdraws tokens held by the anchor and sends them to an account\n can only be called by the owner\n @param _token ERC20 token contract address\n @param _to account to receive the new amount\n @param _amount amount to withdraw"
},
"functionSelector": "395900d4",
"id": 9426,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9415,
"modifierName": {
"argumentTypes": null,
"id": 9414,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "12305:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12305:9:8"
}
],
"name": "withdrawFromAnchor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9413,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9408,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12248:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9407,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "12248:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9410,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12268:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9409,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12268:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9412,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12281:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9411,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12281:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12247:50:8"
},
"returnParameters": {
"id": 9416,
"nodeType": "ParameterList",
"parameters": [],
"src": "12315:0:8"
},
"scope": 10039,
"src": "12220:157:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13266
],
"body": {
"id": 9451,
"nodeType": "Block",
"src": "12655:199:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9438,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9436,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12674:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9437,
"name": "maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9047,
"src": "12692:16:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "12674:34:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f434f4e56455253494f4e5f464545",
"id": 9439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12710:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
},
"value": "ERR_INVALID_CONVERSION_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
}
],
"id": 9435,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "12666:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12666:73:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9441,
"nodeType": "ExpressionStatement",
"src": "12666:73:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9443,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "12775:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 9444,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12790:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9442,
"name": "ConversionFeeUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9096,
"src": "12755:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint32_$_t_uint32_$returns$__$",
"typeString": "function (uint32,uint32)"
}
},
"id": 9445,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12755:50:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9446,
"nodeType": "EmitStatement",
"src": "12750:55:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9449,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9447,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "12816:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9448,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12832:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "12816:30:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9450,
"nodeType": "ExpressionStatement",
"src": "12816:30:8"
}
]
},
"documentation": {
"id": 9427,
"nodeType": "StructuredDocumentation",
"src": "12385:189:8",
"text": " @dev updates the current conversion fee\n can only be called by the contract owner\n @param _conversionFee new conversion fee, represented in ppm"
},
"functionSelector": "ecbca55d",
"id": 9452,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9433,
"modifierName": {
"argumentTypes": null,
"id": 9432,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "12645:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12645:9:8"
}
],
"name": "setConversionFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9431,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "12636:8:8"
},
"parameters": {
"id": 9430,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9429,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9452,
"src": "12606:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9428,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "12606:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12605:23:8"
},
"returnParameters": {
"id": 9434,
"nodeType": "ParameterList",
"parameters": [],
"src": "12655:0:8"
},
"scope": 10039,
"src": "12580:274:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13280,
22574
],
"body": {
"id": 9509,
"nodeType": "Block",
"src": "13506:559:8",
"statements": [
{
"assignments": [
9470
],
"declarations": [
{
"constant": false,
"id": 9470,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9509,
"src": "13517:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9469,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13517:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9474,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9472,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "13555:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9471,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "13545:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9473,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13545:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13517:57:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9488,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9484,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9480,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "13764:23:8",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9476,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "13765:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9478,
"indexExpression": {
"argumentTypes": null,
"id": 9477,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "13774:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "13765:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9479,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "13765:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"id": 9483,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "13791:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9481,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "13792:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9482,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13792:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "13764:38:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9487,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9485,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21728,
"src": "13806:5:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9486,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9470,
"src": "13815:17:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "13806:26:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "13764:68:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4143434553535f44454e494544",
"id": 9489,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "13834:19:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
},
"value": "ERR_ACCESS_DENIED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
}
],
"id": 9475,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "13756:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13756:98:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9491,
"nodeType": "ExpressionStatement",
"src": "13756:98:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9495,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "13886:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9496,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "13894:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9497,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "13899:7:8",
"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"
}
],
"expression": {
"argumentTypes": null,
"id": 9492,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "13865:5:8",
"typeDescriptions": {
"typeIdentifier": "t_super$_ConverterBase_$10039",
"typeString": "contract super ConverterBase"
}
},
"id": 9494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 22574,
"src": "13865:20:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 9498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13865:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9499,
"nodeType": "ExpressionStatement",
"src": "13865:42:8"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9500,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "13994:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9502,
"indexExpression": {
"argumentTypes": null,
"id": 9501,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "14003:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "13994:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9503,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "13994:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 9508,
"nodeType": "IfStatement",
"src": "13990:67:8",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9505,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "14050:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9504,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "14031:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14031:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9507,
"nodeType": "ExpressionStatement",
"src": "14031:26:8"
}
}
]
},
"documentation": {
"id": 9453,
"nodeType": "StructuredDocumentation",
"src": "12862:462:8",
"text": " @dev withdraws tokens held by the converter and sends them to an account\n can only be called by the owner\n note that reserve tokens can only be withdrawn by the owner while the converter is inactive\n unless the owner is the converter upgrader contract\n @param _token ERC20 token contract address\n @param _to account to receive the new amount\n @param _amount amount to withdraw"
},
"functionSelector": "5e35359e",
"id": 9510,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9465,
"modifierName": {
"argumentTypes": null,
"id": 9464,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "13472:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13472:9:8"
},
{
"arguments": null,
"id": 9467,
"modifierName": {
"argumentTypes": null,
"id": 9466,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "13491:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13491:9:8"
}
],
"name": "withdrawTokens",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9463,
"nodeType": "OverrideSpecifier",
"overrides": [
{
"contractScope": null,
"id": 9461,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "13438:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"contractScope": null,
"id": 9462,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "13450:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
}
],
"src": "13429:33:8"
},
"parameters": {
"id": 9460,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9455,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13354:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9454,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "13354:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9457,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13374:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9456,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13374:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9459,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13387:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13387:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13353:50:8"
},
"returnParameters": {
"id": 9468,
"nodeType": "ParameterList",
"parameters": [],
"src": "13506:0:8"
},
"scope": 10039,
"src": "13330:735:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9547,
"nodeType": "Block",
"src": "14324:338:8",
"statements": [
{
"assignments": [
9517
],
"declarations": [
{
"constant": false,
"id": 9517,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9547,
"src": "14335:36:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
},
"typeName": {
"contractScope": null,
"id": 9516,
"name": "IConverterUpgrader",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13660,
"src": "14335:18:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9523,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9520,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "14403:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9519,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14393:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14393:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9518,
"name": "IConverterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13660,
"src": "14374:18:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterUpgrader_$13660_$",
"typeString": "type(contract IConverterUpgrader)"
}
},
"id": 9522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14374:49:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14335:88:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9525,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9242,
"src": "14492:13:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 9526,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14492:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 9527,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "14509:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9528,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14517:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 9524,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "14481:10:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 9529,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14481:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9530,
"nodeType": "EmitStatement",
"src": "14476:47:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9534,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9517,
"src": "14562:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
],
"id": 9533,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14554:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9532,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14554:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14554:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9531,
"name": "transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21787,
"src": "14536:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 9536,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14536:45:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9537,
"nodeType": "ExpressionStatement",
"src": "14536:45:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9541,
"name": "version",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9027,
"src": "14618:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"expression": {
"argumentTypes": null,
"id": 9538,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9517,
"src": "14592:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"id": 9540,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "upgrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 13659,
"src": "14592:25:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint16_$returns$__$",
"typeString": "function (uint16) external"
}
},
"id": 9542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14592:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9543,
"nodeType": "ExpressionStatement",
"src": "14592:34:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9544,
"name": "acceptOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21817,
"src": "14637:15:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9545,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14637:17:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9546,
"nodeType": "ExpressionStatement",
"src": "14637:17:8"
}
]
},
"documentation": {
"id": 9511,
"nodeType": "StructuredDocumentation",
"src": "14073:209:8",
"text": " @dev upgrades the converter to the latest version\n can only be called by the owner\n note that the owner needs to call acceptOwnership on the new converter after the upgrade"
},
"functionSelector": "d55ec697",
"id": 9548,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9514,
"modifierName": {
"argumentTypes": null,
"id": 9513,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "14314:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "14314:9:8"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9512,
"nodeType": "ParameterList",
"parameters": [],
"src": "14304:2:8"
},
"returnParameters": {
"id": 9515,
"nodeType": "ParameterList",
"parameters": [],
"src": "14324:0:8"
},
"scope": 10039,
"src": "14288:374:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9560,
"nodeType": "Block",
"src": "14940:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9556,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14965:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14965:20:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 9555,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14958:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint16_$",
"typeString": "type(uint16)"
},
"typeName": {
"id": 9554,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "14958:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9558,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14958:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 9553,
"id": 9559,
"nodeType": "Return",
"src": "14951:35:8"
}
]
},
"documentation": {
"id": 9549,
"nodeType": "StructuredDocumentation",
"src": "14670:206:8",
"text": " @dev returns the number of reserve tokens defined\n note that prior to version 17, you should use 'connectorTokenCount' instead\n @return number of reserve tokens"
},
"functionSelector": "9b99a8e2",
"id": 9561,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "reserveTokenCount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9550,
"nodeType": "ParameterList",
"parameters": [],
"src": "14908:2:8"
},
"returnParameters": {
"id": 9553,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9552,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9561,
"src": "14932:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9551,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "14932:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "14931:8:8"
},
"scope": 10039,
"src": "14882:112:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13292
],
"body": {
"id": 9663,
"nodeType": "Block",
"src": "15545:544:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9598,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9592,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15599:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9591,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15591:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9590,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15591:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15591:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9596,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "15618:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 9595,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15610:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9594,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15610:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9597,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15610:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "15591:34:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 9603,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "15629:23:8",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9599,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15630:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9601,
"indexExpression": {
"argumentTypes": null,
"id": 9600,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15639:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15630:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9602,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "15630:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "15591:61:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9605,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15654:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9589,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15583:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15583:93:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9607,
"nodeType": "ExpressionStatement",
"src": "15583:93:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9613,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9609,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15695:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9612,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9610,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "15706:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 9611,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "15723:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15706:29:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15695:40:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f574549474854",
"id": 9614,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15737:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
},
"value": "ERR_INVALID_RESERVE_WEIGHT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
}
],
"id": 9608,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15687:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9615,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15687:79:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9616,
"nodeType": "ExpressionStatement",
"src": "15687:79:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 9625,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9618,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "15785:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 9619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15785:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9623,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "15814:2:8",
"subExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 9622,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15815:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
],
"id": 9621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15807:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint16_$",
"typeString": "type(uint16)"
},
"typeName": {
"id": 9620,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "15807:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9624,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15807:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "15785:32:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 9626,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15819:27:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 9617,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15777:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9627,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15777:70:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9628,
"nodeType": "ExpressionStatement",
"src": "15777:70:8"
},
{
"assignments": [
9630
],
"declarations": [
{
"constant": false,
"id": 9630,
"mutability": "mutable",
"name": "newReserve",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9663,
"src": "15860:26:8",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
},
"typeName": {
"contractScope": null,
"id": 9629,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "15860:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9634,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9631,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15889:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9633,
"indexExpression": {
"argumentTypes": null,
"id": 9632,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15898:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15889:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15860:45:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9635,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15916:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9637,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "15916:18:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 9638,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15937:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "15916:22:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9640,
"nodeType": "ExpressionStatement",
"src": "15916:22:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9641,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15949:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9643,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "15949:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9644,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15969:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15949:27:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9646,
"nodeType": "ExpressionStatement",
"src": "15949:27:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9647,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15987:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9649,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "15987:16:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9650,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16006:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "15987:23:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 9652,
"nodeType": "ExpressionStatement",
"src": "15987:23:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9656,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "16040:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 9653,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "16021:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9655,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16021:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16021:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9658,
"nodeType": "ExpressionStatement",
"src": "16021:26:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9661,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9659,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "16058:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"id": 9660,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "16074:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "16058:23:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9662,
"nodeType": "ExpressionStatement",
"src": "16058:23:8"
}
]
},
"documentation": {
"id": 9562,
"nodeType": "StructuredDocumentation",
"src": "15002:278:8",
"text": " @dev defines a new reserve token for the converter\n can only be called by the owner while the converter is inactive\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 9664,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9570,
"modifierName": {
"argumentTypes": null,
"id": 9569,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "15402:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "15402:9:8"
},
{
"arguments": null,
"id": 9572,
"modifierName": {
"argumentTypes": null,
"id": 9571,
"name": "inactive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9151,
"src": "15421:8:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "15421:8:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9576,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15460:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9575,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15452:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9574,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15452:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9577,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15452:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9578,
"modifierName": {
"argumentTypes": null,
"id": 9573,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "15439:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "15439:29:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9582,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15494:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9581,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15486:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9580,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15486:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9583,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15486:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9584,
"modifierName": {
"argumentTypes": null,
"id": 9579,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "15478:7:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "15478:24:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9586,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15531:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 9587,
"modifierName": {
"argumentTypes": null,
"id": 9585,
"name": "validReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9219,
"src": "15512:18:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint32_$",
"typeString": "modifier (uint32)"
}
},
"nodeType": "ModifierInvocation",
"src": "15512:27:8"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9568,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "15384:8:8"
},
"parameters": {
"id": 9567,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9564,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9664,
"src": "15306:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9563,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "15306:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9566,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9664,
"src": "15326:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9565,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "15326:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "15305:36:8"
},
"returnParameters": {
"id": 9588,
"nodeType": "ParameterList",
"parameters": [],
"src": "15545:0:8"
},
"scope": 10039,
"src": "15286:803:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 9680,
"nodeType": "Block",
"src": "16448:56:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9675,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16466:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9677,
"indexExpression": {
"argumentTypes": null,
"id": 9676,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9667,
"src": "16475:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16466:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9678,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "16466:30:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"functionReturnParameters": 9674,
"id": 9679,
"nodeType": "Return",
"src": "16459:37:8"
}
]
},
"documentation": {
"id": 9665,
"nodeType": "StructuredDocumentation",
"src": "16097:197:8",
"text": " @dev returns the reserve's weight\n added in version 28\n @param _reserveToken reserve token contract address\n @return reserve weight"
},
"functionSelector": "1cfab290",
"id": 9681,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9670,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9667,
"src": "16402:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9671,
"modifierName": {
"argumentTypes": null,
"id": 9669,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "16389:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "16389:27:8"
}
],
"name": "reserveWeight",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9668,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9667,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9681,
"src": "16323:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9666,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "16323:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16322:27:8"
},
"returnParameters": {
"id": 9674,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9673,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9681,
"src": "16435:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9672,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "16435:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16434:8:8"
},
"scope": 10039,
"src": "16300:204:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13250
],
"body": {
"id": 9698,
"nodeType": "Block",
"src": "16941:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9693,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16959:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9695,
"indexExpression": {
"argumentTypes": null,
"id": 9694,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9684,
"src": "16968:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16959:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9696,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "16959:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9692,
"id": 9697,
"nodeType": "Return",
"src": "16952:38:8"
}
]
},
"documentation": {
"id": 9682,
"nodeType": "StructuredDocumentation",
"src": "16512:255:8",
"text": " @dev returns the reserve's balance\n note that prior to version 17, you should use 'getConnectorBalance' instead\n @param _reserveToken reserve token contract address\n @return reserve balance"
},
"functionSelector": "dc8de379",
"id": 9699,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9688,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9684,
"src": "16894:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9689,
"modifierName": {
"argumentTypes": null,
"id": 9687,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "16881:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "16881:27:8"
}
],
"name": "reserveBalance",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9686,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "16849:8:8"
},
"parameters": {
"id": 9685,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9684,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9699,
"src": "16797:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9683,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "16797:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16796:27:8"
},
"returnParameters": {
"id": 9692,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9691,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9699,
"src": "16927:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9690,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16927:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16926:9:8"
},
"scope": 10039,
"src": "16773:225:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9710,
"nodeType": "Block",
"src": "17228:61:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9705,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "17246:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9707,
"indexExpression": {
"argumentTypes": null,
"id": 9706,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "17255:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17246:29:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9708,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "17246:35:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 9704,
"id": 9709,
"nodeType": "Return",
"src": "17239:42:8"
}
]
},
"documentation": {
"id": 9700,
"nodeType": "StructuredDocumentation",
"src": "17006:164:8",
"text": " @dev checks whether or not the converter has an ETH reserve\n @return true if the converter has an ETH reserve, false otherwise"
},
"functionSelector": "12c2aca4",
"id": 9711,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "hasETHReserve",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9701,
"nodeType": "ParameterList",
"parameters": [],
"src": "17198:2:8"
},
"returnParameters": {
"id": 9704,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9703,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9711,
"src": "17222:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9702,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "17222:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17221:6:8"
},
"scope": 10039,
"src": "17176:113:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13228
],
"body": {
"id": 9772,
"nodeType": "Block",
"src": "18137:517:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 9736,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9734,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9714,
"src": "18183:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 9735,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9716,
"src": "18199:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "18183:28:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f53414d455f534f555243455f544152474554",
"id": 9737,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18213:24:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
},
"value": "ERR_SAME_SOURCE_TARGET"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
}
],
"id": 9733,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "18175:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9738,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18175:63:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9739,
"nodeType": "ExpressionStatement",
"src": "18175:63:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9749,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9743,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18366:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
],
"id": 9742,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18358:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9741,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18358:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18358:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 9747,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18398:1:8",
"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": 9746,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18390:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9745,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18390:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9748,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18390:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "18358:42:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9752,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9720,
"src": "18456:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 9750,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18422:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9751,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isWhitelisted",
"nodeType": "MemberAccess",
"referencedDeclaration": 22916,
"src": "18422:33:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view external returns (bool)"
}
},
"id": 9753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18422:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9756,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9722,
"src": "18502:12:8",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 9754,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18468:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9755,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isWhitelisted",
"nodeType": "MemberAccess",
"referencedDeclaration": 22916,
"src": "18468:33:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view external returns (bool)"
}
},
"id": 9757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18468:47:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "18422:93:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 9759,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "18421:95:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "18358:158:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f545f57484954454c4953544544",
"id": 9761,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18535:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d03711a645ac13b3887baa10c28f347997e96617340d7ffae036e653d4c59185",
"typeString": "literal_string \"ERR_NOT_WHITELISTED\""
},
"value": "ERR_NOT_WHITELISTED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_d03711a645ac13b3887baa10c28f347997e96617340d7ffae036e653d4c59185",
"typeString": "literal_string \"ERR_NOT_WHITELISTED\""
}
],
"id": 9740,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "18350:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18350:207:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9763,
"nodeType": "ExpressionStatement",
"src": "18350:207:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9765,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9714,
"src": "18587:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9766,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9716,
"src": "18601:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9767,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9718,
"src": "18615:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 9768,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9720,
"src": "18624:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9769,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9722,
"src": "18633:12:8",
"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",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 9764,
"name": "doConvert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9789,
"src": "18577:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_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) returns (uint256)"
}
},
"id": 9770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18577:69:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9732,
"id": 9771,
"nodeType": "Return",
"src": "18570:76:8"
}
]
},
"documentation": {
"id": 9712,
"nodeType": "StructuredDocumentation",
"src": "17297:569:8",
"text": " @dev converts a specific amount of source tokens to target tokens\n can only be called by the bancor network contract\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"functionSelector": "e8dc12ff",
"id": 9773,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9726,
"modifierName": {
"argumentTypes": null,
"id": 9725,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "18065:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "18065:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9728,
"name": "BANCOR_NETWORK",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21530,
"src": "18089:14:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 9729,
"modifierName": {
"argumentTypes": null,
"id": 9727,
"name": "only",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21577,
"src": "18084:4:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "18084:20:8"
}
],
"name": "convert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9724,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "18030:8:8"
},
"parameters": {
"id": 9723,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9714,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17889:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9713,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "17889:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9716,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17915:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9715,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "17915:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9718,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17941:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9717,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17941:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9720,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17958:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9719,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17958:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9722,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17975:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9721,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17975:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17888:116:8"
},
"returnParameters": {
"id": 9732,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9731,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "18123:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9730,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18123:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18122:9:8"
},
"scope": 10039,
"src": "17872:782:8",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": null,
"documentation": {
"id": 9774,
"nodeType": "StructuredDocumentation",
"src": "18662:615:8",
"text": " @dev converts a specific amount of source tokens to target tokens\n called by ConverterBase and allows the inherited contracts to implement custom conversion logic\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"id": 9789,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9785,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9776,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19312:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9775,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "19312:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9778,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19347:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9777,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "19347:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9780,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19382:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9779,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19382:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9782,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19408:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9781,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19408:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9784,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19434:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9783,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19434:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19301:162:8"
},
"returnParameters": {
"id": 9788,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9787,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19517:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9786,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19517:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19516:9:8"
},
"scope": 10039,
"src": "19283:243:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 9805,
"nodeType": "Block",
"src": "19790:78:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9802,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "19845:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9799,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "19826:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 9797,
"name": "_targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9792,
"src": "19808:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "19808:17:8",
"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": 9800,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19808:32:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9801,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "19808:36:8",
"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": 9803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19808:52:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9796,
"id": 9804,
"nodeType": "Return",
"src": "19801:59:8"
}
]
},
"documentation": {
"id": 9790,
"nodeType": "StructuredDocumentation",
"src": "19534:173:8",
"text": " @dev returns the conversion fee for a given target amount\n @param _targetAmount target amount\n @return conversion fee"
},
"id": 9806,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "calculateFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9793,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9792,
"mutability": "mutable",
"name": "_targetAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9806,
"src": "19735:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9791,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19735:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19734:23:8"
},
"returnParameters": {
"id": 9796,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9795,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9806,
"src": "19781:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9794,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19781:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19780:9:8"
},
"scope": 10039,
"src": "19713:155:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9843,
"nodeType": "Block",
"src": "20153:230:8",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 9817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9815,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20168:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9816,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "20185:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "20168:36:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 9840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9829,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "20303:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9831,
"indexExpression": {
"argumentTypes": null,
"id": 9830,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20312:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20303:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9832,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "20303:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9837,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "20369:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9836,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20361:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9835,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20361:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20361:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 9833,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20337:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 9834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "20337:23:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 9839,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20337:38:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20303:72:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9841,
"nodeType": "ExpressionStatement",
"src": "20303:72:8"
},
"id": 9842,
"nodeType": "IfStatement",
"src": "20164:211:8",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 9827,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9818,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "20219:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9820,
"indexExpression": {
"argumentTypes": null,
"id": 9819,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20228:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20219:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9821,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "20219:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9824,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "20261:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9823,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20253:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9822,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20253:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9825,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20253:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9826,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20253:21:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20219:55:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9828,
"nodeType": "ExpressionStatement",
"src": "20219:55:8"
}
}
]
},
"documentation": {
"id": 9807,
"nodeType": "StructuredDocumentation",
"src": "19876:179:8",
"text": " @dev syncs the stored reserve balance for a given reserve with the real reserve balance\n @param _reserveToken address of the reserve token"
},
"id": 9844,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9812,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20138:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9813,
"modifierName": {
"argumentTypes": null,
"id": 9811,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "20125:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "20125:27:8"
}
],
"name": "syncReserveBalance",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9809,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9844,
"src": "20089:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9808,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "20089:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20088:27:8"
},
"returnParameters": {
"id": 9814,
"nodeType": "ParameterList",
"parameters": [],
"src": "20153:0:8"
},
"scope": 10039,
"src": "20061:322:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9870,
"nodeType": "Block",
"src": "20496:165:8",
"statements": [
{
"assignments": [
9849
],
"declarations": [
{
"constant": false,
"id": 9849,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9870,
"src": "20507:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9848,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20507:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9852,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9850,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "20530:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9851,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20530:20:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20507:43:8"
},
{
"body": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9864,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "20636:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9866,
"indexExpression": {
"argumentTypes": null,
"id": 9865,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20650:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20636:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9863,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "20617:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20617:36:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9868,
"nodeType": "ExpressionStatement",
"src": "20617:36:8"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 9859,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9857,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20581:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 9858,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9849,
"src": "20585:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20581:16:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 9869,
"initializationExpression": {
"assignments": [
9854
],
"declarations": [
{
"constant": false,
"id": 9854,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9869,
"src": "20566:9:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9853,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20566:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9856,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 9855,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20578:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "20566:13:8"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 9861,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "20599:3:8",
"subExpression": {
"argumentTypes": null,
"id": 9860,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20599:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9862,
"nodeType": "ExpressionStatement",
"src": "20599:3:8"
},
"nodeType": "ForStatement",
"src": "20561:92:8"
}
]
},
"documentation": {
"id": 9845,
"nodeType": "StructuredDocumentation",
"src": "20391:59:8",
"text": " @dev syncs all stored reserve balances"
},
"id": 9871,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "syncReserveBalances",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9846,
"nodeType": "ParameterList",
"parameters": [],
"src": "20484:2:8"
},
"returnParameters": {
"id": 9847,
"nodeType": "ParameterList",
"parameters": [],
"src": "20496:0:8"
},
"scope": 10039,
"src": "20456:205:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9907,
"nodeType": "Block",
"src": "21324:518:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 9892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9888,
"name": "_feeAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9884,
"src": "21705:10:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
},
"id": 9891,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 9889,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21718:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "323535",
"id": 9890,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21723:3:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_255_by_1",
"typeString": "int_const 255"
},
"value": "255"
},
"src": "21718:8:8",
"typeDescriptions": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
}
},
"src": "21705:21:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 9887,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "21698:6:8",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 9893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21698:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9894,
"nodeType": "ExpressionStatement",
"src": "21698:29:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9896,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9874,
"src": "21754:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9897,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9876,
"src": "21768:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9898,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9878,
"src": "21782:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9899,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9880,
"src": "21791:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 9900,
"name": "_returnAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9882,
"src": "21800:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9903,
"name": "_feeAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9884,
"src": "21822:10:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 9902,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21815:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 9901,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "21815:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9904,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21815:18:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 9895,
"name": "Conversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9078,
"src": "21743:10:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_int256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,int256)"
}
},
"id": 9905,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21743:91:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9906,
"nodeType": "EmitStatement",
"src": "21738:96:8"
}
]
},
"documentation": {
"id": 9872,
"nodeType": "StructuredDocumentation",
"src": "20669:409:8",
"text": " @dev helper, dispatches the Conversion event\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _trader address of the caller who executed the conversion\n @param _amount amount purchased/sold (in the source token)\n @param _returnAmount amount returned (in the target token)"
},
"id": 9908,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchConversionEvent",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9885,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9874,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21127:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9873,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "21127:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9876,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21162:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9875,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "21162:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9878,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21197:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9877,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21197:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9880,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21223:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9879,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21223:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9882,
"mutability": "mutable",
"name": "_returnAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21249:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9881,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21249:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9884,
"mutability": "mutable",
"name": "_feeAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21281:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9883,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21281:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "21116:184:8"
},
"returnParameters": {
"id": 9886,
"nodeType": "ParameterList",
"parameters": [],
"src": "21324:0:8"
},
"scope": 10039,
"src": "21084:758:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"baseFunctions": [
13297
],
"body": {
"id": 9917,
"nodeType": "Block",
"src": "22030:32:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9915,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "22048:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"functionReturnParameters": 9914,
"id": 9916,
"nodeType": "Return",
"src": "22041:13:8"
}
]
},
"documentation": {
"id": 9909,
"nodeType": "StructuredDocumentation",
"src": "21850:109:8",
"text": " @dev deprecated since version 28, backward compatibility - use only for earlier versions"
},
"functionSelector": "fc0c546a",
"id": 9918,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "token",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9911,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "21994:8:8"
},
"parameters": {
"id": 9910,
"nodeType": "ParameterList",
"parameters": [],
"src": "21979:2:8"
},
"returnParameters": {
"id": 9914,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9913,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9918,
"src": "22012:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9912,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "22012:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22011:18:8"
},
"scope": 10039,
"src": "21965:97:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13302
],
"body": {
"id": 9931,
"nodeType": "Block",
"src": "22213:53:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9928,
"name": "_newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9921,
"src": "22248:9:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9927,
"name": "transferAnchorOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9381,
"src": "22224:23:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 9929,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22224:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9930,
"nodeType": "ExpressionStatement",
"src": "22224:34:8"
}
]
},
"documentation": {
"id": 9919,
"nodeType": "StructuredDocumentation",
"src": "22070:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "21e6b53d",
"id": 9932,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9925,
"modifierName": {
"argumentTypes": null,
"id": 9924,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "22203:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "22203:9:8"
}
],
"name": "transferTokenOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9923,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22194:8:8"
},
"parameters": {
"id": 9922,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9921,
"mutability": "mutable",
"name": "_newOwner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9932,
"src": "22168:17:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9920,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22168:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22167:19:8"
},
"returnParameters": {
"id": 9926,
"nodeType": "ParameterList",
"parameters": [],
"src": "22213:0:8"
},
"scope": 10039,
"src": "22136:130:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13305
],
"body": {
"id": 9942,
"nodeType": "Block",
"src": "22398:42:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9939,
"name": "acceptAnchorOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9405,
"src": "22409:21:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22409:23:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9941,
"nodeType": "ExpressionStatement",
"src": "22409:23:8"
}
]
},
"documentation": {
"id": 9933,
"nodeType": "StructuredDocumentation",
"src": "22274:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "38a5e016",
"id": 9943,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9937,
"modifierName": {
"argumentTypes": null,
"id": 9936,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "22388:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "22388:9:8"
}
],
"name": "acceptTokenOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9935,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22379:8:8"
},
"parameters": {
"id": 9934,
"nodeType": "ParameterList",
"parameters": [],
"src": "22369:2:8"
},
"returnParameters": {
"id": 9938,
"nodeType": "ParameterList",
"parameters": [],
"src": "22398:0:8"
},
"scope": 10039,
"src": "22340:100:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13320
],
"body": {
"id": 9976,
"nodeType": "Block",
"src": "22621:141:8",
"statements": [
{
"assignments": [
9961
],
"declarations": [
{
"constant": false,
"id": 9961,
"mutability": "mutable",
"name": "reserve",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9976,
"src": "22632:22:8",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve"
},
"typeName": {
"contractScope": null,
"id": 9960,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "22632:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9965,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9962,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "22657:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9964,
"indexExpression": {
"argumentTypes": null,
"id": 9963,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9946,
"src": "22666:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22657:18:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22632:43:8"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9966,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22693:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9967,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "22693:15:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9968,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22710:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9969,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "22710:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9970,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22726:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9971,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22733:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9972,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22740:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9973,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "22740:13:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 9974,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "22692:62:8",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"functionReturnParameters": 9959,
"id": 9975,
"nodeType": "Return",
"src": "22686:68:8"
}
]
},
"documentation": {
"id": 9944,
"nodeType": "StructuredDocumentation",
"src": "22448:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "0e53aae9",
"id": 9977,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectors",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9948,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22568:8:8"
},
"parameters": {
"id": 9947,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9946,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22534:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9945,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22534:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22533:22:8"
},
"returnParameters": {
"id": 9959,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9950,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22586:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9949,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22586:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9952,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22595:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9951,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "22595:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9954,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22603:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9953,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22603:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9956,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22609:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9955,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22609:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9958,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22615:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9957,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22615:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22585:35:8"
},
"scope": 10039,
"src": "22514:248:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13334
],
"body": {
"id": 9991,
"nodeType": "Block",
"src": "22920:61:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9986,
"name": "ConverterBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10039,
"src": "22938:13:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ConverterBase_$10039_$",
"typeString": "type(contract ConverterBase)"
}
},
"id": 9987,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "reserveTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 9036,
"src": "22938:27:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9989,
"indexExpression": {
"argumentTypes": null,
"id": 9988,
"name": "_index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9980,
"src": "22966:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22938:35:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 9985,
"id": 9990,
"nodeType": "Return",
"src": "22931:42:8"
}
]
},
"documentation": {
"id": 9978,
"nodeType": "StructuredDocumentation",
"src": "22770:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "19b64015",
"id": 9992,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectorTokens",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9982,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22889:8:8"
},
"parameters": {
"id": 9981,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9980,
"mutability": "mutable",
"name": "_index",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9992,
"src": "22861:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9979,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22861:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22860:16:8"
},
"returnParameters": {
"id": 9985,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9984,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9992,
"src": "22907:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9983,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22907:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22906:13:8"
},
"scope": 10039,
"src": "22836:145:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13339
],
"body": {
"id": 10002,
"nodeType": "Block",
"src": "23124:45:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9999,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "23142:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 10000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23142:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 9998,
"id": 10001,
"nodeType": "Return",
"src": "23135:26:8"
}
]
},
"documentation": {
"id": 9993,
"nodeType": "StructuredDocumentation",
"src": "22989:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "71f52bf3",
"id": 10003,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectorTokenCount",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9995,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "23098:8:8"
},
"parameters": {
"id": 9994,
"nodeType": "ParameterList",
"parameters": [],
"src": "23083:2:8"
},
"returnParameters": {
"id": 9998,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9997,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10003,
"src": "23116:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9996,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "23116:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23115:8:8"
},
"scope": 10039,
"src": "23055:114:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13327
],
"body": {
"id": 10016,
"nodeType": "Block",
"src": "23340:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10013,
"name": "_connectorToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10006,
"src": "23373:15:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 10012,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "23358:14:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 10014,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23358:31:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 10011,
"id": 10015,
"nodeType": "Return",
"src": "23351:38:8"
}
]
},
"documentation": {
"id": 10004,
"nodeType": "StructuredDocumentation",
"src": "23177:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "d8959512",
"id": 10017,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConnectorBalance",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 10008,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "23313:8:8"
},
"parameters": {
"id": 10007,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10006,
"mutability": "mutable",
"name": "_connectorToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10017,
"src": "23272:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10005,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23272:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23271:29:8"
},
"returnParameters": {
"id": 10011,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10010,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10017,
"src": "23331:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10009,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23331:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23330:9:8"
},
"scope": 10039,
"src": "23243:154:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 10037,
"nodeType": "Block",
"src": "23598:81:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10032,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10020,
"src": "23635:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 10033,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10022,
"src": "23649:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 10034,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10024,
"src": "23663:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10031,
"name": "targetAmountAndFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9256,
"src": "23616:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 10035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23616:55:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 10030,
"id": 10036,
"nodeType": "Return",
"src": "23609:62:8"
}
]
},
"documentation": {
"id": 10018,
"nodeType": "StructuredDocumentation",
"src": "23405:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "1e1401f8",
"id": 10038,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10025,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10020,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23490:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10019,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23490:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10022,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23516:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10021,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23516:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10024,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23542:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10023,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23542:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23489:69:8"
},
"returnParameters": {
"id": 10030,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10027,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23580:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10026,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23580:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10029,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23589:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10028,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23589:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23579:18:8"
},
"scope": 10039,
"src": "23471:208:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"scope": 10040,
"src": "1648:22034:8"
}
],
"src": "52:23632:8"
},
"legacyAST": {
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/ConverterBase.sol",
"exportedSymbols": {
"ConverterBase": [
10039
]
},
"id": 10040,
"license": "SEE LICENSE IN LICENSE",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8979,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "52:23:8"
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverter.sol",
"file": "./interfaces/IConverter.sol",
"id": 8980,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13341,
"src": "77:37:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterAnchor.sol",
"file": "./interfaces/IConverterAnchor.sol",
"id": 8981,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13350,
"src": "116:43:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IConverterUpgrader.sol",
"file": "./interfaces/IConverterUpgrader.sol",
"id": 8982,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13661,
"src": "161:45:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol",
"file": "./interfaces/IBancorFormula.sol",
"id": 8983,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 13178,
"src": "208:41:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ContractRegistryClient.sol",
"file": "../utility/ContractRegistryClient.sol",
"id": 8984,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 21720,
"src": "251:47:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol",
"file": "../utility/ReentrancyGuard.sol",
"id": 8985,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22243,
"src": "300:40:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/SafeMath.sol",
"file": "../utility/SafeMath.sol",
"id": 8986,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22355,
"src": "342:33:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHandler.sol",
"file": "../utility/TokenHandler.sol",
"id": 8987,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22527,
"src": "377:37:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/TokenHolder.sol",
"file": "../utility/TokenHolder.sol",
"id": 8988,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 22576,
"src": "416:36:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/token/interfaces/IEtherToken.sol",
"file": "../token/interfaces/IEtherToken.sol",
"id": 8989,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 21154,
"src": "454:45:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/bancorx/interfaces/IBancorX.sol",
"file": "../bancorx/interfaces/IBancorX.sol",
"id": 8990,
"nodeType": "ImportDirective",
"scope": 10040,
"sourceUnit": 3552,
"src": "501:44:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8992,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "1683:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
"id": 8993,
"nodeType": "InheritanceSpecifier",
"src": "1683:10:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8994,
"name": "TokenHandler",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22526,
"src": "1695:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHandler_$22526",
"typeString": "contract TokenHandler"
}
},
"id": 8995,
"nodeType": "InheritanceSpecifier",
"src": "1695:12:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8996,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "1709:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
},
"id": 8997,
"nodeType": "InheritanceSpecifier",
"src": "1709:11:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8998,
"name": "ContractRegistryClient",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21719,
"src": "1722:22:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ContractRegistryClient_$21719",
"typeString": "contract ContractRegistryClient"
}
},
"id": 8999,
"nodeType": "InheritanceSpecifier",
"src": "1722:22:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 9000,
"name": "ReentrancyGuard",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22242,
"src": "1746:15:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ReentrancyGuard_$22242",
"typeString": "contract ReentrancyGuard"
}
},
"id": 9001,
"nodeType": "InheritanceSpecifier",
"src": "1746:15:8"
}
],
"contractDependencies": [
13340,
21719,
21818,
22242,
22526,
22575,
22661,
22847,
22907
],
"contractKind": "contract",
"documentation": {
"id": 8991,
"nodeType": "StructuredDocumentation",
"src": "549:1097:8",
"text": " @dev ConverterBase\n The converter contains the main logic for conversions between different ERC20 tokens.\n It is also the upgradable part of the mechanism (note that upgrades are opt-in).\n The anchor must be set on construction and cannot be changed afterwards.\n Wrappers are provided for some of the anchor's functions, for easier access.\n Once the converter accepts ownership of the anchor, it becomes the anchor's sole controller\n and can execute any of its functions.\n To upgrade the converter, anchor ownership must be transferred to a new converter, along with\n any relevant data.\n Note that the converter can transfer anchor ownership to a new converter that\n doesn't allow upgrades anymore, for finalizing the relationship between the converter\n and the anchor.\n Converter types (defined as uint16 type) -\n 0 = liquid token converter\n 1 = liquidity pool v1 converter\n 2 = liquidity pool v2 converter\n Note that converters don't currently support tokens with transfer fees."
},
"fullyImplemented": false,
"id": 10039,
"linearizedBaseContracts": [
10039,
22242,
21719,
22575,
22661,
21818,
22526,
22907,
13340,
22847
],
"name": "ConverterBase",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 9004,
"libraryName": {
"contractScope": null,
"id": 9002,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22354,
"src": "1775:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$22354",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "1769:27:8",
"typeName": {
"id": 9003,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1788:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"id": 9007,
"mutability": "constant",
"name": "PPM_RESOLUTION",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "1804:49:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9005,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1804:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31303030303030",
"id": 9006,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1846:7:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000_by_1",
"typeString": "int_const 1000000"
},
"value": "1000000"
},
"visibility": "internal"
},
{
"constant": true,
"id": 9012,
"mutability": "constant",
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "1860:107:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9008,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "1860:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "307845656565654565656545654565654565456545656545454565656565456565656565656545456545",
"id": 9010,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1924:42:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 9009,
"name": "IERC20Token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21127,
"src": "1912:11:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Token_$21127_$",
"typeString": "type(contract IERC20Token)"
}
},
"id": 9011,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1912:55:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"visibility": "internal"
},
{
"canonicalName": "ConverterBase.Reserve",
"id": 9023,
"members": [
{
"constant": false,
"id": 9014,
"mutability": "mutable",
"name": "balance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2002:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9013,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2002:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9016,
"mutability": "mutable",
"name": "weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2050:13:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9015,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2050:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9018,
"mutability": "mutable",
"name": "deprecated1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2128:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9017,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2128:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9020,
"mutability": "mutable",
"name": "deprecated2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2171:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9019,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2171:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9022,
"mutability": "mutable",
"name": "isSet",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9023,
"src": "2214:10:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9021,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2214:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Reserve",
"nodeType": "StructDefinition",
"scope": 10039,
"src": "1976:313:8",
"visibility": "public"
},
{
"constant": true,
"documentation": {
"id": 9024,
"nodeType": "StructuredDocumentation",
"src": "2297:40:8",
"text": " @dev version number"
},
"functionSelector": "54fd4d50",
"id": 9027,
"mutability": "constant",
"name": "version",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2343:35:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9025,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "2343:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3339",
"id": 9026,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2376:2:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_39_by_1",
"typeString": "int_const 39"
},
"value": "39"
},
"visibility": "public"
},
{
"baseFunctions": [
13195
],
"constant": false,
"functionSelector": "d3fb73b4",
"id": 9030,
"mutability": "mutable",
"name": "anchor",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9029,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2411:8:8"
},
"scope": 10039,
"src": "2387:39:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9028,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "2387:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "public"
},
{
"baseFunctions": [
13233
],
"constant": false,
"functionSelector": "c45d3d92",
"id": 9033,
"mutability": "mutable",
"name": "conversionWhitelist",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9032,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "2491:8:8"
},
"scope": 10039,
"src": "2473:46:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
},
"typeName": {
"contractScope": null,
"id": 9031,
"name": "IWhitelist",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22917,
"src": "2473:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "d031370b",
"id": 9036,
"mutability": "mutable",
"name": "reserveTokens",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2613:34:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 9034,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2613:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 9035,
"length": null,
"nodeType": "ArrayTypeName",
"src": "2613:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage_ptr",
"typeString": "contract IERC20Token[]"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "d66bd524",
"id": 9040,
"mutability": "mutable",
"name": "reserves",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2754:48:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve)"
},
"typeName": {
"id": 9039,
"keyType": {
"contractScope": null,
"id": 9037,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "2763:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "Mapping",
"src": "2754:32:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve)"
},
"valueType": {
"contractScope": null,
"id": 9038,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "2778:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "0c7d5cd8",
"id": 9043,
"mutability": "mutable",
"name": "reserveRatio",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "2899:30:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9041,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2899:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9042,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2928:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"baseFunctions": [
13243
],
"constant": false,
"functionSelector": "94c275ad",
"id": 9047,
"mutability": "mutable",
"name": "maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9045,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3055:8:8"
},
"scope": 10039,
"src": "3041:43:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9044,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3041:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9046,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3083:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"baseFunctions": [
13238
],
"constant": false,
"functionSelector": "579cd3ca",
"id": 9051,
"mutability": "mutable",
"name": "conversionFee",
"nodeType": "VariableDeclaration",
"overrides": {
"id": 9049,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "3306:8:8"
},
"scope": 10039,
"src": "3292:40:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9048,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "3292:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30",
"id": 9050,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3331:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "bf754558",
"id": 9054,
"mutability": "constant",
"name": "conversionsEnabled",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10039,
"src": "3417:46:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9052,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3417:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9053,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3459:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"visibility": "public"
},
{
"anonymous": false,
"documentation": {
"id": 9055,
"nodeType": "StructuredDocumentation",
"src": "3514:260:8",
"text": " @dev triggered when the converter is activated\n @param _type converter type\n @param _anchor converter anchor\n @param _activated true if the converter was activated, false if it was deactivated"
},
"id": 9063,
"name": "Activation",
"nodeType": "EventDefinition",
"parameters": {
"id": 9062,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9057,
"indexed": true,
"mutability": "mutable",
"name": "_type",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3797:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9056,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3797:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9059,
"indexed": true,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3819:32:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9058,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "3819:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9061,
"indexed": true,
"mutability": "mutable",
"name": "_activated",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9063,
"src": "3853:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9060,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3853:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3796:81:8"
},
"src": "3780:98:8"
},
{
"anonymous": false,
"documentation": {
"id": 9064,
"nodeType": "StructuredDocumentation",
"src": "3886:447:8",
"text": " @dev triggered when a conversion between two tokens occurs\n @param _fromToken source ERC20 token\n @param _toToken target ERC20 token\n @param _trader wallet that initiated the trade\n @param _amount amount converted, in the source token\n @param _return amount returned, minus conversion fee\n @param _conversionFee conversion fee"
},
"id": 9078,
"name": "Conversion",
"nodeType": "EventDefinition",
"parameters": {
"id": 9077,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9066,
"indexed": true,
"mutability": "mutable",
"name": "_fromToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4366:30:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9065,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4366:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9068,
"indexed": true,
"mutability": "mutable",
"name": "_toToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4407:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9067,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "4407:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9070,
"indexed": true,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4446:23:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9069,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4446:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9072,
"indexed": false,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4480:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9071,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4480:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9074,
"indexed": false,
"mutability": "mutable",
"name": "_return",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4506:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9073,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4506:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9076,
"indexed": false,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9078,
"src": "4532:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 9075,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4532:6:8",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4355:205:8"
},
"src": "4339:222:8"
},
{
"anonymous": false,
"documentation": {
"id": 9079,
"nodeType": "StructuredDocumentation",
"src": "4569:562:8",
"text": " @dev triggered when the rate between two tokens in the converter changes\n note that the event might be dispatched for rate updates between any two tokens in the converter\n note that prior to version 28, you should use the 'PriceDataUpdate' event instead\n @param _token1 address of the first token\n @param _token2 address of the second token\n @param _rateN rate of 1 unit of `_token1` in `_token2` (numerator)\n @param _rateD rate of 1 unit of `_token1` in `_token2` (denominator)"
},
"id": 9089,
"name": "TokenRateUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 9088,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9081,
"indexed": true,
"mutability": "mutable",
"name": "_token1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5169:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9080,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5169:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9083,
"indexed": true,
"mutability": "mutable",
"name": "_token2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5207:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9082,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "5207:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9085,
"indexed": false,
"mutability": "mutable",
"name": "_rateN",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5245:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9084,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5245:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9087,
"indexed": false,
"mutability": "mutable",
"name": "_rateD",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9089,
"src": "5270:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9086,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5270:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5158:133:8"
},
"src": "5137:155:8"
},
{
"anonymous": false,
"documentation": {
"id": 9090,
"nodeType": "StructuredDocumentation",
"src": "5300:220:8",
"text": " @dev triggered when the conversion fee is updated\n @param _prevFee previous fee percentage, represented in ppm\n @param _newFee new fee percentage, represented in ppm"
},
"id": 9096,
"name": "ConversionFeeUpdate",
"nodeType": "EventDefinition",
"parameters": {
"id": 9095,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9092,
"indexed": false,
"mutability": "mutable",
"name": "_prevFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9096,
"src": "5552:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9091,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5552:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9094,
"indexed": false,
"mutability": "mutable",
"name": "_newFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9096,
"src": "5569:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9093,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "5569:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5551:33:8"
},
"src": "5526:59:8"
},
{
"body": {
"id": 9126,
"nodeType": "Block",
"src": "6192:82:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9118,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "6203:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9119,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9099,
"src": "6212:7:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"src": "6203:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9121,
"nodeType": "ExpressionStatement",
"src": "6203:16:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9122,
"name": "maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9047,
"src": "6230:16:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9123,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9103,
"src": "6249:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6230:36:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9125,
"nodeType": "ExpressionStatement",
"src": "6230:36:8"
}
]
},
"documentation": {
"id": 9097,
"nodeType": "StructuredDocumentation",
"src": "5593:313:8",
"text": " @dev used by sub-contracts to initialize a new converter\n @param _anchor anchor governed by the converter\n @param _registry address of a contract registry contract\n @param _maxConversionFee maximum conversion fee, represented in ppm"
},
"id": 9127,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9108,
"name": "_anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9099,
"src": "6069:7:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 9107,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6061:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9106,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6061:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6061:16:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9110,
"modifierName": {
"argumentTypes": null,
"id": 9105,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "6048:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "6048:30:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9112,
"name": "_registry",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9101,
"src": "6111:9:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
}
],
"id": 9113,
"modifierName": {
"argumentTypes": null,
"id": 9111,
"name": "ContractRegistryClient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21719,
"src": "6088:22:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ContractRegistryClient_$21719_$",
"typeString": "type(contract ContractRegistryClient)"
}
},
"nodeType": "ModifierInvocation",
"src": "6088:33:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9115,
"name": "_maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9103,
"src": "6168:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 9116,
"modifierName": {
"argumentTypes": null,
"id": 9114,
"name": "validConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9196,
"src": "6149:18:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint32_$",
"typeString": "modifier (uint32)"
}
},
"nodeType": "ModifierInvocation",
"src": "6149:37:8"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9104,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9099,
"mutability": "mutable",
"name": "_anchor",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "5934:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9098,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "5934:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9101,
"mutability": "mutable",
"name": "_registry",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "5969:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
},
"typeName": {
"contractScope": null,
"id": 9100,
"name": "IContractRegistry",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22831,
"src": "5969:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IContractRegistry_$22831",
"typeString": "contract IContractRegistry"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9103,
"mutability": "mutable",
"name": "_maxConversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9127,
"src": "6007:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9102,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "6007:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5923:115:8"
},
"returnParameters": {
"id": 9117,
"nodeType": "ParameterList",
"parameters": [],
"src": "6192:0:8"
},
"scope": 10039,
"src": "5912:362:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9133,
"nodeType": "Block",
"src": "6345:40:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9129,
"name": "_active",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9144,
"src": "6356:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 9130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6356:9:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9131,
"nodeType": "ExpressionStatement",
"src": "6356:9:8"
},
{
"id": 9132,
"nodeType": "PlaceholderStatement",
"src": "6376:1:8"
}
]
},
"documentation": null,
"id": 9134,
"name": "active",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9128,
"nodeType": "ParameterList",
"parameters": [],
"src": "6342:2:8"
},
"src": "6327:58:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9143,
"nodeType": "Block",
"src": "6473:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9138,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "6492:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9139,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6492:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e414354495645",
"id": 9140,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6504:14:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a22dd8039fb80c8642cf17389b806c873aa9fbdbf3f2bd8746d8ce373ef50f9e",
"typeString": "literal_string \"ERR_INACTIVE\""
},
"value": "ERR_INACTIVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_a22dd8039fb80c8642cf17389b806c873aa9fbdbf3f2bd8746d8ce373ef50f9e",
"typeString": "literal_string \"ERR_INACTIVE\""
}
],
"id": 9137,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6484:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6484:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9142,
"nodeType": "ExpressionStatement",
"src": "6484:35:8"
}
]
},
"documentation": null,
"id": 9144,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_active",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9135,
"nodeType": "ParameterList",
"parameters": [],
"src": "6456:2:8"
},
"returnParameters": {
"id": 9136,
"nodeType": "ParameterList",
"parameters": [],
"src": "6473:0:8"
},
"scope": 10039,
"src": "6440:87:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9150,
"nodeType": "Block",
"src": "6604:42:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9146,
"name": "_inactive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9162,
"src": "6615:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 9147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6615:11:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9148,
"nodeType": "ExpressionStatement",
"src": "6615:11:8"
},
{
"id": 9149,
"nodeType": "PlaceholderStatement",
"src": "6637:1:8"
}
]
},
"documentation": null,
"id": 9151,
"name": "inactive",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9145,
"nodeType": "ParameterList",
"parameters": [],
"src": "6601:2:8"
},
"src": "6584:62:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9161,
"nodeType": "Block",
"src": "6736:53:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "6755:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9155,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "6756:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9156,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6756:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f414354495645",
"id": 9158,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6768:12:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_181d3d32638945611c2cb46b623de141c5e74a32dcd850864f64837aa849ee3f",
"typeString": "literal_string \"ERR_ACTIVE\""
},
"value": "ERR_ACTIVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_181d3d32638945611c2cb46b623de141c5e74a32dcd850864f64837aa849ee3f",
"typeString": "literal_string \"ERR_ACTIVE\""
}
],
"id": 9154,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "6747:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6747:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9160,
"nodeType": "ExpressionStatement",
"src": "6747:34:8"
}
]
},
"documentation": null,
"id": 9162,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_inactive",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9152,
"nodeType": "ParameterList",
"parameters": [],
"src": "6719:2:8"
},
"returnParameters": {
"id": 9153,
"nodeType": "ParameterList",
"parameters": [],
"src": "6736:0:8"
},
"scope": 10039,
"src": "6701:88:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9171,
"nodeType": "Block",
"src": "6948:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9167,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9164,
"src": "6973:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9166,
"name": "_validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9186,
"src": "6959:13:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token) view"
}
},
"id": 9168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6959:23:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9169,
"nodeType": "ExpressionStatement",
"src": "6959:23:8"
},
{
"id": 9170,
"nodeType": "PlaceholderStatement",
"src": "6993:1:8"
}
]
},
"documentation": null,
"id": 9172,
"name": "validReserve",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9165,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9164,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9172,
"src": "6926:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9163,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "6926:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6925:22:8"
},
"src": "6904:98:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9185,
"nodeType": "Block",
"src": "7116:75:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9178,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "7135:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9180,
"indexExpression": {
"argumentTypes": null,
"id": 9179,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9174,
"src": "7144:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7135:18:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9181,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "7135:24:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9182,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7161:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9177,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7127:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7127:56:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9184,
"nodeType": "ExpressionStatement",
"src": "7127:56:8"
}
]
},
"documentation": null,
"id": 9186,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validReserve",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9175,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9174,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9186,
"src": "7080:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9173,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "7080:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7079:22:8"
},
"returnParameters": {
"id": 9176,
"nodeType": "ParameterList",
"parameters": [],
"src": "7116:0:8"
},
"scope": 10039,
"src": "7057:134:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9195,
"nodeType": "Block",
"src": "7283:66:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9191,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9188,
"src": "7314:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9190,
"name": "_validConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9209,
"src": "7294:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$__$",
"typeString": "function (uint32) pure"
}
},
"id": 9192,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7294:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9193,
"nodeType": "ExpressionStatement",
"src": "7294:35:8"
},
{
"id": 9194,
"nodeType": "PlaceholderStatement",
"src": "7340:1:8"
}
]
},
"documentation": null,
"id": 9196,
"name": "validConversionFee",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9189,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9188,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9196,
"src": "7260:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9187,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7260:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7259:23:8"
},
"src": "7232:117:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9208,
"nodeType": "Block",
"src": "7470:90:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9204,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9202,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9198,
"src": "7489:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9203,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "7507:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "7489:32:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f434f4e56455253494f4e5f464545",
"id": 9205,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7523:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
},
"value": "ERR_INVALID_CONVERSION_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
}
],
"id": 9201,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7481:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7481:71:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9207,
"nodeType": "ExpressionStatement",
"src": "7481:71:8"
}
]
},
"documentation": null,
"id": 9209,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validConversionFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9199,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9198,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9209,
"src": "7433:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9197,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7433:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7432:23:8"
},
"returnParameters": {
"id": 9200,
"nodeType": "ParameterList",
"parameters": [],
"src": "7470:0:8"
},
"scope": 10039,
"src": "7404:156:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9218,
"nodeType": "Block",
"src": "7645:59:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9214,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9211,
"src": "7676:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9213,
"name": "_validReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9236,
"src": "7656:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$__$",
"typeString": "function (uint32) pure"
}
},
"id": 9215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7656:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9216,
"nodeType": "ExpressionStatement",
"src": "7656:28:8"
},
{
"id": 9217,
"nodeType": "PlaceholderStatement",
"src": "7695:1:8"
}
]
},
"documentation": null,
"id": 9219,
"name": "validReserveWeight",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 9212,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9211,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9219,
"src": "7629:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9210,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7629:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7628:16:8"
},
"src": "7601:103:8",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9235,
"nodeType": "Block",
"src": "7818:98:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9231,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9227,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9225,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9221,
"src": "7837:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 9226,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7847:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "7837:11:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9230,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9228,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9221,
"src": "7852:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9229,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "7863:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "7852:25:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "7837:40:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f574549474854",
"id": 9232,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "7879:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
},
"value": "ERR_INVALID_RESERVE_WEIGHT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
}
],
"id": 9224,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "7829:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9233,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "7829:79:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9234,
"nodeType": "ExpressionStatement",
"src": "7829:79:8"
}
]
},
"documentation": null,
"id": 9236,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_validReserveWeight",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9222,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9221,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9236,
"src": "7788:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9220,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "7788:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7787:16:8"
},
"returnParameters": {
"id": 9223,
"nodeType": "ParameterList",
"parameters": [],
"src": "7818:0:8"
},
"scope": 10039,
"src": "7759:157:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"baseFunctions": [
13190
],
"body": null,
"documentation": null,
"functionSelector": "3e8ff43f",
"id": 9242,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "converterType",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9238,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8009:8:8"
},
"parameters": {
"id": 9237,
"nodeType": "ParameterList",
"parameters": [],
"src": "7986:2:8"
},
"returnParameters": {
"id": 9241,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9240,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9242,
"src": "8027:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9239,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8027:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8026:8:8"
},
"scope": 10039,
"src": "7964:71:8",
"stateMutability": "pure",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13213
],
"body": null,
"documentation": null,
"functionSelector": "af94b8d8",
"id": 9256,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "targetAmountAndFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9250,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8236:8:8"
},
"parameters": {
"id": 9249,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9244,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8111:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9243,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8111:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9246,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8137:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9245,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "8137:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9248,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8163:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9247,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8163:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8110:69:8"
},
"returnParameters": {
"id": 9255,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9252,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8263:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9251,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8263:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9254,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9256,
"src": "8272:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9253,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8272:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "8262:18:8"
},
"scope": 10039,
"src": "8083:198:8",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13253
],
"body": {
"id": 9269,
"nodeType": "Block",
"src": "8435:281:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9262,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "8454:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9264,
"indexExpression": {
"argumentTypes": null,
"id": 9263,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "8463:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8454:29:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9265,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "8454:35:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9266,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8491:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9261,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "8446:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8446:67:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9268,
"nodeType": "ExpressionStatement",
"src": "8446:67:8"
}
]
},
"documentation": {
"id": 9257,
"nodeType": "StructuredDocumentation",
"src": "8289:104:8",
"text": " @dev deposits ether\n can only be called if the converter has an ETH reserve"
},
"id": 9270,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9259,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "8418:8:8"
},
"parameters": {
"id": 9258,
"nodeType": "ParameterList",
"parameters": [],
"src": "8406:2:8"
},
"returnParameters": {
"id": 9260,
"nodeType": "ParameterList",
"parameters": [],
"src": "8435:0:8"
},
"scope": 10039,
"src": "8399:317:8",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"baseFunctions": [
13285
],
"body": {
"id": 9315,
"nodeType": "Block",
"src": "9248:392:8",
"statements": [
{
"assignments": [
9285
],
"declarations": [
{
"constant": false,
"id": 9285,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9315,
"src": "9259:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9284,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9259:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9289,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9287,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "9297:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9286,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "9287:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9288,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9287:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "9259:57:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9297,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9293,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "9430:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9291,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "9431:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9292,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9431:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9294,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21728,
"src": "9445:5:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9295,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9285,
"src": "9454:17:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "9445:26:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "9430:41:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4143434553535f44454e494544",
"id": 9298,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9473:19:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
},
"value": "ERR_ACCESS_DENIED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
}
],
"id": 9290,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "9422:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9299,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9422:71:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9300,
"nodeType": "ExpressionStatement",
"src": "9422:71:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9306,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "9525:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9305,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "9517:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9304,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9517:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9517:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9308,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "9517:21:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 9301,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9273,
"src": "9504:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "9504:12:8",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 9309,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9504:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9310,
"nodeType": "ExpressionStatement",
"src": "9504:35:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9312,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "9612:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9311,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "9593:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "9593:39:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9314,
"nodeType": "ExpressionStatement",
"src": "9593:39:8"
}
]
},
"documentation": {
"id": 9271,
"nodeType": "StructuredDocumentation",
"src": "8724:356:8",
"text": " @dev withdraws ether\n can only be called by the owner if the converter is inactive or by upgrader contract\n can only be called after the upgrader contract has accepted the ownership of this contract\n can only be called if the converter has an ETH reserve\n @param _to address to send the ETH to"
},
"functionSelector": "690d8320",
"id": 9316,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9277,
"modifierName": {
"argumentTypes": null,
"id": 9276,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "9171:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9171:9:8"
},
{
"arguments": null,
"id": 9279,
"modifierName": {
"argumentTypes": null,
"id": 9278,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "9190:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "9190:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9281,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "9222:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9282,
"modifierName": {
"argumentTypes": null,
"id": 9280,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "9209:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "9209:33:8"
}
],
"name": "withdrawETH",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9275,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "9153:8:8"
},
"parameters": {
"id": 9274,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9273,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9316,
"src": "9107:19:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9272,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9107:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9106:21:8"
},
"returnParameters": {
"id": 9283,
"nodeType": "ParameterList",
"parameters": [],
"src": "9248:0:8"
},
"scope": 10039,
"src": "9086:554:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9324,
"nodeType": "Block",
"src": "9867:30:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9322,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9885:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 9321,
"id": 9323,
"nodeType": "Return",
"src": "9878:11:8"
}
]
},
"documentation": {
"id": 9317,
"nodeType": "StructuredDocumentation",
"src": "9648:161:8",
"text": " @dev checks whether or not the converter version is 28 or higher\n @return true, since the converter version is 28 or higher"
},
"functionSelector": "d260529c",
"id": 9325,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isV28OrHigher",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9318,
"nodeType": "ParameterList",
"parameters": [],
"src": "9837:2:8"
},
"returnParameters": {
"id": 9321,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9320,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9325,
"src": "9861:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9319,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "9861:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "9860:6:8"
},
"scope": 10039,
"src": "9815:82:8",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13271
],
"body": {
"id": 9344,
"nodeType": "Block",
"src": "10419:51:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9342,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9340,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "10430:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9341,
"name": "_whitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9328,
"src": "10452:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"src": "10430:32:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9343,
"nodeType": "ExpressionStatement",
"src": "10430:32:8"
}
]
},
"documentation": {
"id": 9326,
"nodeType": "StructuredDocumentation",
"src": "9905:357:8",
"text": " @dev allows the owner to update & enable the conversion whitelist contract address\n when set, only addresses that are whitelisted are actually allowed to use the converter\n note that the whitelist check is actually done by the BancorNetwork contract\n @param _whitelist address of a whitelist contract"
},
"functionSelector": "4af80f0e",
"id": 9345,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9332,
"modifierName": {
"argumentTypes": null,
"id": 9331,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "10366:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "10366:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9336,
"name": "_whitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9328,
"src": "10401:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
],
"id": 9335,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10393:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9334,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10393:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9337,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10393:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9338,
"modifierName": {
"argumentTypes": null,
"id": 9333,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "10385:7:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "10385:28:8"
}
],
"name": "setConversionWhitelist",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9330,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "10348:8:8"
},
"parameters": {
"id": 9329,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9328,
"mutability": "mutable",
"name": "_whitelist",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9345,
"src": "10300:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
},
"typeName": {
"contractScope": null,
"id": 9327,
"name": "IWhitelist",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22917,
"src": "10300:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10299:23:8"
},
"returnParameters": {
"id": 9339,
"nodeType": "ParameterList",
"parameters": [],
"src": "10419:0:8"
},
"scope": 10039,
"src": "10268:202:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13200
],
"body": {
"id": 9361,
"nodeType": "Block",
"src": "10705:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 9352,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "10723:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "owner",
"nodeType": "MemberAccess",
"referencedDeclaration": 22838,
"src": "10723:12:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
"typeString": "function () view external returns (address)"
}
},
"id": 9354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10723:14:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9357,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "10749:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9356,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "10741:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9355,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10741:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9358,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10741:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "10723:31:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 9351,
"id": 9360,
"nodeType": "Return",
"src": "10716:38:8"
}
]
},
"documentation": {
"id": 9346,
"nodeType": "StructuredDocumentation",
"src": "10478:157:8",
"text": " @dev returns true if the converter is active, false otherwise\n @return true if the converter is active, false otherwise"
},
"functionSelector": "22f3e2d4",
"id": 9362,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isActive",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9348,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "10681:8:8"
},
"parameters": {
"id": 9347,
"nodeType": "ParameterList",
"parameters": [],
"src": "10658:2:8"
},
"returnParameters": {
"id": 9351,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9350,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9362,
"src": "10699:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9349,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "10699:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "10698:6:8"
},
"scope": 10039,
"src": "10641:121:8",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"baseFunctions": [
13258
],
"body": {
"id": 9380,
"nodeType": "Block",
"src": "11256:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9377,
"name": "_newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9365,
"src": "11292:9:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 9374,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11267:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9376,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transferOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 22843,
"src": "11267:24:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$",
"typeString": "function (address) external"
}
},
"id": 9378,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11267:35:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9379,
"nodeType": "ExpressionStatement",
"src": "11267:35:8"
}
]
},
"documentation": {
"id": 9363,
"nodeType": "StructuredDocumentation",
"src": "10770:336:8",
"text": " @dev transfers the anchor ownership\n the new owner needs to accept the transfer\n can only be called by the converter upgrder while the upgrader is the owner\n note that prior to version 28, you should use 'transferAnchorOwnership' instead\n @param _newOwner new token owner"
},
"functionSelector": "67b6d57c",
"id": 9381,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9369,
"modifierName": {
"argumentTypes": null,
"id": 9368,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "11207:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "11207:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9371,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "11231:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 9372,
"modifierName": {
"argumentTypes": null,
"id": 9370,
"name": "only",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21577,
"src": "11226:4:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "11226:24:8"
}
],
"name": "transferAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9367,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "11189:8:8"
},
"parameters": {
"id": 9366,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9365,
"mutability": "mutable",
"name": "_newOwner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9381,
"src": "11145:17:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9364,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "11145:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "11144:19:8"
},
"returnParameters": {
"id": 9373,
"nodeType": "ParameterList",
"parameters": [],
"src": "11256:0:8"
},
"scope": 10039,
"src": "11112:198:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13261
],
"body": {
"id": 9404,
"nodeType": "Block",
"src": "11700:209:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 9392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9389,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "11781:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 9390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11781:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 9391,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11803:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "11781:23:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 9393,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11806:27:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 9388,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11773:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9394,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11773:61:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9395,
"nodeType": "ExpressionStatement",
"src": "11773:61:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 9396,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "11845:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9398,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "acceptOwnership",
"nodeType": "MemberAccess",
"referencedDeclaration": 22846,
"src": "11845:22:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$__$returns$__$",
"typeString": "function () external"
}
},
"id": 9399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11845:24:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9400,
"nodeType": "ExpressionStatement",
"src": "11845:24:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9401,
"name": "syncReserveBalances",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9871,
"src": "11880:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9402,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11880:21:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9403,
"nodeType": "ExpressionStatement",
"src": "11880:21:8"
}
]
},
"documentation": {
"id": 9382,
"nodeType": "StructuredDocumentation",
"src": "11318:309:8",
"text": " @dev accepts ownership of the anchor after an ownership transfer\n most converters are also activated as soon as they accept the anchor ownership\n can only be called by the contract owner\n note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"functionSelector": "cdc91c69",
"id": 9405,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9386,
"modifierName": {
"argumentTypes": null,
"id": 9385,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "11690:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "11690:9:8"
}
],
"name": "acceptAnchorOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9384,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "11681:8:8"
},
"parameters": {
"id": 9383,
"nodeType": "ParameterList",
"parameters": [],
"src": "11663:2:8"
},
"returnParameters": {
"id": 9387,
"nodeType": "ParameterList",
"parameters": [],
"src": "11700:0:8"
},
"scope": 10039,
"src": "11633:276:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 9425,
"nodeType": "Block",
"src": "12315:62:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9420,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9408,
"src": "12348:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9421,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9410,
"src": "12356:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9422,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9412,
"src": "12361:7:8",
"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"
}
],
"expression": {
"argumentTypes": null,
"id": 9417,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "12326:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"id": 9419,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 22906,
"src": "12326:21:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256) external"
}
},
"id": 9423,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12326:43:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9424,
"nodeType": "ExpressionStatement",
"src": "12326:43:8"
}
]
},
"documentation": {
"id": 9406,
"nodeType": "StructuredDocumentation",
"src": "11917:297:8",
"text": " @dev withdraws tokens held by the anchor and sends them to an account\n can only be called by the owner\n @param _token ERC20 token contract address\n @param _to account to receive the new amount\n @param _amount amount to withdraw"
},
"functionSelector": "395900d4",
"id": 9426,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9415,
"modifierName": {
"argumentTypes": null,
"id": 9414,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "12305:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12305:9:8"
}
],
"name": "withdrawFromAnchor",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9413,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9408,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12248:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9407,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "12248:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9410,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12268:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9409,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "12268:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9412,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9426,
"src": "12281:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9411,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "12281:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12247:50:8"
},
"returnParameters": {
"id": 9416,
"nodeType": "ParameterList",
"parameters": [],
"src": "12315:0:8"
},
"scope": 10039,
"src": "12220:157:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13266
],
"body": {
"id": 9451,
"nodeType": "Block",
"src": "12655:199:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9438,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9436,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12674:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 9437,
"name": "maxConversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9047,
"src": "12692:16:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "12674:34:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f434f4e56455253494f4e5f464545",
"id": 9439,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12710:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
},
"value": "ERR_INVALID_CONVERSION_FEE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ae729833ea0b2cfd1b35fa1d075ae330e76860b5ab276fa04bde88b85e5c4d00",
"typeString": "literal_string \"ERR_INVALID_CONVERSION_FEE\""
}
],
"id": 9435,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "12666:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12666:73:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9441,
"nodeType": "ExpressionStatement",
"src": "12666:73:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9443,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "12775:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"id": 9444,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12790:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 9442,
"name": "ConversionFeeUpdate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9096,
"src": "12755:19:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint32_$_t_uint32_$returns$__$",
"typeString": "function (uint32,uint32)"
}
},
"id": 9445,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "12755:50:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9446,
"nodeType": "EmitStatement",
"src": "12750:55:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9449,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9447,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "12816:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9448,
"name": "_conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9429,
"src": "12832:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "12816:30:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9450,
"nodeType": "ExpressionStatement",
"src": "12816:30:8"
}
]
},
"documentation": {
"id": 9427,
"nodeType": "StructuredDocumentation",
"src": "12385:189:8",
"text": " @dev updates the current conversion fee\n can only be called by the contract owner\n @param _conversionFee new conversion fee, represented in ppm"
},
"functionSelector": "ecbca55d",
"id": 9452,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9433,
"modifierName": {
"argumentTypes": null,
"id": 9432,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "12645:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "12645:9:8"
}
],
"name": "setConversionFee",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9431,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "12636:8:8"
},
"parameters": {
"id": 9430,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9429,
"mutability": "mutable",
"name": "_conversionFee",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9452,
"src": "12606:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9428,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "12606:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "12605:23:8"
},
"returnParameters": {
"id": 9434,
"nodeType": "ParameterList",
"parameters": [],
"src": "12655:0:8"
},
"scope": 10039,
"src": "12580:274:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13280,
22574
],
"body": {
"id": 9509,
"nodeType": "Block",
"src": "13506:559:8",
"statements": [
{
"assignments": [
9470
],
"declarations": [
{
"constant": false,
"id": 9470,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9509,
"src": "13517:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9469,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13517:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9474,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9472,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "13555:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9471,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "13545:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9473,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13545:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13517:57:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9488,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9484,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9480,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "13764:23:8",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9476,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "13765:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9478,
"indexExpression": {
"argumentTypes": null,
"id": 9477,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "13774:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "13765:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9479,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "13765:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"id": 9483,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "13791:11:8",
"subExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9481,
"name": "isActive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9362,
"src": "13792:8:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$",
"typeString": "function () view returns (bool)"
}
},
"id": 9482,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13792:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "13764:38:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9487,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9485,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21728,
"src": "13806:5:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9486,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9470,
"src": "13815:17:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "13806:26:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "13764:68:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4143434553535f44454e494544",
"id": 9489,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "13834:19:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
},
"value": "ERR_ACCESS_DENIED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_f5894269650d3e1726ed81a4f48c5b62c7dd6fa025b89d639952a7012960d666",
"typeString": "literal_string \"ERR_ACCESS_DENIED\""
}
],
"id": 9475,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "13756:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13756:98:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9491,
"nodeType": "ExpressionStatement",
"src": "13756:98:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9495,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "13886:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9496,
"name": "_to",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "13894:3:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9497,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "13899:7:8",
"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"
}
],
"expression": {
"argumentTypes": null,
"id": 9492,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "13865:5:8",
"typeDescriptions": {
"typeIdentifier": "t_super$_ConverterBase_$10039",
"typeString": "contract super ConverterBase"
}
},
"id": 9494,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "withdrawTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 22574,
"src": "13865:20:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (contract IERC20Token,address,uint256)"
}
},
"id": 9498,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13865:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9499,
"nodeType": "ExpressionStatement",
"src": "13865:42:8"
},
{
"condition": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9500,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "13994:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9502,
"indexExpression": {
"argumentTypes": null,
"id": 9501,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "14003:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "13994:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9503,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "13994:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 9508,
"nodeType": "IfStatement",
"src": "13990:67:8",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9505,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9455,
"src": "14050:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9504,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "14031:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14031:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9507,
"nodeType": "ExpressionStatement",
"src": "14031:26:8"
}
}
]
},
"documentation": {
"id": 9453,
"nodeType": "StructuredDocumentation",
"src": "12862:462:8",
"text": " @dev withdraws tokens held by the converter and sends them to an account\n can only be called by the owner\n note that reserve tokens can only be withdrawn by the owner while the converter is inactive\n unless the owner is the converter upgrader contract\n @param _token ERC20 token contract address\n @param _to account to receive the new amount\n @param _amount amount to withdraw"
},
"functionSelector": "5e35359e",
"id": 9510,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9465,
"modifierName": {
"argumentTypes": null,
"id": 9464,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "13472:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13472:9:8"
},
{
"arguments": null,
"id": 9467,
"modifierName": {
"argumentTypes": null,
"id": 9466,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "13491:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "13491:9:8"
}
],
"name": "withdrawTokens",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9463,
"nodeType": "OverrideSpecifier",
"overrides": [
{
"contractScope": null,
"id": 9461,
"name": "IConverter",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13340,
"src": "13438:10:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverter_$13340",
"typeString": "contract IConverter"
}
},
{
"contractScope": null,
"id": 9462,
"name": "TokenHolder",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 22575,
"src": "13450:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TokenHolder_$22575",
"typeString": "contract TokenHolder"
}
}
],
"src": "13429:33:8"
},
"parameters": {
"id": 9460,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9455,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13354:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9454,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "13354:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9457,
"mutability": "mutable",
"name": "_to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13374:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9456,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "13374:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9459,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9510,
"src": "13387:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "13387:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "13353:50:8"
},
"returnParameters": {
"id": 9468,
"nodeType": "ParameterList",
"parameters": [],
"src": "13506:0:8"
},
"scope": 10039,
"src": "13330:735:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9547,
"nodeType": "Block",
"src": "14324:338:8",
"statements": [
{
"assignments": [
9517
],
"declarations": [
{
"constant": false,
"id": 9517,
"mutability": "mutable",
"name": "converterUpgrader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9547,
"src": "14335:36:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
},
"typeName": {
"contractScope": null,
"id": 9516,
"name": "IConverterUpgrader",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13660,
"src": "14335:18:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9523,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9520,
"name": "CONVERTER_UPGRADER",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21542,
"src": "14403:18:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 9519,
"name": "addressOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21718,
"src": "14393:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$",
"typeString": "function (bytes32) view returns (address)"
}
},
"id": 9521,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14393:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9518,
"name": "IConverterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13660,
"src": "14374:18:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IConverterUpgrader_$13660_$",
"typeString": "type(contract IConverterUpgrader)"
}
},
"id": 9522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14374:49:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14335:88:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9525,
"name": "converterType",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9242,
"src": "14492:13:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$__$returns$_t_uint16_$",
"typeString": "function () pure returns (uint16)"
}
},
"id": 9526,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14492:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"argumentTypes": null,
"id": 9527,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "14509:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9528,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "14517:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 9524,
"name": "Activation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9063,
"src": "14481:10:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint16_$_t_contract$_IConverterAnchor_$13349_$_t_bool_$returns$__$",
"typeString": "function (uint16,contract IConverterAnchor,bool)"
}
},
"id": 9529,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14481:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9530,
"nodeType": "EmitStatement",
"src": "14476:47:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9534,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9517,
"src": "14562:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
],
"id": 9533,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14554:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9532,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "14554:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14554:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9531,
"name": "transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21787,
"src": "14536:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 9536,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14536:45:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9537,
"nodeType": "ExpressionStatement",
"src": "14536:45:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9541,
"name": "version",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9027,
"src": "14618:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"expression": {
"argumentTypes": null,
"id": 9538,
"name": "converterUpgrader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9517,
"src": "14592:17:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterUpgrader_$13660",
"typeString": "contract IConverterUpgrader"
}
},
"id": 9540,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "upgrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 13659,
"src": "14592:25:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint16_$returns$__$",
"typeString": "function (uint16) external"
}
},
"id": 9542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14592:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9543,
"nodeType": "ExpressionStatement",
"src": "14592:34:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9544,
"name": "acceptOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21817,
"src": "14637:15:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9545,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14637:17:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9546,
"nodeType": "ExpressionStatement",
"src": "14637:17:8"
}
]
},
"documentation": {
"id": 9511,
"nodeType": "StructuredDocumentation",
"src": "14073:209:8",
"text": " @dev upgrades the converter to the latest version\n can only be called by the owner\n note that the owner needs to call acceptOwnership on the new converter after the upgrade"
},
"functionSelector": "d55ec697",
"id": 9548,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9514,
"modifierName": {
"argumentTypes": null,
"id": 9513,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "14314:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "14314:9:8"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9512,
"nodeType": "ParameterList",
"parameters": [],
"src": "14304:2:8"
},
"returnParameters": {
"id": 9515,
"nodeType": "ParameterList",
"parameters": [],
"src": "14324:0:8"
},
"scope": 10039,
"src": "14288:374:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9560,
"nodeType": "Block",
"src": "14940:54:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9556,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "14965:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "14965:20:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 9555,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14958:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint16_$",
"typeString": "type(uint16)"
},
"typeName": {
"id": 9554,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "14958:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9558,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14958:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 9553,
"id": 9559,
"nodeType": "Return",
"src": "14951:35:8"
}
]
},
"documentation": {
"id": 9549,
"nodeType": "StructuredDocumentation",
"src": "14670:206:8",
"text": " @dev returns the number of reserve tokens defined\n note that prior to version 17, you should use 'connectorTokenCount' instead\n @return number of reserve tokens"
},
"functionSelector": "9b99a8e2",
"id": 9561,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "reserveTokenCount",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9550,
"nodeType": "ParameterList",
"parameters": [],
"src": "14908:2:8"
},
"returnParameters": {
"id": 9553,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9552,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9561,
"src": "14932:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9551,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "14932:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "14931:8:8"
},
"scope": 10039,
"src": "14882:112:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13292
],
"body": {
"id": 9663,
"nodeType": "Block",
"src": "15545:544:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9598,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9592,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15599:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9591,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15591:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9590,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15591:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9593,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15591:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9596,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "15618:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
],
"id": 9595,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15610:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9594,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15610:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9597,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15610:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "15591:34:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 9603,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "15629:23:8",
"subExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9599,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15630:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9601,
"indexExpression": {
"argumentTypes": null,
"id": 9600,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15639:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15630:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9602,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "15630:22:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "15591:61:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f52455345525645",
"id": 9605,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15654:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
},
"value": "ERR_INVALID_RESERVE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_2f153897d46b1410527faf37dfe95496d4a79980282840ba17da0adc4406792c",
"typeString": "literal_string \"ERR_INVALID_RESERVE\""
}
],
"id": 9589,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15583:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15583:93:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9607,
"nodeType": "ExpressionStatement",
"src": "15583:93:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9613,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9609,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15695:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 9612,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9610,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "15706:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 9611,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "15723:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15706:29:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15695:40:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f574549474854",
"id": 9614,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15737:28:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
},
"value": "ERR_INVALID_RESERVE_WEIGHT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e4e4c57eb13b428a7fc031dc1f6f2c3e13b61f7d7b93994b2d17f8dc75658178",
"typeString": "literal_string \"ERR_INVALID_RESERVE_WEIGHT\""
}
],
"id": 9608,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15687:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9615,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15687:79:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9616,
"nodeType": "ExpressionStatement",
"src": "15687:79:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 9625,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9618,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "15785:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 9619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15785:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9623,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "15814:2:8",
"subExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 9622,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15815:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_minus_1_by_1",
"typeString": "int_const -1"
}
],
"id": 9621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15807:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint16_$",
"typeString": "type(uint16)"
},
"typeName": {
"id": 9620,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "15807:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9624,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15807:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "15785:32:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f494e56414c49445f524553455256455f434f554e54",
"id": 9626,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15819:27:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
},
"value": "ERR_INVALID_RESERVE_COUNT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ed94f14d8dcbb423a259b4072978fc0c494c6af1fea066a19023afb1a76ac87f",
"typeString": "literal_string \"ERR_INVALID_RESERVE_COUNT\""
}
],
"id": 9617,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15777:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9627,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15777:70:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9628,
"nodeType": "ExpressionStatement",
"src": "15777:70:8"
},
{
"assignments": [
9630
],
"declarations": [
{
"constant": false,
"id": 9630,
"mutability": "mutable",
"name": "newReserve",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9663,
"src": "15860:26:8",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
},
"typeName": {
"contractScope": null,
"id": 9629,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "15860:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9634,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9631,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "15889:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9633,
"indexExpression": {
"argumentTypes": null,
"id": 9632,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15898:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "15889:16:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "15860:45:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9635,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15916:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9637,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "15916:18:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 9638,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15937:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "15916:22:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9640,
"nodeType": "ExpressionStatement",
"src": "15916:22:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9641,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15949:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9643,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "15949:17:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 9644,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15969:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "15949:27:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9646,
"nodeType": "ExpressionStatement",
"src": "15949:27:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9647,
"name": "newReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9630,
"src": "15987:10:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve storage pointer"
}
},
"id": 9649,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "15987:16:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 9650,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16006:4:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "15987:23:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 9652,
"nodeType": "ExpressionStatement",
"src": "15987:23:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9656,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "16040:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"expression": {
"argumentTypes": null,
"id": 9653,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "16021:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9655,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "16021:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16021:26:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9658,
"nodeType": "ExpressionStatement",
"src": "16021:26:8"
},
{
"expression": {
"argumentTypes": null,
"id": 9661,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 9659,
"name": "reserveRatio",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9043,
"src": "16058:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"id": 9660,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "16074:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "16058:23:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 9662,
"nodeType": "ExpressionStatement",
"src": "16058:23:8"
}
]
},
"documentation": {
"id": 9562,
"nodeType": "StructuredDocumentation",
"src": "15002:278:8",
"text": " @dev defines a new reserve token for the converter\n can only be called by the owner while the converter is inactive\n @param _token address of the reserve token\n @param _weight reserve weight, represented in ppm, 1-1000000"
},
"functionSelector": "6a49d2c4",
"id": 9664,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9570,
"modifierName": {
"argumentTypes": null,
"id": 9569,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "15402:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "15402:9:8"
},
{
"arguments": null,
"id": 9572,
"modifierName": {
"argumentTypes": null,
"id": 9571,
"name": "inactive",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9151,
"src": "15421:8:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "15421:8:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9576,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15460:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9575,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15452:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9574,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15452:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9577,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15452:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9578,
"modifierName": {
"argumentTypes": null,
"id": 9573,
"name": "validAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22618,
"src": "15439:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "15439:29:8"
},
{
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9582,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9564,
"src": "15494:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9581,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "15486:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9580,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "15486:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9583,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15486:15:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 9584,
"modifierName": {
"argumentTypes": null,
"id": 9579,
"name": "notThis",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22644,
"src": "15478:7:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_address_$",
"typeString": "modifier (address)"
}
},
"nodeType": "ModifierInvocation",
"src": "15478:24:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9586,
"name": "_weight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9566,
"src": "15531:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"id": 9587,
"modifierName": {
"argumentTypes": null,
"id": 9585,
"name": "validReserveWeight",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9219,
"src": "15512:18:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_uint32_$",
"typeString": "modifier (uint32)"
}
},
"nodeType": "ModifierInvocation",
"src": "15512:27:8"
}
],
"name": "addReserve",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9568,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "15384:8:8"
},
"parameters": {
"id": 9567,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9564,
"mutability": "mutable",
"name": "_token",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9664,
"src": "15306:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9563,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "15306:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9566,
"mutability": "mutable",
"name": "_weight",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9664,
"src": "15326:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9565,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "15326:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "15305:36:8"
},
"returnParameters": {
"id": 9588,
"nodeType": "ParameterList",
"parameters": [],
"src": "15545:0:8"
},
"scope": 10039,
"src": "15286:803:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 9680,
"nodeType": "Block",
"src": "16448:56:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9675,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16466:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9677,
"indexExpression": {
"argumentTypes": null,
"id": 9676,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9667,
"src": "16475:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16466:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9678,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "16466:30:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"functionReturnParameters": 9674,
"id": 9679,
"nodeType": "Return",
"src": "16459:37:8"
}
]
},
"documentation": {
"id": 9665,
"nodeType": "StructuredDocumentation",
"src": "16097:197:8",
"text": " @dev returns the reserve's weight\n added in version 28\n @param _reserveToken reserve token contract address\n @return reserve weight"
},
"functionSelector": "1cfab290",
"id": 9681,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9670,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9667,
"src": "16402:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9671,
"modifierName": {
"argumentTypes": null,
"id": 9669,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "16389:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "16389:27:8"
}
],
"name": "reserveWeight",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9668,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9667,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9681,
"src": "16323:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9666,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "16323:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16322:27:8"
},
"returnParameters": {
"id": 9674,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9673,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9681,
"src": "16435:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9672,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "16435:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16434:8:8"
},
"scope": 10039,
"src": "16300:204:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13250
],
"body": {
"id": 9698,
"nodeType": "Block",
"src": "16941:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9693,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "16959:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9695,
"indexExpression": {
"argumentTypes": null,
"id": 9694,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9684,
"src": "16968:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16959:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9696,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "16959:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9692,
"id": 9697,
"nodeType": "Return",
"src": "16952:38:8"
}
]
},
"documentation": {
"id": 9682,
"nodeType": "StructuredDocumentation",
"src": "16512:255:8",
"text": " @dev returns the reserve's balance\n note that prior to version 17, you should use 'getConnectorBalance' instead\n @param _reserveToken reserve token contract address\n @return reserve balance"
},
"functionSelector": "dc8de379",
"id": 9699,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9688,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9684,
"src": "16894:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9689,
"modifierName": {
"argumentTypes": null,
"id": 9687,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "16881:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "16881:27:8"
}
],
"name": "reserveBalance",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9686,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "16849:8:8"
},
"parameters": {
"id": 9685,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9684,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9699,
"src": "16797:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9683,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "16797:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16796:27:8"
},
"returnParameters": {
"id": 9692,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9691,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9699,
"src": "16927:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9690,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16927:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "16926:9:8"
},
"scope": 10039,
"src": "16773:225:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 9710,
"nodeType": "Block",
"src": "17228:61:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9705,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "17246:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9707,
"indexExpression": {
"argumentTypes": null,
"id": 9706,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "17255:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "17246:29:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9708,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "17246:35:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 9704,
"id": 9709,
"nodeType": "Return",
"src": "17239:42:8"
}
]
},
"documentation": {
"id": 9700,
"nodeType": "StructuredDocumentation",
"src": "17006:164:8",
"text": " @dev checks whether or not the converter has an ETH reserve\n @return true if the converter has an ETH reserve, false otherwise"
},
"functionSelector": "12c2aca4",
"id": 9711,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "hasETHReserve",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9701,
"nodeType": "ParameterList",
"parameters": [],
"src": "17198:2:8"
},
"returnParameters": {
"id": 9704,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9703,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9711,
"src": "17222:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9702,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "17222:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17221:6:8"
},
"scope": 10039,
"src": "17176:113:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13228
],
"body": {
"id": 9772,
"nodeType": "Block",
"src": "18137:517:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 9736,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9734,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9714,
"src": "18183:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 9735,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9716,
"src": "18199:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "18183:28:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f53414d455f534f555243455f544152474554",
"id": 9737,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18213:24:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
},
"value": "ERR_SAME_SOURCE_TARGET"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_238302f57e4481fe6a4c903e930919efa155f2aabe0b5da37da1448cea5fd634",
"typeString": "literal_string \"ERR_SAME_SOURCE_TARGET\""
}
],
"id": 9733,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "18175:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9738,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18175:63:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9739,
"nodeType": "ExpressionStatement",
"src": "18175:63:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 9749,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9743,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18366:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
],
"id": 9742,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18358:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9741,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18358:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18358:28:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 9747,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18398:1:8",
"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": 9746,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "18390:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9745,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "18390:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9748,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18390:10:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "18358:42:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 9758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9752,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9720,
"src": "18456:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 9750,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18422:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9751,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isWhitelisted",
"nodeType": "MemberAccess",
"referencedDeclaration": 22916,
"src": "18422:33:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view external returns (bool)"
}
},
"id": 9753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18422:42:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9756,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9722,
"src": "18502:12:8",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 9754,
"name": "conversionWhitelist",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9033,
"src": "18468:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IWhitelist_$22917",
"typeString": "contract IWhitelist"
}
},
"id": 9755,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isWhitelisted",
"nodeType": "MemberAccess",
"referencedDeclaration": 22916,
"src": "18468:33:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view external returns (bool)"
}
},
"id": 9757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18468:47:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "18422:93:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 9759,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "18421:95:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "18358:158:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552525f4e4f545f57484954454c4953544544",
"id": 9761,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "18535:21:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d03711a645ac13b3887baa10c28f347997e96617340d7ffae036e653d4c59185",
"typeString": "literal_string \"ERR_NOT_WHITELISTED\""
},
"value": "ERR_NOT_WHITELISTED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_d03711a645ac13b3887baa10c28f347997e96617340d7ffae036e653d4c59185",
"typeString": "literal_string \"ERR_NOT_WHITELISTED\""
}
],
"id": 9740,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "18350:7:8",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 9762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18350:207:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9763,
"nodeType": "ExpressionStatement",
"src": "18350:207:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9765,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9714,
"src": "18587:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9766,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9716,
"src": "18601:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9767,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9718,
"src": "18615:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 9768,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9720,
"src": "18624:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9769,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9722,
"src": "18633:12:8",
"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",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 9764,
"name": "doConvert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9789,
"src": "18577:9:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_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) returns (uint256)"
}
},
"id": 9770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "18577:69:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9732,
"id": 9771,
"nodeType": "Return",
"src": "18570:76:8"
}
]
},
"documentation": {
"id": 9712,
"nodeType": "StructuredDocumentation",
"src": "17297:569:8",
"text": " @dev converts a specific amount of source tokens to target tokens\n can only be called by the bancor network contract\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"functionSelector": "e8dc12ff",
"id": 9773,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9726,
"modifierName": {
"argumentTypes": null,
"id": 9725,
"name": "protected",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22231,
"src": "18065:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "18065:9:8"
},
{
"arguments": [
{
"argumentTypes": null,
"id": 9728,
"name": "BANCOR_NETWORK",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21530,
"src": "18089:14:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 9729,
"modifierName": {
"argumentTypes": null,
"id": 9727,
"name": "only",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21577,
"src": "18084:4:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_bytes32_$",
"typeString": "modifier (bytes32)"
}
},
"nodeType": "ModifierInvocation",
"src": "18084:20:8"
}
],
"name": "convert",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9724,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "18030:8:8"
},
"parameters": {
"id": 9723,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9714,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17889:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9713,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "17889:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9716,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17915:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9715,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "17915:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9718,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17941:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9717,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "17941:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9720,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17958:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9719,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17958:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9722,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "17975:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9721,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "17975:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "17888:116:8"
},
"returnParameters": {
"id": 9732,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9731,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9773,
"src": "18123:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9730,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "18123:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "18122:9:8"
},
"scope": 10039,
"src": "17872:782:8",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"body": null,
"documentation": {
"id": 9774,
"nodeType": "StructuredDocumentation",
"src": "18662:615:8",
"text": " @dev converts a specific amount of source tokens to target tokens\n called by ConverterBase and allows the inherited contracts to implement custom conversion logic\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _amount amount of tokens to convert (in units of the source token)\n @param _trader address of the caller who executed the conversion\n @param _beneficiary wallet to receive the conversion result\n @return amount of tokens received (in units of the target token)"
},
"id": 9789,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "doConvert",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9785,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9776,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19312:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9775,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "19312:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9778,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19347:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9777,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "19347:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9780,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19382:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9779,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19382:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9782,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19408:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9781,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19408:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9784,
"mutability": "mutable",
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19434:28:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 9783,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "19434:15:8",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19301:162:8"
},
"returnParameters": {
"id": 9788,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9787,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9789,
"src": "19517:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9786,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19517:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19516:9:8"
},
"scope": 10039,
"src": "19283:243:8",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 9805,
"nodeType": "Block",
"src": "19790:78:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9802,
"name": "PPM_RESOLUTION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9007,
"src": "19845:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9799,
"name": "conversionFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9051,
"src": "19826:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"expression": {
"argumentTypes": null,
"id": 9797,
"name": "_targetAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9792,
"src": "19808:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 22327,
"src": "19808:17:8",
"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": 9800,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19808:32:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9801,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 22353,
"src": "19808:36:8",
"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": 9803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "19808:52:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 9796,
"id": 9804,
"nodeType": "Return",
"src": "19801:59:8"
}
]
},
"documentation": {
"id": 9790,
"nodeType": "StructuredDocumentation",
"src": "19534:173:8",
"text": " @dev returns the conversion fee for a given target amount\n @param _targetAmount target amount\n @return conversion fee"
},
"id": 9806,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "calculateFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9793,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9792,
"mutability": "mutable",
"name": "_targetAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9806,
"src": "19735:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9791,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19735:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19734:23:8"
},
"returnParameters": {
"id": 9796,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9795,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9806,
"src": "19781:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9794,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "19781:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "19780:9:8"
},
"scope": 10039,
"src": "19713:155:8",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9843,
"nodeType": "Block",
"src": "20153:230:8",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"id": 9817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9815,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20168:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 9816,
"name": "ETH_RESERVE_ADDRESS",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9012,
"src": "20185:19:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"src": "20168:36:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"argumentTypes": null,
"id": 9840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9829,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "20303:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9831,
"indexExpression": {
"argumentTypes": null,
"id": 9830,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20312:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20303:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9832,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "20303:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9837,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "20369:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9836,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20361:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9835,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20361:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20361:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"expression": {
"argumentTypes": null,
"id": 9833,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20337:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"id": 9834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 21088,
"src": "20337:23:8",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 9839,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20337:38:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20303:72:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9841,
"nodeType": "ExpressionStatement",
"src": "20303:72:8"
},
"id": 9842,
"nodeType": "IfStatement",
"src": "20164:211:8",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 9827,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9818,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "20219:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9820,
"indexExpression": {
"argumentTypes": null,
"id": 9819,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20228:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20219:23:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"id": 9821,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "20219:31:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9824,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -28,
"src": "20261:4:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_ConverterBase_$10039",
"typeString": "contract ConverterBase"
}
],
"id": 9823,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "20253:7:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 9822,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "20253:7:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9825,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20253:13:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 9826,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20253:21:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20219:55:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9828,
"nodeType": "ExpressionStatement",
"src": "20219:55:8"
}
}
]
},
"documentation": {
"id": 9807,
"nodeType": "StructuredDocumentation",
"src": "19876:179:8",
"text": " @dev syncs the stored reserve balance for a given reserve with the real reserve balance\n @param _reserveToken address of the reserve token"
},
"id": 9844,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 9812,
"name": "_reserveToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9809,
"src": "20138:13:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"id": 9813,
"modifierName": {
"argumentTypes": null,
"id": 9811,
"name": "validReserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9172,
"src": "20125:12:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$_t_contract$_IERC20Token_$21127_$",
"typeString": "modifier (contract IERC20Token)"
}
},
"nodeType": "ModifierInvocation",
"src": "20125:27:8"
}
],
"name": "syncReserveBalance",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9809,
"mutability": "mutable",
"name": "_reserveToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9844,
"src": "20089:25:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9808,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "20089:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "20088:27:8"
},
"returnParameters": {
"id": 9814,
"nodeType": "ParameterList",
"parameters": [],
"src": "20153:0:8"
},
"scope": 10039,
"src": "20061:322:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9870,
"nodeType": "Block",
"src": "20496:165:8",
"statements": [
{
"assignments": [
9849
],
"declarations": [
{
"constant": false,
"id": 9849,
"mutability": "mutable",
"name": "reserveCount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9870,
"src": "20507:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9848,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20507:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9852,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9850,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "20530:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9851,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "20530:20:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "20507:43:8"
},
{
"body": {
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9864,
"name": "reserveTokens",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9036,
"src": "20636:13:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9866,
"indexExpression": {
"argumentTypes": null,
"id": 9865,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20650:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "20636:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 9863,
"name": "syncReserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9844,
"src": "20617:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20Token_$21127_$returns$__$",
"typeString": "function (contract IERC20Token)"
}
},
"id": 9867,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "20617:36:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9868,
"nodeType": "ExpressionStatement",
"src": "20617:36:8"
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 9859,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9857,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20581:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 9858,
"name": "reserveCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9849,
"src": "20585:12:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "20581:16:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 9869,
"initializationExpression": {
"assignments": [
9854
],
"declarations": [
{
"constant": false,
"id": 9854,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9869,
"src": "20566:9:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9853,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "20566:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9856,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 9855,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "20578:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "20566:13:8"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 9861,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "20599:3:8",
"subExpression": {
"argumentTypes": null,
"id": 9860,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9854,
"src": "20599:1:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 9862,
"nodeType": "ExpressionStatement",
"src": "20599:3:8"
},
"nodeType": "ForStatement",
"src": "20561:92:8"
}
]
},
"documentation": {
"id": 9845,
"nodeType": "StructuredDocumentation",
"src": "20391:59:8",
"text": " @dev syncs all stored reserve balances"
},
"id": 9871,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "syncReserveBalances",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9846,
"nodeType": "ParameterList",
"parameters": [],
"src": "20484:2:8"
},
"returnParameters": {
"id": 9847,
"nodeType": "ParameterList",
"parameters": [],
"src": "20496:0:8"
},
"scope": 10039,
"src": "20456:205:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 9907,
"nodeType": "Block",
"src": "21324:518:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 9892,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 9888,
"name": "_feeAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9884,
"src": "21705:10:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
},
"id": 9891,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 9889,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21718:1:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "323535",
"id": 9890,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "21723:3:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_255_by_1",
"typeString": "int_const 255"
},
"value": "255"
},
"src": "21718:8:8",
"typeDescriptions": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
}
},
"src": "21705:21:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 9887,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "21698:6:8",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 9893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21698:29:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9894,
"nodeType": "ExpressionStatement",
"src": "21698:29:8"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9896,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9874,
"src": "21754:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9897,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9876,
"src": "21768:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 9898,
"name": "_trader",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9878,
"src": "21782:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 9899,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9880,
"src": "21791:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 9900,
"name": "_returnAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9882,
"src": "21800:13:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9903,
"name": "_feeAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9884,
"src": "21822:10:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 9902,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "21815:6:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 9901,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "21815:6:8",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 9904,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21815:18:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 9895,
"name": "Conversion",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9078,
"src": "21743:10:8",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_address_$_t_uint256_$_t_uint256_$_t_int256_$returns$__$",
"typeString": "function (contract IERC20Token,contract IERC20Token,address,uint256,uint256,int256)"
}
},
"id": 9905,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "21743:91:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9906,
"nodeType": "EmitStatement",
"src": "21738:96:8"
}
]
},
"documentation": {
"id": 9872,
"nodeType": "StructuredDocumentation",
"src": "20669:409:8",
"text": " @dev helper, dispatches the Conversion event\n @param _sourceToken source ERC20 token\n @param _targetToken target ERC20 token\n @param _trader address of the caller who executed the conversion\n @param _amount amount purchased/sold (in the source token)\n @param _returnAmount amount returned (in the target token)"
},
"id": 9908,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "dispatchConversionEvent",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 9885,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9874,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21127:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9873,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "21127:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9876,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21162:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9875,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "21162:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9878,
"mutability": "mutable",
"name": "_trader",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21197:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9877,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "21197:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9880,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21223:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9879,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21223:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9882,
"mutability": "mutable",
"name": "_returnAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21249:21:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9881,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21249:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9884,
"mutability": "mutable",
"name": "_feeAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9908,
"src": "21281:18:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9883,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "21281:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "21116:184:8"
},
"returnParameters": {
"id": 9886,
"nodeType": "ParameterList",
"parameters": [],
"src": "21324:0:8"
},
"scope": 10039,
"src": "21084:758:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"baseFunctions": [
13297
],
"body": {
"id": 9917,
"nodeType": "Block",
"src": "22030:32:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 9915,
"name": "anchor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9030,
"src": "22048:6:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"functionReturnParameters": 9914,
"id": 9916,
"nodeType": "Return",
"src": "22041:13:8"
}
]
},
"documentation": {
"id": 9909,
"nodeType": "StructuredDocumentation",
"src": "21850:109:8",
"text": " @dev deprecated since version 28, backward compatibility - use only for earlier versions"
},
"functionSelector": "fc0c546a",
"id": 9918,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "token",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9911,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "21994:8:8"
},
"parameters": {
"id": 9910,
"nodeType": "ParameterList",
"parameters": [],
"src": "21979:2:8"
},
"returnParameters": {
"id": 9914,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9913,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9918,
"src": "22012:16:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
},
"typeName": {
"contractScope": null,
"id": 9912,
"name": "IConverterAnchor",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13349,
"src": "22012:16:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IConverterAnchor_$13349",
"typeString": "contract IConverterAnchor"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22011:18:8"
},
"scope": 10039,
"src": "21965:97:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13302
],
"body": {
"id": 9931,
"nodeType": "Block",
"src": "22213:53:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 9928,
"name": "_newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9921,
"src": "22248:9:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 9927,
"name": "transferAnchorOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9381,
"src": "22224:23:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 9929,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22224:34:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9930,
"nodeType": "ExpressionStatement",
"src": "22224:34:8"
}
]
},
"documentation": {
"id": 9919,
"nodeType": "StructuredDocumentation",
"src": "22070:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "21e6b53d",
"id": 9932,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9925,
"modifierName": {
"argumentTypes": null,
"id": 9924,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "22203:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "22203:9:8"
}
],
"name": "transferTokenOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9923,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22194:8:8"
},
"parameters": {
"id": 9922,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9921,
"mutability": "mutable",
"name": "_newOwner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9932,
"src": "22168:17:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 9920,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "22168:7:8",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22167:19:8"
},
"returnParameters": {
"id": 9926,
"nodeType": "ParameterList",
"parameters": [],
"src": "22213:0:8"
},
"scope": 10039,
"src": "22136:130:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13305
],
"body": {
"id": 9942,
"nodeType": "Block",
"src": "22398:42:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9939,
"name": "acceptAnchorOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9405,
"src": "22409:21:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 9940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "22409:23:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 9941,
"nodeType": "ExpressionStatement",
"src": "22409:23:8"
}
]
},
"documentation": {
"id": 9933,
"nodeType": "StructuredDocumentation",
"src": "22274:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "38a5e016",
"id": 9943,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 9937,
"modifierName": {
"argumentTypes": null,
"id": 9936,
"name": "ownerOnly",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21754,
"src": "22388:9:8",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "22388:9:8"
}
],
"name": "acceptTokenOwnership",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9935,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22379:8:8"
},
"parameters": {
"id": 9934,
"nodeType": "ParameterList",
"parameters": [],
"src": "22369:2:8"
},
"returnParameters": {
"id": 9938,
"nodeType": "ParameterList",
"parameters": [],
"src": "22398:0:8"
},
"scope": 10039,
"src": "22340:100:8",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13320
],
"body": {
"id": 9976,
"nodeType": "Block",
"src": "22621:141:8",
"statements": [
{
"assignments": [
9961
],
"declarations": [
{
"constant": false,
"id": 9961,
"mutability": "mutable",
"name": "reserve",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9976,
"src": "22632:22:8",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve"
},
"typeName": {
"contractScope": null,
"id": 9960,
"name": "Reserve",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9023,
"src": "22632:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage_ptr",
"typeString": "struct ConverterBase.Reserve"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 9965,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 9962,
"name": "reserves",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9040,
"src": "22657:8:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_contract$_IERC20Token_$21127_$_t_struct$_Reserve_$9023_storage_$",
"typeString": "mapping(contract IERC20Token => struct ConverterBase.Reserve storage ref)"
}
},
"id": 9964,
"indexExpression": {
"argumentTypes": null,
"id": 9963,
"name": "_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9946,
"src": "22666:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22657:18:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_storage",
"typeString": "struct ConverterBase.Reserve storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "22632:43:8"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9966,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22693:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9967,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": 9014,
"src": "22693:15:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9968,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22710:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9969,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "weight",
"nodeType": "MemberAccess",
"referencedDeclaration": 9016,
"src": "22710:14:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9970,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22726:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 9971,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "22733:5:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9972,
"name": "reserve",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9961,
"src": "22740:7:8",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Reserve_$9023_memory_ptr",
"typeString": "struct ConverterBase.Reserve memory"
}
},
"id": 9973,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "isSet",
"nodeType": "MemberAccess",
"referencedDeclaration": 9022,
"src": "22740:13:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 9974,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "22692:62:8",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint32_$_t_bool_$_t_bool_$_t_bool_$",
"typeString": "tuple(uint256,uint32,bool,bool,bool)"
}
},
"functionReturnParameters": 9959,
"id": 9975,
"nodeType": "Return",
"src": "22686:68:8"
}
]
},
"documentation": {
"id": 9944,
"nodeType": "StructuredDocumentation",
"src": "22448:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "0e53aae9",
"id": 9977,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectors",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9948,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22568:8:8"
},
"parameters": {
"id": 9947,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9946,
"mutability": "mutable",
"name": "_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22534:20:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9945,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22534:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22533:22:8"
},
"returnParameters": {
"id": 9959,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9950,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22586:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9949,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22586:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9952,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22595:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 9951,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "22595:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9954,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22603:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9953,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22603:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9956,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22609:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9955,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22609:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9958,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9977,
"src": "22615:4:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9957,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "22615:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22585:35:8"
},
"scope": 10039,
"src": "22514:248:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13334
],
"body": {
"id": 9991,
"nodeType": "Block",
"src": "22920:61:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9986,
"name": "ConverterBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10039,
"src": "22938:13:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ConverterBase_$10039_$",
"typeString": "type(contract ConverterBase)"
}
},
"id": 9987,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "reserveTokens",
"nodeType": "MemberAccess",
"referencedDeclaration": 9036,
"src": "22938:27:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_IERC20Token_$21127_$dyn_storage",
"typeString": "contract IERC20Token[] storage ref"
}
},
"id": 9989,
"indexExpression": {
"argumentTypes": null,
"id": 9988,
"name": "_index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9980,
"src": "22966:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "22938:35:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"functionReturnParameters": 9985,
"id": 9990,
"nodeType": "Return",
"src": "22931:42:8"
}
]
},
"documentation": {
"id": 9978,
"nodeType": "StructuredDocumentation",
"src": "22770:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "19b64015",
"id": 9992,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectorTokens",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9982,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "22889:8:8"
},
"parameters": {
"id": 9981,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9980,
"mutability": "mutable",
"name": "_index",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9992,
"src": "22861:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9979,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "22861:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22860:16:8"
},
"returnParameters": {
"id": 9985,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9984,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 9992,
"src": "22907:11:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 9983,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "22907:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "22906:13:8"
},
"scope": 10039,
"src": "22836:145:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13339
],
"body": {
"id": 10002,
"nodeType": "Block",
"src": "23124:45:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 9999,
"name": "reserveTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9561,
"src": "23142:17:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint16_$",
"typeString": "function () view returns (uint16)"
}
},
"id": 10000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23142:19:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 9998,
"id": 10001,
"nodeType": "Return",
"src": "23135:26:8"
}
]
},
"documentation": {
"id": 9993,
"nodeType": "StructuredDocumentation",
"src": "22989:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "71f52bf3",
"id": 10003,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "connectorTokenCount",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 9995,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "23098:8:8"
},
"parameters": {
"id": 9994,
"nodeType": "ParameterList",
"parameters": [],
"src": "23083:2:8"
},
"returnParameters": {
"id": 9998,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 9997,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10003,
"src": "23116:6:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 9996,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "23116:6:8",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23115:8:8"
},
"scope": 10039,
"src": "23055:114:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
13327
],
"body": {
"id": 10016,
"nodeType": "Block",
"src": "23340:57:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10013,
"name": "_connectorToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10006,
"src": "23373:15:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
],
"id": 10012,
"name": "reserveBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9699,
"src": "23358:14:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$returns$_t_uint256_$",
"typeString": "function (contract IERC20Token) view returns (uint256)"
}
},
"id": 10014,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23358:31:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 10011,
"id": 10015,
"nodeType": "Return",
"src": "23351:38:8"
}
]
},
"documentation": {
"id": 10004,
"nodeType": "StructuredDocumentation",
"src": "23177:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "d8959512",
"id": 10017,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getConnectorBalance",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 10008,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "23313:8:8"
},
"parameters": {
"id": 10007,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10006,
"mutability": "mutable",
"name": "_connectorToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10017,
"src": "23272:27:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10005,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23272:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23271:29:8"
},
"returnParameters": {
"id": 10011,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10010,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10017,
"src": "23331:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10009,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23331:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23330:9:8"
},
"scope": 10039,
"src": "23243:154:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 10037,
"nodeType": "Block",
"src": "23598:81:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10032,
"name": "_sourceToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10020,
"src": "23635:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 10033,
"name": "_targetToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10022,
"src": "23649:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
{
"argumentTypes": null,
"id": 10034,
"name": "_amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10024,
"src": "23663:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10031,
"name": "targetAmountAndFee",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9256,
"src": "23616:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_contract$_IERC20Token_$21127_$_t_contract$_IERC20Token_$21127_$_t_uint256_$returns$_t_uint256_$_t_uint256_$",
"typeString": "function (contract IERC20Token,contract IERC20Token,uint256) view returns (uint256,uint256)"
}
},
"id": 10035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "23616:55:8",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 10030,
"id": 10036,
"nodeType": "Return",
"src": "23609:62:8"
}
]
},
"documentation": {
"id": 10018,
"nodeType": "StructuredDocumentation",
"src": "23405:60:8",
"text": " @dev deprecated, backward compatibility"
},
"functionSelector": "1e1401f8",
"id": 10038,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getReturn",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10025,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10020,
"mutability": "mutable",
"name": "_sourceToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23490:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10019,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23490:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10022,
"mutability": "mutable",
"name": "_targetToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23516:24:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
},
"typeName": {
"contractScope": null,
"id": 10021,
"name": "IERC20Token",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21127,
"src": "23516:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Token_$21127",
"typeString": "contract IERC20Token"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10024,
"mutability": "mutable",
"name": "_amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23542:15:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10023,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23542:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23489:69:8"
},
"returnParameters": {
"id": 10030,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10027,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23580:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10026,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23580:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10029,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10038,
"src": "23589:7:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10028,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "23589:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "23579:18:8"
},
"scope": 10039,
"src": "23471:208:8",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
}
],
"scope": 10040,
"src": "1648:22034:8"
}
],
"src": "52:23632:8"
},
"compiler": {
"name": "solc",
"version": "0.6.12+commit.27d51765.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-10-20T08:24:47.712Z",
"devdoc": {
"details": "ConverterBase The converter contains the main logic for conversions between different ERC20 tokens. It is also the upgradable part of the mechanism (note that upgrades are opt-in). The anchor must be set on construction and cannot be changed afterwards. Wrappers are provided for some of the anchor's functions, for easier access. Once the converter accepts ownership of the anchor, it becomes the anchor's sole controller and can execute any of its functions. To upgrade the converter, anchor ownership must be transferred to a new converter, along with any relevant data. Note that the converter can transfer anchor ownership to a new converter that doesn't allow upgrades anymore, for finalizing the relationship between the converter and the anchor. Converter types (defined as uint16 type) - 0 = liquid token converter 1 = liquidity pool v1 converter 2 = liquidity pool v2 converter Note that converters don't currently support tokens with transfer fees.",
"events": {
"Activation(uint16,address,bool)": {
"details": "triggered when the converter is activated",
"params": {
"_activated": "true if the converter was activated, false if it was deactivated",
"_anchor": "converter anchor",
"_type": "converter type"
}
},
"Conversion(address,address,address,uint256,uint256,int256)": {
"details": "triggered when a conversion between two tokens occurs",
"params": {
"_amount": "amount converted, in the source token",
"_conversionFee": "conversion fee",
"_fromToken": "source ERC20 token",
"_return": "amount returned, minus conversion fee",
"_toToken": "target ERC20 token",
"_trader": "wallet that initiated the trade"
}
},
"ConversionFeeUpdate(uint32,uint32)": {
"details": "triggered when the conversion fee is updated",
"params": {
"_newFee": "new fee percentage, represented in ppm",
"_prevFee": "previous fee percentage, represented in ppm"
}
},
"TokenRateUpdate(address,address,uint256,uint256)": {
"details": "triggered when the rate between two tokens in the converter changes note that the event might be dispatched for rate updates between any two tokens in the converter note that prior to version 28, you should use the 'PriceDataUpdate' event instead",
"params": {
"_rateD": "rate of 1 unit of `_token1` in `_token2` (denominator)",
"_rateN": "rate of 1 unit of `_token1` in `_token2` (numerator)",
"_token1": "address of the first token",
"_token2": "address of the second token"
}
}
},
"kind": "dev",
"methods": {
"acceptAnchorOwnership()": {
"details": "accepts ownership of the anchor after an ownership transfer most converters are also activated as soon as they accept the anchor ownership can only be called by the contract owner note that prior to version 28, you should use 'acceptTokenOwnership' instead"
},
"acceptOwnership()": {
"details": "used by a new owner to accept an ownership transfer"
},
"acceptTokenOwnership()": {
"details": "deprecated, backward compatibility"
},
"addReserve(address,uint32)": {
"details": "defines a new reserve token for the converter can only be called by the owner while the converter is inactive",
"params": {
"_token": "address of the reserve token",
"_weight": "reserve weight, represented in ppm, 1-1000000"
}
},
"connectorTokenCount()": {
"details": "deprecated, backward compatibility"
},
"connectorTokens(uint256)": {
"details": "deprecated, backward compatibility"
},
"connectors(address)": {
"details": "deprecated, backward compatibility"
},
"constructor": {
"details": "used by sub-contracts to initialize a new converter",
"params": {
"_anchor": "anchor governed by the converter",
"_maxConversionFee": "maximum conversion fee, represented in ppm",
"_registry": "address of a contract registry contract"
}
},
"convert(address,address,uint256,address,address)": {
"details": "converts a specific amount of source tokens to target tokens can only be called by the bancor network contract",
"params": {
"_amount": "amount of tokens to convert (in units of the source token)",
"_beneficiary": "wallet to receive the conversion result",
"_sourceToken": "source ERC20 token",
"_targetToken": "target ERC20 token",
"_trader": "address of the caller who executed the conversion"
},
"returns": {
"_0": "amount of tokens received (in units of the target token)"
}
},
"getConnectorBalance(address)": {
"details": "deprecated, backward compatibility"
},
"getReturn(address,address,uint256)": {
"details": "deprecated, backward compatibility"
},
"hasETHReserve()": {
"details": "checks whether or not the converter has an ETH reserve",
"returns": {
"_0": "true if the converter has an ETH reserve, false otherwise"
}
},
"isActive()": {
"details": "returns true if the converter is active, false otherwise",
"returns": {
"_0": "true if the converter is active, false otherwise"
}
},
"isV28OrHigher()": {
"details": "checks whether or not the converter version is 28 or higher",
"returns": {
"_0": "true, since the converter version is 28 or higher"
}
},
"reserveBalance(address)": {
"details": "returns the reserve's balance note that prior to version 17, you should use 'getConnectorBalance' instead",
"params": {
"_reserveToken": "reserve token contract address"
},
"returns": {
"_0": "reserve balance"
}
},
"reserveTokenCount()": {
"details": "returns the number of reserve tokens defined note that prior to version 17, you should use 'connectorTokenCount' instead",
"returns": {
"_0": "number of reserve tokens"
}
},
"reserveWeight(address)": {
"details": "returns the reserve's weight added in version 28",
"params": {
"_reserveToken": "reserve token contract address"
},
"returns": {
"_0": "reserve weight"
}
},
"restoreRegistry()": {
"details": "restores the previous contract-registry"
},
"restrictRegistryUpdate(bool)": {
"details": "restricts the permission to update the contract-registry",
"params": {
"_onlyOwnerCanUpdateRegistry": "indicates whether or not permission is restricted to owner only"
}
},
"setConversionFee(uint32)": {
"details": "updates the current conversion fee can only be called by the contract owner",
"params": {
"_conversionFee": "new conversion fee, represented in ppm"
}
},
"setConversionWhitelist(address)": {
"details": "allows the owner to update & enable the conversion whitelist contract address when set, only addresses that are whitelisted are actually allowed to use the converter note that the whitelist check is actually done by the BancorNetwork contract",
"params": {
"_whitelist": "address of a whitelist contract"
}
},
"token()": {
"details": "deprecated since version 28, backward compatibility - use only for earlier versions"
},
"transferAnchorOwnership(address)": {
"details": "transfers the anchor ownership the new owner needs to accept the transfer can only be called by the converter upgrder while the upgrader is the owner note that prior to version 28, you should use 'transferAnchorOwnership' instead",
"params": {
"_newOwner": "new token owner"
}
},
"transferOwnership(address)": {
"details": "allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner",
"params": {
"_newOwner": "new contract owner"
}
},
"transferTokenOwnership(address)": {
"details": "deprecated, backward compatibility"
},
"updateRegistry()": {
"details": "updates to the new contract-registry"
},
"upgrade()": {
"details": "upgrades the converter to the latest version can only be called by the owner note that the owner needs to call acceptOwnership on the new converter after the upgrade"
},
"withdrawETH(address)": {
"details": "withdraws ether can only be called by the owner if the converter is inactive or by upgrader contract can only be called after the upgrader contract has accepted the ownership of this contract can only be called if the converter has an ETH reserve",
"params": {
"_to": "address to send the ETH to"
}
},
"withdrawFromAnchor(address,address,uint256)": {
"details": "withdraws tokens held by the anchor and sends them to an account can only be called by the owner",
"params": {
"_amount": "amount to withdraw",
"_to": "account to receive the new amount",
"_token": "ERC20 token contract address"
}
},
"withdrawTokens(address,address,uint256)": {
"details": "withdraws tokens held by the converter and sends them to an account can only be called by the owner note that reserve tokens can only be withdrawn by the owner while the converter is inactive unless the owner is the converter upgrader contract",
"params": {
"_amount": "amount to withdraw",
"_to": "account to receive the new amount",
"_token": "ERC20 token contract address"
}
}
},
"stateVariables": {
"version": {
"details": "version number"
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}