{
    "Function": "init",
    "File": "contracts/util/Proxy.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IUpgradable"
    ],
    "Internal Calls": [
        "abi.encodeWithSelector()",
        "revert SetupFailed()",
        "revert AlreadyInitialized()",
        "revert NotOwner()",
        "implementation",
        "contractId",
        "revert InvalidImplementation()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [
        "delegatecall"
    ],
    "Code": "function init(\n        address implementationAddress,\n        address newOwner,\n        bytes memory params\n    ) external {\n        address owner;\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            owner := sload(_OWNER_SLOT)\n        }\n        if (msg.sender != owner) revert NotOwner();\n        if (implementation() != address(0)) revert AlreadyInitialized();\n        if (IUpgradable(implementationAddress).contractId() != contractId()) revert InvalidImplementation();\n\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            sstore(_IMPLEMENTATION_SLOT, implementationAddress)\n            sstore(_OWNER_SLOT, newOwner)\n        }\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, ) = implementationAddress.delegatecall(\n            //0x9ded06df is the setup selector.\n            abi.encodeWithSelector(0x9ded06df, params)\n        );\n        if (!success) revert SetupFailed();\n    }"
}