{
    "contractName": "BalanceCarrier",
    "abi": [],
    "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/BalanceCarrier.sol\":\"BalanceCarrier\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/BalanceCarrier.sol\":{\"keccak256\":\"0x69e63e482d839c831c8c32f002e6454f6a8d9e602b39e9cdc1c0649451df3337\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://0a40661372b8f95cbed7714a16323b435ccbe85205178d32bc6012e47bfc0640\",\"dweb:/ipfs/QmTyHr1Ag4AkcyazzTT5GDcWabAMHPTrELoGhL85ZWDgBy\"]},\"/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/ExternalCaller.sol\":{\"keccak256\":\"0x54f88a1f0ac5dd7ab99a0519124cb09f1e19b4efb9baf240bc2500f8caa0b4ff\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://3170671378d20b47498224d065e33fccc223ae772d7f0af2c5ef314f94b75c98\",\"dweb:/ipfs/Qme8ZEEBnBG5Vvj8uyJCD2YVPcLx6funKsSSCpGkTyn1zi\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xbd74f587ab9b9711801baf667db1426e4a03fd2d7f15af33e0e0d0394e7cef76\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2d0913dfbfce90d170df0d496ad7596c0778518e5fa7aba6c32562522546f66b\",\"dweb:/ipfs/QmR6B8nLj2PJf5e1JWD9Nk7ErkAwkqUwadCnvE82FJr1RU\"]}},\"version\":1}",
    "bytecode": "0x",
    "deployedBytecode": "0x",
    "immutableReferences": {},
    "generatedSources": [],
    "deployedGeneratedSources": [],
    "sourceMap": "",
    "deployedSourceMap": "",
    "source": "/*\n\n    Copyright 2020 Kollateral LLC.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n*/\n\n// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.7.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"./ExternalCaller.sol\";\n\nabstract contract BalanceCarrier is ExternalCaller {\n    address private _ethTokenAddress;\n\n    constructor(address ethTokenAddress) {\n        _ethTokenAddress = ethTokenAddress;\n    }\n\n    function transfer(\n        address tokenAddress,\n        address to,\n        uint256 amount\n    ) internal returns (bool) {\n        if (tokenAddress == _ethTokenAddress) {\n            externalTransfer(to, amount);\n            return true;\n        } else {\n            return IERC20(tokenAddress).transfer(to, amount);\n        }\n    }\n\n    function balanceOf(address tokenAddress) internal view returns (uint256) {\n        if (tokenAddress == _ethTokenAddress) {\n            return address(this).balance;\n        } else {\n            return IERC20(tokenAddress).balanceOf(address(this));\n        }\n    }\n}\n",
    "sourcePath": "/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/BalanceCarrier.sol",
    "ast": {
        "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/BalanceCarrier.sol",
        "exportedSymbols": {
            "BalanceCarrier": [
                1464
            ],
            "ExternalCaller": [
                1563
            ],
            "IERC20": [
                6165
            ]
        },
        "id": 1465,
        "license": "Apache-2.0",
        "nodeType": "SourceUnit",
        "nodes": [
            {
                "id": 1384,
                "literals": [
                    "solidity",
                    "^",
                    "0.7",
                    ".0"
                ],
                "nodeType": "PragmaDirective",
                "src": "640:23:7"
            },
            {
                "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
                "file": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
                "id": 1385,
                "nodeType": "ImportDirective",
                "scope": 1465,
                "sourceUnit": 6166,
                "src": "665:56:7",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/ExternalCaller.sol",
                "file": "./ExternalCaller.sol",
                "id": 1386,
                "nodeType": "ImportDirective",
                "scope": 1465,
                "sourceUnit": 1564,
                "src": "722:30:7",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "abstract": true,
                "baseContracts": [
                    {
                        "baseName": {
                            "id": 1387,
                            "name": "ExternalCaller",
                            "nodeType": "UserDefinedTypeName",
                            "referencedDeclaration": 1563,
                            "src": "790:14:7",
                            "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ExternalCaller_$1563",
                                "typeString": "contract ExternalCaller"
                            }
                        },
                        "id": 1388,
                        "nodeType": "InheritanceSpecifier",
                        "src": "790:14:7"
                    }
                ],
                "contractDependencies": [
                    1563
                ],
                "contractKind": "contract",
                "fullyImplemented": true,
                "id": 1464,
                "linearizedBaseContracts": [
                    1464,
                    1563
                ],
                "name": "BalanceCarrier",
                "nodeType": "ContractDefinition",
                "nodes": [
                    {
                        "constant": false,
                        "id": 1390,
                        "mutability": "mutable",
                        "name": "_ethTokenAddress",
                        "nodeType": "VariableDeclaration",
                        "scope": 1464,
                        "src": "811:32:7",
                        "stateVariable": true,
                        "storageLocation": "default",
                        "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                        },
                        "typeName": {
                            "id": 1389,
                            "name": "address",
                            "nodeType": "ElementaryTypeName",
                            "src": "811:7:7",
                            "stateMutability": "nonpayable",
                            "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                            }
                        },
                        "visibility": "private"
                    },
                    {
                        "body": {
                            "id": 1399,
                            "nodeType": "Block",
                            "src": "887:51:7",
                            "statements": [
                                {
                                    "expression": {
                                        "id": 1397,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftHandSide": {
                                            "id": 1395,
                                            "name": "_ethTokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1390,
                                            "src": "897:16:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "nodeType": "Assignment",
                                        "operator": "=",
                                        "rightHandSide": {
                                            "id": 1396,
                                            "name": "ethTokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1392,
                                            "src": "916:15:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "src": "897:34:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "id": 1398,
                                    "nodeType": "ExpressionStatement",
                                    "src": "897:34:7"
                                }
                            ]
                        },
                        "id": 1400,
                        "implemented": true,
                        "kind": "constructor",
                        "modifiers": [],
                        "name": "",
                        "nodeType": "FunctionDefinition",
                        "parameters": {
                            "id": 1393,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 1392,
                                    "mutability": "mutable",
                                    "name": "ethTokenAddress",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1400,
                                    "src": "862:23:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 1391,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "862:7:7",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "visibility": "internal"
                                }
                            ],
                            "src": "861:25:7"
                        },
                        "returnParameters": {
                            "id": 1394,
                            "nodeType": "ParameterList",
                            "parameters": [],
                            "src": "887:0:7"
                        },
                        "scope": 1464,
                        "src": "850:88:7",
                        "stateMutability": "nonpayable",
                        "virtual": false,
                        "visibility": "internal"
                    },
                    {
                        "body": {
                            "id": 1432,
                            "nodeType": "Block",
                            "src": "1066:211:7",
                            "statements": [
                                {
                                    "condition": {
                                        "commonType": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        },
                                        "id": 1413,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                            "id": 1411,
                                            "name": "tokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1402,
                                            "src": "1080:12:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "==",
                                        "rightExpression": {
                                            "id": 1412,
                                            "name": "_ethTokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1390,
                                            "src": "1096:16:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "src": "1080:32:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bool",
                                            "typeString": "bool"
                                        }
                                    },
                                    "falseBody": {
                                        "id": 1430,
                                        "nodeType": "Block",
                                        "src": "1198:73:7",
                                        "statements": [
                                            {
                                                "expression": {
                                                    "arguments": [
                                                        {
                                                            "id": 1426,
                                                            "name": "to",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 1404,
                                                            "src": "1249:2:7",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            }
                                                        },
                                                        {
                                                            "id": 1427,
                                                            "name": "amount",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 1406,
                                                            "src": "1253:6:7",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_uint256",
                                                                "typeString": "uint256"
                                                            }
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": [
                                                            {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            },
                                                            {
                                                                "typeIdentifier": "t_uint256",
                                                                "typeString": "uint256"
                                                            }
                                                        ],
                                                        "expression": {
                                                            "arguments": [
                                                                {
                                                                    "id": 1423,
                                                                    "name": "tokenAddress",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 1402,
                                                                    "src": "1226:12:7",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    }
                                                                }
                                                            ],
                                                            "expression": {
                                                                "argumentTypes": [
                                                                    {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    }
                                                                ],
                                                                "id": 1422,
                                                                "name": "IERC20",
                                                                "nodeType": "Identifier",
                                                                "overloadedDeclarations": [],
                                                                "referencedDeclaration": 6165,
                                                                "src": "1219:6:7",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_type$_t_contract$_IERC20_$6165_$",
                                                                    "typeString": "type(contract IERC20)"
                                                                }
                                                            },
                                                            "id": 1424,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "kind": "typeConversion",
                                                            "lValueRequested": false,
                                                            "names": [],
                                                            "nodeType": "FunctionCall",
                                                            "src": "1219:20:7",
                                                            "tryCall": false,
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_contract$_IERC20_$6165",
                                                                "typeString": "contract IERC20"
                                                            }
                                                        },
                                                        "id": 1425,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "lValueRequested": false,
                                                        "memberName": "transfer",
                                                        "nodeType": "MemberAccess",
                                                        "referencedDeclaration": 6114,
                                                        "src": "1219:29:7",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
                                                            "typeString": "function (address,uint256) external returns (bool)"
                                                        }
                                                    },
                                                    "id": 1428,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "kind": "functionCall",
                                                    "lValueRequested": false,
                                                    "names": [],
                                                    "nodeType": "FunctionCall",
                                                    "src": "1219:41:7",
                                                    "tryCall": false,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    }
                                                },
                                                "functionReturnParameters": 1410,
                                                "id": 1429,
                                                "nodeType": "Return",
                                                "src": "1212:48:7"
                                            }
                                        ]
                                    },
                                    "id": 1431,
                                    "nodeType": "IfStatement",
                                    "src": "1076:195:7",
                                    "trueBody": {
                                        "id": 1421,
                                        "nodeType": "Block",
                                        "src": "1114:78:7",
                                        "statements": [
                                            {
                                                "expression": {
                                                    "arguments": [
                                                        {
                                                            "id": 1415,
                                                            "name": "to",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 1404,
                                                            "src": "1145:2:7",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            }
                                                        },
                                                        {
                                                            "id": 1416,
                                                            "name": "amount",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 1406,
                                                            "src": "1149:6:7",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_uint256",
                                                                "typeString": "uint256"
                                                            }
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": [
                                                            {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            },
                                                            {
                                                                "typeIdentifier": "t_uint256",
                                                                "typeString": "uint256"
                                                            }
                                                        ],
                                                        "id": 1414,
                                                        "name": "externalTransfer",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 1533,
                                                        "src": "1128:16:7",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$",
                                                            "typeString": "function (address,uint256)"
                                                        }
                                                    },
                                                    "id": 1417,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "kind": "functionCall",
                                                    "lValueRequested": false,
                                                    "names": [],
                                                    "nodeType": "FunctionCall",
                                                    "src": "1128:28:7",
                                                    "tryCall": false,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_tuple$__$",
                                                        "typeString": "tuple()"
                                                    }
                                                },
                                                "id": 1418,
                                                "nodeType": "ExpressionStatement",
                                                "src": "1128:28:7"
                                            },
                                            {
                                                "expression": {
                                                    "hexValue": "74727565",
                                                    "id": 1419,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": true,
                                                    "kind": "bool",
                                                    "lValueRequested": false,
                                                    "nodeType": "Literal",
                                                    "src": "1177:4:7",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    },
                                                    "value": "true"
                                                },
                                                "functionReturnParameters": 1410,
                                                "id": 1420,
                                                "nodeType": "Return",
                                                "src": "1170:11:7"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "id": 1433,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "transfer",
                        "nodeType": "FunctionDefinition",
                        "parameters": {
                            "id": 1407,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 1402,
                                    "mutability": "mutable",
                                    "name": "tokenAddress",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1433,
                                    "src": "971:20:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 1401,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "971:7:7",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 1404,
                                    "mutability": "mutable",
                                    "name": "to",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1433,
                                    "src": "1001:10:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 1403,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1001:7:7",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 1406,
                                    "mutability": "mutable",
                                    "name": "amount",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1433,
                                    "src": "1021:14:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                    },
                                    "typeName": {
                                        "id": 1405,
                                        "name": "uint256",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1021:7:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "visibility": "internal"
                                }
                            ],
                            "src": "961:80:7"
                        },
                        "returnParameters": {
                            "id": 1410,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 1409,
                                    "mutability": "mutable",
                                    "name": "",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1433,
                                    "src": "1060:4:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_bool",
                                        "typeString": "bool"
                                    },
                                    "typeName": {
                                        "id": 1408,
                                        "name": "bool",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1060:4:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bool",
                                            "typeString": "bool"
                                        }
                                    },
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1059:6:7"
                        },
                        "scope": 1464,
                        "src": "944:333:7",
                        "stateMutability": "nonpayable",
                        "virtual": false,
                        "visibility": "internal"
                    },
                    {
                        "body": {
                            "id": 1462,
                            "nodeType": "Block",
                            "src": "1356:190:7",
                            "statements": [
                                {
                                    "condition": {
                                        "commonType": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        },
                                        "id": 1442,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                            "id": 1440,
                                            "name": "tokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1435,
                                            "src": "1370:12:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "==",
                                        "rightExpression": {
                                            "id": 1441,
                                            "name": "_ethTokenAddress",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1390,
                                            "src": "1386:16:7",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            }
                                        },
                                        "src": "1370:32:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bool",
                                            "typeString": "bool"
                                        }
                                    },
                                    "falseBody": {
                                        "id": 1460,
                                        "nodeType": "Block",
                                        "src": "1463:77:7",
                                        "statements": [
                                            {
                                                "expression": {
                                                    "arguments": [
                                                        {
                                                            "arguments": [
                                                                {
                                                                    "id": 1456,
                                                                    "name": "this",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": -28,
                                                                    "src": "1523:4:7",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                        "typeString": "contract BalanceCarrier"
                                                                    }
                                                                }
                                                            ],
                                                            "expression": {
                                                                "argumentTypes": [
                                                                    {
                                                                        "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                        "typeString": "contract BalanceCarrier"
                                                                    }
                                                                ],
                                                                "id": 1455,
                                                                "isConstant": false,
                                                                "isLValue": false,
                                                                "isPure": true,
                                                                "lValueRequested": false,
                                                                "nodeType": "ElementaryTypeNameExpression",
                                                                "src": "1515:7:7",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_type$_t_address_$",
                                                                    "typeString": "type(address)"
                                                                },
                                                                "typeName": {
                                                                    "id": 1454,
                                                                    "name": "address",
                                                                    "nodeType": "ElementaryTypeName",
                                                                    "src": "1515:7:7",
                                                                    "typeDescriptions": {}
                                                                }
                                                            },
                                                            "id": 1457,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "kind": "typeConversion",
                                                            "lValueRequested": false,
                                                            "names": [],
                                                            "nodeType": "FunctionCall",
                                                            "src": "1515:13:7",
                                                            "tryCall": false,
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            }
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": [
                                                            {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            }
                                                        ],
                                                        "expression": {
                                                            "arguments": [
                                                                {
                                                                    "id": 1451,
                                                                    "name": "tokenAddress",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 1435,
                                                                    "src": "1491:12:7",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    }
                                                                }
                                                            ],
                                                            "expression": {
                                                                "argumentTypes": [
                                                                    {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    }
                                                                ],
                                                                "id": 1450,
                                                                "name": "IERC20",
                                                                "nodeType": "Identifier",
                                                                "overloadedDeclarations": [],
                                                                "referencedDeclaration": 6165,
                                                                "src": "1484:6:7",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_type$_t_contract$_IERC20_$6165_$",
                                                                    "typeString": "type(contract IERC20)"
                                                                }
                                                            },
                                                            "id": 1452,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "kind": "typeConversion",
                                                            "lValueRequested": false,
                                                            "names": [],
                                                            "nodeType": "FunctionCall",
                                                            "src": "1484:20:7",
                                                            "tryCall": false,
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_contract$_IERC20_$6165",
                                                                "typeString": "contract IERC20"
                                                            }
                                                        },
                                                        "id": 1453,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "lValueRequested": false,
                                                        "memberName": "balanceOf",
                                                        "nodeType": "MemberAccess",
                                                        "referencedDeclaration": 6104,
                                                        "src": "1484:30:7",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
                                                            "typeString": "function (address) view external returns (uint256)"
                                                        }
                                                    },
                                                    "id": 1458,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "kind": "functionCall",
                                                    "lValueRequested": false,
                                                    "names": [],
                                                    "nodeType": "FunctionCall",
                                                    "src": "1484:45:7",
                                                    "tryCall": false,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_uint256",
                                                        "typeString": "uint256"
                                                    }
                                                },
                                                "functionReturnParameters": 1439,
                                                "id": 1459,
                                                "nodeType": "Return",
                                                "src": "1477:52:7"
                                            }
                                        ]
                                    },
                                    "id": 1461,
                                    "nodeType": "IfStatement",
                                    "src": "1366:174:7",
                                    "trueBody": {
                                        "id": 1449,
                                        "nodeType": "Block",
                                        "src": "1404:53:7",
                                        "statements": [
                                            {
                                                "expression": {
                                                    "expression": {
                                                        "arguments": [
                                                            {
                                                                "id": 1445,
                                                                "name": "this",
                                                                "nodeType": "Identifier",
                                                                "overloadedDeclarations": [],
                                                                "referencedDeclaration": -28,
                                                                "src": "1433:4:7",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                    "typeString": "contract BalanceCarrier"
                                                                }
                                                            }
                                                        ],
                                                        "expression": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                    "typeString": "contract BalanceCarrier"
                                                                }
                                                            ],
                                                            "id": 1444,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "nodeType": "ElementaryTypeNameExpression",
                                                            "src": "1425:7:7",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_type$_t_address_$",
                                                                "typeString": "type(address)"
                                                            },
                                                            "typeName": {
                                                                "id": 1443,
                                                                "name": "address",
                                                                "nodeType": "ElementaryTypeName",
                                                                "src": "1425:7:7",
                                                                "typeDescriptions": {}
                                                            }
                                                        },
                                                        "id": 1446,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "kind": "typeConversion",
                                                        "lValueRequested": false,
                                                        "names": [],
                                                        "nodeType": "FunctionCall",
                                                        "src": "1425:13:7",
                                                        "tryCall": false,
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    "id": 1447,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "memberName": "balance",
                                                    "nodeType": "MemberAccess",
                                                    "src": "1425:21:7",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_uint256",
                                                        "typeString": "uint256"
                                                    }
                                                },
                                                "functionReturnParameters": 1439,
                                                "id": 1448,
                                                "nodeType": "Return",
                                                "src": "1418:28:7"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "id": 1463,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "balanceOf",
                        "nodeType": "FunctionDefinition",
                        "parameters": {
                            "id": 1436,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 1435,
                                    "mutability": "mutable",
                                    "name": "tokenAddress",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1463,
                                    "src": "1302:20:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 1434,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1302:7:7",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1301:22:7"
                        },
                        "returnParameters": {
                            "id": 1439,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 1438,
                                    "mutability": "mutable",
                                    "name": "",
                                    "nodeType": "VariableDeclaration",
                                    "scope": 1463,
                                    "src": "1347:7:7",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                    },
                                    "typeName": {
                                        "id": 1437,
                                        "name": "uint256",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1347:7:7",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1346:9:7"
                        },
                        "scope": 1464,
                        "src": "1283:263:7",
                        "stateMutability": "view",
                        "virtual": false,
                        "visibility": "internal"
                    }
                ],
                "scope": 1465,
                "src": "754:794:7"
            }
        ],
        "src": "640:909:7"
    },
    "legacyAST": {
        "attributes": {
            "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/BalanceCarrier.sol",
            "exportedSymbols": {
                "BalanceCarrier": [
                    1464
                ],
                "ExternalCaller": [
                    1563
                ],
                "IERC20": [
                    6165
                ]
            },
            "license": "Apache-2.0"
        },
        "children": [
            {
                "attributes": {
                    "literals": [
                        "solidity",
                        "^",
                        "0.7",
                        ".0"
                    ]
                },
                "id": 1384,
                "name": "PragmaDirective",
                "src": "640:23:7"
            },
            {
                "attributes": {
                    "SourceUnit": 6166,
                    "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
                    "file": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
                    "scope": 1465,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 1385,
                "name": "ImportDirective",
                "src": "665:56:7"
            },
            {
                "attributes": {
                    "SourceUnit": 1564,
                    "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/common/utils/ExternalCaller.sol",
                    "file": "./ExternalCaller.sol",
                    "scope": 1465,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 1386,
                "name": "ImportDirective",
                "src": "722:30:7"
            },
            {
                "attributes": {
                    "abstract": true,
                    "contractDependencies": [
                        1563
                    ],
                    "contractKind": "contract",
                    "fullyImplemented": true,
                    "linearizedBaseContracts": [
                        1464,
                        1563
                    ],
                    "name": "BalanceCarrier",
                    "scope": 1465
                },
                "children": [
                    {
                        "attributes": {},
                        "children": [
                            {
                                "attributes": {
                                    "name": "ExternalCaller",
                                    "referencedDeclaration": 1563,
                                    "type": "contract ExternalCaller"
                                },
                                "id": 1387,
                                "name": "UserDefinedTypeName",
                                "src": "790:14:7"
                            }
                        ],
                        "id": 1388,
                        "name": "InheritanceSpecifier",
                        "src": "790:14:7"
                    },
                    {
                        "attributes": {
                            "constant": false,
                            "mutability": "mutable",
                            "name": "_ethTokenAddress",
                            "scope": 1464,
                            "stateVariable": true,
                            "storageLocation": "default",
                            "type": "address",
                            "visibility": "private"
                        },
                        "children": [
                            {
                                "attributes": {
                                    "name": "address",
                                    "stateMutability": "nonpayable",
                                    "type": "address"
                                },
                                "id": 1389,
                                "name": "ElementaryTypeName",
                                "src": "811:7:7"
                            }
                        ],
                        "id": 1390,
                        "name": "VariableDeclaration",
                        "src": "811:32:7"
                    },
                    {
                        "attributes": {
                            "implemented": true,
                            "isConstructor": true,
                            "kind": "constructor",
                            "modifiers": [
                                null
                            ],
                            "name": "",
                            "scope": 1464,
                            "stateMutability": "nonpayable",
                            "virtual": false,
                            "visibility": "internal"
                        },
                        "children": [
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "ethTokenAddress",
                                            "scope": 1400,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 1391,
                                                "name": "ElementaryTypeName",
                                                "src": "862:7:7"
                                            }
                                        ],
                                        "id": 1392,
                                        "name": "VariableDeclaration",
                                        "src": "862:23:7"
                                    }
                                ],
                                "id": 1393,
                                "name": "ParameterList",
                                "src": "861:25:7"
                            },
                            {
                                "attributes": {
                                    "parameters": [
                                        null
                                    ]
                                },
                                "children": [],
                                "id": 1394,
                                "name": "ParameterList",
                                "src": "887:0:7"
                            },
                            {
                                "children": [
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "operator": "=",
                                                    "type": "address"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1390,
                                                            "type": "address",
                                                            "value": "_ethTokenAddress"
                                                        },
                                                        "id": 1395,
                                                        "name": "Identifier",
                                                        "src": "897:16:7"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1392,
                                                            "type": "address",
                                                            "value": "ethTokenAddress"
                                                        },
                                                        "id": 1396,
                                                        "name": "Identifier",
                                                        "src": "916:15:7"
                                                    }
                                                ],
                                                "id": 1397,
                                                "name": "Assignment",
                                                "src": "897:34:7"
                                            }
                                        ],
                                        "id": 1398,
                                        "name": "ExpressionStatement",
                                        "src": "897:34:7"
                                    }
                                ],
                                "id": 1399,
                                "name": "Block",
                                "src": "887:51:7"
                            }
                        ],
                        "id": 1400,
                        "name": "FunctionDefinition",
                        "src": "850:88:7"
                    },
                    {
                        "attributes": {
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "transfer",
                            "scope": 1464,
                            "stateMutability": "nonpayable",
                            "virtual": false,
                            "visibility": "internal"
                        },
                        "children": [
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "tokenAddress",
                                            "scope": 1433,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 1401,
                                                "name": "ElementaryTypeName",
                                                "src": "971:7:7"
                                            }
                                        ],
                                        "id": 1402,
                                        "name": "VariableDeclaration",
                                        "src": "971:20:7"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "to",
                                            "scope": 1433,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 1403,
                                                "name": "ElementaryTypeName",
                                                "src": "1001:7:7"
                                            }
                                        ],
                                        "id": 1404,
                                        "name": "VariableDeclaration",
                                        "src": "1001:10:7"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "amount",
                                            "scope": 1433,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "uint256",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "uint256",
                                                    "type": "uint256"
                                                },
                                                "id": 1405,
                                                "name": "ElementaryTypeName",
                                                "src": "1021:7:7"
                                            }
                                        ],
                                        "id": 1406,
                                        "name": "VariableDeclaration",
                                        "src": "1021:14:7"
                                    }
                                ],
                                "id": 1407,
                                "name": "ParameterList",
                                "src": "961:80:7"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "",
                                            "scope": 1433,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "bool",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "bool",
                                                    "type": "bool"
                                                },
                                                "id": 1408,
                                                "name": "ElementaryTypeName",
                                                "src": "1060:4:7"
                                            }
                                        ],
                                        "id": 1409,
                                        "name": "VariableDeclaration",
                                        "src": "1060:4:7"
                                    }
                                ],
                                "id": 1410,
                                "name": "ParameterList",
                                "src": "1059:6:7"
                            },
                            {
                                "children": [
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "commonType": {
                                                        "typeIdentifier": "t_address",
                                                        "typeString": "address"
                                                    },
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "operator": "==",
                                                    "type": "bool"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1402,
                                                            "type": "address",
                                                            "value": "tokenAddress"
                                                        },
                                                        "id": 1411,
                                                        "name": "Identifier",
                                                        "src": "1080:12:7"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1390,
                                                            "type": "address",
                                                            "value": "_ethTokenAddress"
                                                        },
                                                        "id": 1412,
                                                        "name": "Identifier",
                                                        "src": "1096:16:7"
                                                    }
                                                ],
                                                "id": 1413,
                                                "name": "BinaryOperation",
                                                "src": "1080:32:7"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "isStructConstructorCall": false,
                                                                    "lValueRequested": false,
                                                                    "names": [
                                                                        null
                                                                    ],
                                                                    "tryCall": false,
                                                                    "type": "tuple()",
                                                                    "type_conversion": false
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": [
                                                                                {
                                                                                    "typeIdentifier": "t_address",
                                                                                    "typeString": "address"
                                                                                },
                                                                                {
                                                                                    "typeIdentifier": "t_uint256",
                                                                                    "typeString": "uint256"
                                                                                }
                                                                            ],
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 1533,
                                                                            "type": "function (address,uint256)",
                                                                            "value": "externalTransfer"
                                                                        },
                                                                        "id": 1414,
                                                                        "name": "Identifier",
                                                                        "src": "1128:16:7"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 1404,
                                                                            "type": "address",
                                                                            "value": "to"
                                                                        },
                                                                        "id": 1415,
                                                                        "name": "Identifier",
                                                                        "src": "1145:2:7"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 1406,
                                                                            "type": "uint256",
                                                                            "value": "amount"
                                                                        },
                                                                        "id": 1416,
                                                                        "name": "Identifier",
                                                                        "src": "1149:6:7"
                                                                    }
                                                                ],
                                                                "id": 1417,
                                                                "name": "FunctionCall",
                                                                "src": "1128:28:7"
                                                            }
                                                        ],
                                                        "id": 1418,
                                                        "name": "ExpressionStatement",
                                                        "src": "1128:28:7"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "functionReturnParameters": 1410
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "hexvalue": "74727565",
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": true,
                                                                    "lValueRequested": false,
                                                                    "token": "bool",
                                                                    "type": "bool",
                                                                    "value": "true"
                                                                },
                                                                "id": 1419,
                                                                "name": "Literal",
                                                                "src": "1177:4:7"
                                                            }
                                                        ],
                                                        "id": 1420,
                                                        "name": "Return",
                                                        "src": "1170:11:7"
                                                    }
                                                ],
                                                "id": 1421,
                                                "name": "Block",
                                                "src": "1114:78:7"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "functionReturnParameters": 1410
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "isStructConstructorCall": false,
                                                                    "lValueRequested": false,
                                                                    "names": [
                                                                        null
                                                                    ],
                                                                    "tryCall": false,
                                                                    "type": "bool",
                                                                    "type_conversion": false
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": [
                                                                                {
                                                                                    "typeIdentifier": "t_address",
                                                                                    "typeString": "address"
                                                                                },
                                                                                {
                                                                                    "typeIdentifier": "t_uint256",
                                                                                    "typeString": "uint256"
                                                                                }
                                                                            ],
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "lValueRequested": false,
                                                                            "member_name": "transfer",
                                                                            "referencedDeclaration": 6114,
                                                                            "type": "function (address,uint256) external returns (bool)"
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": false,
                                                                                    "isStructConstructorCall": false,
                                                                                    "lValueRequested": false,
                                                                                    "names": [
                                                                                        null
                                                                                    ],
                                                                                    "tryCall": false,
                                                                                    "type": "contract IERC20",
                                                                                    "type_conversion": true
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": [
                                                                                                {
                                                                                                    "typeIdentifier": "t_address",
                                                                                                    "typeString": "address"
                                                                                                }
                                                                                            ],
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6165,
                                                                                            "type": "type(contract IERC20)",
                                                                                            "value": "IERC20"
                                                                                        },
                                                                                        "id": 1422,
                                                                                        "name": "Identifier",
                                                                                        "src": "1219:6:7"
                                                                                    },
                                                                                    {
                                                                                        "attributes": {
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 1402,
                                                                                            "type": "address",
                                                                                            "value": "tokenAddress"
                                                                                        },
                                                                                        "id": 1423,
                                                                                        "name": "Identifier",
                                                                                        "src": "1226:12:7"
                                                                                    }
                                                                                ],
                                                                                "id": 1424,
                                                                                "name": "FunctionCall",
                                                                                "src": "1219:20:7"
                                                                            }
                                                                        ],
                                                                        "id": 1425,
                                                                        "name": "MemberAccess",
                                                                        "src": "1219:29:7"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 1404,
                                                                            "type": "address",
                                                                            "value": "to"
                                                                        },
                                                                        "id": 1426,
                                                                        "name": "Identifier",
                                                                        "src": "1249:2:7"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 1406,
                                                                            "type": "uint256",
                                                                            "value": "amount"
                                                                        },
                                                                        "id": 1427,
                                                                        "name": "Identifier",
                                                                        "src": "1253:6:7"
                                                                    }
                                                                ],
                                                                "id": 1428,
                                                                "name": "FunctionCall",
                                                                "src": "1219:41:7"
                                                            }
                                                        ],
                                                        "id": 1429,
                                                        "name": "Return",
                                                        "src": "1212:48:7"
                                                    }
                                                ],
                                                "id": 1430,
                                                "name": "Block",
                                                "src": "1198:73:7"
                                            }
                                        ],
                                        "id": 1431,
                                        "name": "IfStatement",
                                        "src": "1076:195:7"
                                    }
                                ],
                                "id": 1432,
                                "name": "Block",
                                "src": "1066:211:7"
                            }
                        ],
                        "id": 1433,
                        "name": "FunctionDefinition",
                        "src": "944:333:7"
                    },
                    {
                        "attributes": {
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "balanceOf",
                            "scope": 1464,
                            "stateMutability": "view",
                            "virtual": false,
                            "visibility": "internal"
                        },
                        "children": [
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "tokenAddress",
                                            "scope": 1463,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 1434,
                                                "name": "ElementaryTypeName",
                                                "src": "1302:7:7"
                                            }
                                        ],
                                        "id": 1435,
                                        "name": "VariableDeclaration",
                                        "src": "1302:20:7"
                                    }
                                ],
                                "id": 1436,
                                "name": "ParameterList",
                                "src": "1301:22:7"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "",
                                            "scope": 1463,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "uint256",
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "uint256",
                                                    "type": "uint256"
                                                },
                                                "id": 1437,
                                                "name": "ElementaryTypeName",
                                                "src": "1347:7:7"
                                            }
                                        ],
                                        "id": 1438,
                                        "name": "VariableDeclaration",
                                        "src": "1347:7:7"
                                    }
                                ],
                                "id": 1439,
                                "name": "ParameterList",
                                "src": "1346:9:7"
                            },
                            {
                                "children": [
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "commonType": {
                                                        "typeIdentifier": "t_address",
                                                        "typeString": "address"
                                                    },
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "operator": "==",
                                                    "type": "bool"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1435,
                                                            "type": "address",
                                                            "value": "tokenAddress"
                                                        },
                                                        "id": 1440,
                                                        "name": "Identifier",
                                                        "src": "1370:12:7"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1390,
                                                            "type": "address",
                                                            "value": "_ethTokenAddress"
                                                        },
                                                        "id": 1441,
                                                        "name": "Identifier",
                                                        "src": "1386:16:7"
                                                    }
                                                ],
                                                "id": 1442,
                                                "name": "BinaryOperation",
                                                "src": "1370:32:7"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "functionReturnParameters": 1439
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "member_name": "balance",
                                                                    "type": "uint256"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "isStructConstructorCall": false,
                                                                            "lValueRequested": false,
                                                                            "names": [
                                                                                null
                                                                            ],
                                                                            "tryCall": false,
                                                                            "type": "address",
                                                                            "type_conversion": true
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": [
                                                                                        {
                                                                                            "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                                            "typeString": "contract BalanceCarrier"
                                                                                        }
                                                                                    ],
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": true,
                                                                                    "lValueRequested": false,
                                                                                    "type": "type(address)"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "name": "address"
                                                                                        },
                                                                                        "id": 1443,
                                                                                        "name": "ElementaryTypeName",
                                                                                        "src": "1425:7:7"
                                                                                    }
                                                                                ],
                                                                                "id": 1444,
                                                                                "name": "ElementaryTypeNameExpression",
                                                                                "src": "1425:7:7"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": -28,
                                                                                    "type": "contract BalanceCarrier",
                                                                                    "value": "this"
                                                                                },
                                                                                "id": 1445,
                                                                                "name": "Identifier",
                                                                                "src": "1433:4:7"
                                                                            }
                                                                        ],
                                                                        "id": 1446,
                                                                        "name": "FunctionCall",
                                                                        "src": "1425:13:7"
                                                                    }
                                                                ],
                                                                "id": 1447,
                                                                "name": "MemberAccess",
                                                                "src": "1425:21:7"
                                                            }
                                                        ],
                                                        "id": 1448,
                                                        "name": "Return",
                                                        "src": "1418:28:7"
                                                    }
                                                ],
                                                "id": 1449,
                                                "name": "Block",
                                                "src": "1404:53:7"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "functionReturnParameters": 1439
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "isStructConstructorCall": false,
                                                                    "lValueRequested": false,
                                                                    "names": [
                                                                        null
                                                                    ],
                                                                    "tryCall": false,
                                                                    "type": "uint256",
                                                                    "type_conversion": false
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": [
                                                                                {
                                                                                    "typeIdentifier": "t_address",
                                                                                    "typeString": "address"
                                                                                }
                                                                            ],
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "lValueRequested": false,
                                                                            "member_name": "balanceOf",
                                                                            "referencedDeclaration": 6104,
                                                                            "type": "function (address) view external returns (uint256)"
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": false,
                                                                                    "isStructConstructorCall": false,
                                                                                    "lValueRequested": false,
                                                                                    "names": [
                                                                                        null
                                                                                    ],
                                                                                    "tryCall": false,
                                                                                    "type": "contract IERC20",
                                                                                    "type_conversion": true
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": [
                                                                                                {
                                                                                                    "typeIdentifier": "t_address",
                                                                                                    "typeString": "address"
                                                                                                }
                                                                                            ],
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6165,
                                                                                            "type": "type(contract IERC20)",
                                                                                            "value": "IERC20"
                                                                                        },
                                                                                        "id": 1450,
                                                                                        "name": "Identifier",
                                                                                        "src": "1484:6:7"
                                                                                    },
                                                                                    {
                                                                                        "attributes": {
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 1435,
                                                                                            "type": "address",
                                                                                            "value": "tokenAddress"
                                                                                        },
                                                                                        "id": 1451,
                                                                                        "name": "Identifier",
                                                                                        "src": "1491:12:7"
                                                                                    }
                                                                                ],
                                                                                "id": 1452,
                                                                                "name": "FunctionCall",
                                                                                "src": "1484:20:7"
                                                                            }
                                                                        ],
                                                                        "id": 1453,
                                                                        "name": "MemberAccess",
                                                                        "src": "1484:30:7"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "isStructConstructorCall": false,
                                                                            "lValueRequested": false,
                                                                            "names": [
                                                                                null
                                                                            ],
                                                                            "tryCall": false,
                                                                            "type": "address",
                                                                            "type_conversion": true
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": [
                                                                                        {
                                                                                            "typeIdentifier": "t_contract$_BalanceCarrier_$1464",
                                                                                            "typeString": "contract BalanceCarrier"
                                                                                        }
                                                                                    ],
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": true,
                                                                                    "lValueRequested": false,
                                                                                    "type": "type(address)"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "name": "address"
                                                                                        },
                                                                                        "id": 1454,
                                                                                        "name": "ElementaryTypeName",
                                                                                        "src": "1515:7:7"
                                                                                    }
                                                                                ],
                                                                                "id": 1455,
                                                                                "name": "ElementaryTypeNameExpression",
                                                                                "src": "1515:7:7"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": -28,
                                                                                    "type": "contract BalanceCarrier",
                                                                                    "value": "this"
                                                                                },
                                                                                "id": 1456,
                                                                                "name": "Identifier",
                                                                                "src": "1523:4:7"
                                                                            }
                                                                        ],
                                                                        "id": 1457,
                                                                        "name": "FunctionCall",
                                                                        "src": "1515:13:7"
                                                                    }
                                                                ],
                                                                "id": 1458,
                                                                "name": "FunctionCall",
                                                                "src": "1484:45:7"
                                                            }
                                                        ],
                                                        "id": 1459,
                                                        "name": "Return",
                                                        "src": "1477:52:7"
                                                    }
                                                ],
                                                "id": 1460,
                                                "name": "Block",
                                                "src": "1463:77:7"
                                            }
                                        ],
                                        "id": 1461,
                                        "name": "IfStatement",
                                        "src": "1366:174:7"
                                    }
                                ],
                                "id": 1462,
                                "name": "Block",
                                "src": "1356:190:7"
                            }
                        ],
                        "id": 1463,
                        "name": "FunctionDefinition",
                        "src": "1283:263:7"
                    }
                ],
                "id": 1464,
                "name": "ContractDefinition",
                "src": "754:794:7"
            }
        ],
        "id": 1465,
        "name": "SourceUnit",
        "src": "640:909:7"
    },
    "compiler": {
        "name": "solc",
        "version": "0.7.3+commit.9bfce1f6.Emscripten.clang"
    },
    "networks": {},
    "schemaVersion": "3.3.3",
    "updatedAt": "2021-02-01T23:13:33.201Z",
    "devdoc": {
        "kind": "dev",
        "methods": {},
        "version": 1
    },
    "userdoc": {
        "kind": "user",
        "methods": {},
        "version": 1
    }
}
