{
    "Function": "removeLiquidityExact",
    "File": "contracts/Router.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "iDAO",
        "Pool",
        "iBEP20",
        "iPOOLFACTORY",
        "iBEP20",
        "iBEP20",
        "Pool"
    ],
    "Internal Calls": [
        "_handleTransferOut",
        "_handleTransferOut",
        "_DAO"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function removeLiquidityExact(uint units, address token) public {\n        address _pool = iPOOLFACTORY(_DAO().POOLFACTORY()).getPool(token); // Get the pool address\n        address _member = msg.sender; // The the user's address\n        iBEP20(_pool).transferFrom(_member, _pool, units); // Transfer LPs to the pool\n        if(token != address(0)){\n            Pool(_pool).removeForMember(_member); // Remove liquidity and send assets directly to user\n        } else {\n            Pool(_pool).remove(); // If BNB; remove liquidity and send to ROUTER instead\n            uint outputBase = iBEP20(BASE).balanceOf(address(this)); // Get the received SPARTA amount\n            uint outputToken = iBEP20(WBNB).balanceOf(address(this)); // Get the received WBNB amount\n            _handleTransferOut(token, outputToken, _member); // Unwrap to BNB & tsf it to user\n            _handleTransferOut(BASE, outputBase, _member); // Transfer SPARTA to user\n        }\n    }"
}