{
    "Function": "addPoolPair",
    "File": "contracts/test/BalancerRegistry.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IBPool",
        "IBPool",
        "EnumerableSet",
        "IBPool",
        "IBFactory",
        "IBPool",
        "IBPool"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "_createKey",
        "require(bool,string)"
    ],
    "Library Calls": [
        "add"
    ],
    "Low-Level Calls": [],
    "Code": "function addPoolPair(address pool, address token1, address token2) public returns(uint256 listed) {\n\n        require(bfactory.isBPool(pool), \"ERR_NOT_BPOOL\");\n\n        uint256 swapFee = IBPool(pool).getSwapFee();\n        require(swapFee <= MAX_SWAP_FEE, \"ERR_FEE_TOO_HIGH\");\n\n        bytes32 key = _createKey(token1, token2);\n        _pools[key].pools.add(pool);\n\n         if (token1 < token2) {\n            _infos[pool][key] = PoolPairInfo({\n                weight1: uint80(IBPool(pool).getDenormalizedWeight(token1)),\n                weight2: uint80(IBPool(pool).getDenormalizedWeight(token2)),\n                swapFee: uint80(swapFee),\n                liq: uint256(0)\n            });\n        } else {\n            _infos[pool][key] = PoolPairInfo({\n                weight1: uint80(IBPool(pool).getDenormalizedWeight(token2)),\n                weight2: uint80(IBPool(pool).getDenormalizedWeight(token1)),\n                swapFee: uint80(swapFee),\n                liq: uint256(0)\n            });\n        }\n\n        emit PoolTokenPairAdded(\n            pool,\n            token1,\n            token2\n        );\n\n        listed++;\n\n    }"
}