diff --git a/packages/cli/src/deploy/ensureWorldFactory.ts b/packages/cli/src/deploy/ensureWorldFactory.ts index 8d256b6323..17586a9da1 100644 --- a/packages/cli/src/deploy/ensureWorldFactory.ts +++ b/packages/cli/src/deploy/ensureWorldFactory.ts @@ -8,16 +8,27 @@ export async function ensureWorldFactory( deployerAddress: Hex, withWorldProxy?: boolean, ): Promise
{ - const worldFactoryContracts = withWorldProxy - ? getWorldProxyFactoryContracts(deployerAddress) - : getWorldFactoryContracts(deployerAddress); + if (!withWorldProxy) { + const contracts = getWorldFactoryContracts(deployerAddress); - // WorldFactory constructor doesn't call InitModule, only sets its address, so we can do these in parallel since the address is deterministic - await ensureContractsDeployed({ - client, - deployerAddress, - contracts: Object.values(worldFactoryContracts), - }); + // WorldFactory constructor doesn't call InitModule, only sets its address, so we can do these in parallel since the address is deterministic + await ensureContractsDeployed({ + client, + deployerAddress, + contracts: Object.values(contracts), + }); - return worldFactoryContracts["WorldFactory"].address; + return contracts.WorldFactory.address; + } else { + const contracts = getWorldProxyFactoryContracts(deployerAddress); + + // WorldFactory constructor doesn't call InitModule, only sets its address, so we can do these in parallel since the address is deterministic + await ensureContractsDeployed({ + client, + deployerAddress, + contracts: Object.values(contracts), + }); + + return contracts.WorldProxyFactory.address; + } } diff --git a/packages/cli/src/deploy/getWorldProxyFactoryContracts.ts b/packages/cli/src/deploy/getWorldProxyFactoryContracts.ts index 95dd8579cf..af292d2141 100644 --- a/packages/cli/src/deploy/getWorldProxyFactoryContracts.ts +++ b/packages/cli/src/deploy/getWorldProxyFactoryContracts.ts @@ -17,7 +17,7 @@ export function getWorldProxyFactoryContracts(deployerAddress: Hex) { return { ...worldContracts, - WorldFactory: { + WorldProxyFactory: { bytecode: worldProxyFactoryBytecode, deployedBytecodeSize: worldProxyFactoryDeployedBytecodeSize, label: "world proxy factory",