{
    "Function": "enforceReserveRatio",
    "File": "contracts/rubiconPools/BathPair.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IERC20",
        "IBathHouse",
        "IBathToken",
        "SafeMath",
        "IERC20",
        "SafeMath",
        "IBathHouse",
        "IBathToken",
        "SafeMath",
        "SafeMath",
        "IBathHouse",
        "IBathHouse"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [
        "mul",
        "mul",
        "div",
        "div"
    ],
    "Low-Level Calls": [],
    "Code": "function enforceReserveRatio(\n        address underlyingAsset,\n        address underlyingQuote\n    )\n        internal\n        view\n        returns (address bathAssetAddress, address bathQuoteAddress)\n    {\n        bathAssetAddress = IBathHouse(bathHouse).tokenToBathToken(\n            underlyingAsset\n        );\n        bathQuoteAddress = IBathHouse(bathHouse).tokenToBathToken(\n            underlyingQuote\n        );\n        require(\n            (\n                IBathToken(bathAssetAddress).underlyingBalance().mul(\n                    IBathHouse(bathHouse).reserveRatio()\n                )\n            ).div(100) <= IERC20(underlyingAsset).balanceOf(bathAssetAddress),\n            \"Failed to meet asset pool reserve ratio\"\n        );\n        require(\n            (\n                IBathToken(bathQuoteAddress).underlyingBalance().mul(\n                    IBathHouse(bathHouse).reserveRatio()\n                )\n            ).div(100) <= IERC20(underlyingQuote).balanceOf(bathQuoteAddress),\n            \"Failed to meet quote pool reserve ratio\"\n        );\n    }"
}