{
    "Function": "_swapTokenToBase",
    "File": "contracts/Pool.sol",
    "Parent Contracts": [
        "contracts/interfaces/iBEP20.sol"
    ],
    "High-Level Calls": [
        "iDAO",
        "iDAO",
        "iUTILS",
        "iUTILS"
    ],
    "Internal Calls": [
        "_DAO",
        "_addPoolMetrics",
        "_setPoolAmounts",
        "_DAO"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _swapTokenToBase(uint256 _x) internal returns (uint256 _y, uint256 _fee){\n        uint256 _X = tokenAmount;\n        uint256 _Y = baseAmount;\n        _y =  iUTILS(_DAO().UTILS()).calcSwapOutput(_x, _X, _Y); // Calc SPARTA output\n        _fee = iUTILS(_DAO().UTILS()).calcSwapFee(_x, _X, _Y); // Calc SPARTA fee\n        _setPoolAmounts(_Y - _y, _X + _x); // Update recorded BASE and TOKEN amounts\n        _addPoolMetrics(_fee); // Add slip fee to the revenue metrics\n        return (_y, _fee);\n    }"
}