{
    "Function": "dealERC1155",
    "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",
        "stdStorage",
        "stdStorage"
    ],
    "Internal Calls": [
        "abi.encodeWithSelector()",
        "require(bool,string)",
        "abi.decode()",
        "abi.decode()",
        "abi.encodeWithSelector()"
    ],
    "Library Calls": [
        "with_key",
        "with_key",
        "target",
        "checked_write",
        "sig",
        "with_key",
        "checked_write",
        "target",
        "sig"
    ],
    "Low-Level Calls": [
        "staticcall",
        "staticcall"
    ],
    "Code": "function dealERC1155(address token, address to, uint256 id, uint256 give, bool adjust) internal virtual {\n        // get current balance\n        (, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x00fdd58e, to, id));\n        uint256 prevBal = abi.decode(balData, (uint256));\n\n        // update balance\n        stdstore.target(token).sig(0x00fdd58e).with_key(to).with_key(id).checked_write(give);\n\n        // update total supply\n        if (adjust) {\n            (, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0xbd85b039, id));\n            require(\n                totSupData.length != 0,\n                \"StdCheats deal(address,address,uint,uint,bool): target contract is not ERC1155Supply.\"\n            );\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(0xbd85b039).with_key(id).checked_write(totSup);\n        }\n    }"
}