```\n// SPDX-License-Identifier: Unlicensed\npragma solidity ^0.8.0;\n\nimport "./MiniContract.sol";\nimport "./CREATE3.sol";\n\ncontract DeployTest {\n    address public deployedAddress;\n    event Deployed(address);\n    \n    function generateContract() public returns(address, address) {\n        bytes32 salt = keccak256("SALT");\n\n        address preCalculatedAddress = CREATE3.getDeployed(salt);\n\n        // check if the contract has already been deployed by checking code size of address\n        bytes memory creationCode = abi.encodePacked(type(MiniContract).creationCode, abi.encode(777));\n\n        // Use CREATE3 to deploy the anchor contract\n        address deployed = CREATE3.deploy(salt, creationCode, 0);\n        return (preCalculatedAddress, deployed);\n    }\n}\n```\n