{
    "Function": "_getEffectiveLiquidityForPools",
    "File": "contracts/test/BalancerRegistry.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IBPool",
        "SafeMath",
        "IBPool",
        "SafeMath",
        "SafeMath",
        "SafeMath"
    ],
    "Internal Calls": [
        "bdiv",
        "bdiv",
        "_createKey"
    ],
    "Library Calls": [
        "mul",
        "add",
        "add",
        "mul"
    ],
    "Low-Level Calls": [],
    "Code": "function _getEffectiveLiquidityForPools(address token1, address token2, address[] memory pools)\n        internal view returns(uint256[] memory effectiveLiquidity)\n    {\n        effectiveLiquidity = new uint256[](pools.length);\n        for (uint i = 0; i < pools.length; i++) {\n            bytes32 key = _createKey(token1, token2);\n            PoolPairInfo memory info = _infos[pools[i]][key];\n            if (token1 < token2) {\n                // we define effective liquidity as b2 * w1 / (w1 + w2)\n                effectiveLiquidity[i] = bdiv(uint256(info.weight1),uint256(info.weight1).add(uint256(info.weight2)));\n                effectiveLiquidity[i] = effectiveLiquidity[i].mul(IBPool(pools[i]).getBalance(token2));\n            } else {\n                effectiveLiquidity[i] = bdiv(uint256(info.weight2),uint256(info.weight1).add(uint256(info.weight2)));\n                effectiveLiquidity[i] = effectiveLiquidity[i].mul(IBPool(pools[i]).getBalance(token2));\n            }\n        }\n    }"
}