{
    "Function": "calculateAddress",
    "File": "src/views/AddressCalculation.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "code(address)",
        "calculateAddressUnsafe",
        "require(bool,string)",
        "code(address)",
        "require(bool,string)",
        "code(address)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function calculateAddress(NewInstance memory instance)\n        external\n        view\n        returns (SystemInstance memory walletInstance)\n    {\n        /// important check:\n        ///   - recovery spells should have no bytecode\n        ///   - this is a duplicate check, however there is no harm in being safe\n        for (uint256 i = 0; i < instance.recoverySpells.length; i++) {\n            require(\n                instance.recoverySpells[i].code.length == 0,\n                \"InstanceDeployer: recovery spell has bytecode\"\n            );\n        }\n\n        walletInstance = calculateAddressUnsafe(instance);\n\n        /// if the safe does not exist, then there should be no need to check\n        /// recovery spell addresses because they will not be able to be\n        /// created from the recovery spell factory if the safe does not exist.\n        require(\n            address(walletInstance.safe).code.length == 0,\n            \"InstanceDeployer: safe already created\"\n        );\n        require(\n            address(walletInstance.timelock).code.length == 0,\n            \"InstanceDeployer: timelock already created\"\n        );\n    }"
}