{
    "Function": "borrowInternal",
    "File": "src/Market.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IDolaBorrowingRights",
        "IBorrowController",
        "IERC20"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "getCreditLimitInternal"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function borrowInternal(address borrower, address to, uint amount) internal {\n        require(!borrowPaused, \"Borrowing is paused\");\n        if(borrowController != IBorrowController(address(0))) {\n            require(borrowController.borrowAllowed(msg.sender, borrower, amount), \"Denied by borrow controller\");\n        }\n        uint credit = getCreditLimitInternal(borrower);\n        debts[borrower] += amount;\n        require(credit >= debts[borrower], \"Exceeded credit limit\");\n        totalDebt += amount;\n        dbr.onBorrow(borrower, amount);\n        dola.transfer(to, amount);\n        emit Borrow(borrower, amount);\n    }"
}