{
    "Function": "multicall",
    "File": "contracts/multicall/Multicall.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "revert(uint256,uint256)",
        "mload(uint256)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [
        "delegatecall"
    ],
    "Code": "function multicall(bytes[] calldata data) public payable returns (bytes[] memory results) {\n        results = new bytes[](data.length);\n        for (uint256 i = 0; i < data.length; ) {\n            (bool success, bytes memory result) = address(this).delegatecall(data[i]);\n\n            if (!success) {\n                // Bubble up the revert reason\n                // The bytes type is ABI encoded as a length-prefixed byte array\n                // So we simply need to add 32 to the pointer to get the start of the data\n                // And then revert with the size loaded from the first 32 bytes\n                // Other solutions will do work to differentiate the revert reasons and provide paranthetical information\n                // However, we have chosen to simply replicate the the normal behavior of the call\n                // NOTE: memory-safe because it reads from memory already allocated by solidity (the bytes memory result)\n                assembly (\"memory-safe\") {\n                    revert(add(result, 32), mload(result))\n                }\n            }\n\n            results[i] = result;\n\n            unchecked {\n                ++i;\n            }\n        }\n    }"
}