{
    "Function": "deal",
    "File": "contracts/src/vendor/forge-std/src/StdCheats.sol",
    "Parent Contracts": [
        "contracts/src/vendor/forge-std/src/StdCheats.sol"
    ],
    "High-Level Calls": [
        "stdStorage",
        "stdStorage",
        "stdStorage",
        "stdStorage",
        "stdStorage",
        "stdStorage",
        "stdStorage"
    ],
    "Internal Calls": [
        "abi.decode()",
        "abi.decode()",
        "abi.encodeWithSelector()",
        "abi.encodeWithSelector()"
    ],
    "Library Calls": [
        "checked_write",
        "target",
        "sig",
        "with_key",
        "checked_write",
        "target",
        "sig"
    ],
    "Low-Level Calls": [
        "staticcall",
        "staticcall"
    ],
    "Code": "function deal(address token, address to, uint256 give, bool adjust) internal virtual {\n        // get current balance\n        (, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to));\n        uint256 prevBal = abi.decode(balData, (uint256));\n\n        // update balance\n        stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give);\n\n        // update total supply\n        if (adjust) {\n            (, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0x18160ddd));\n            uint256 totSup = abi.decode(totSupData, (uint256));\n            if (give < prevBal) {\n                totSup -= (prevBal - give);\n            } else {\n                totSup += (give - prevBal);\n            }\n            stdstore.target(token).sig(0x18160ddd).checked_write(totSup);\n        }\n    }"
}