import { Contract , ContractFactory } from "ethers" ; import { ethers } from "hardhat" ; async function main ( ) { const Registry = await ethers . getContractFactory ( "Registry" ) ; const registry = await Registry . deploy ( ) ; await registry . deployed ( ) ; const Factory = await ethers . getContractFactory ( "SafeGuardFactory" ) ; const factory = await Factory . deploy ( registry . address ) ; await factory . deployed ( ) ; console . log ( "Registry and Factory deployed to: " , { registry : registry . address , factory : factory . address , } ) ; } main ( ) . then ( ( ) => process . exit ( 0 ) ) . catch ( ( error ) => { console . error ( error ) ; process . exit ( 1 ) ; } ) ;