diff --git a/.changeset/real-crews-hide.md b/.changeset/real-crews-hide.md new file mode 100644 index 0000000000..11aecc8d70 --- /dev/null +++ b/.changeset/real-crews-hide.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +We fixed a bug in the deploy script that would cause the deployment to fail if a non-root namespace was used in the config. diff --git a/packages/cli/src/utils/deploy.ts b/packages/cli/src/utils/deploy.ts index b3eb22ab02..68f725b8ad 100644 --- a/packages/cli/src/utils/deploy.ts +++ b/packages/cli/src/utils/deploy.ts @@ -23,6 +23,7 @@ import { postDeploy } from "./utils/postDeploy"; import { setInternalFeePerGas } from "./utils/setInternalFeePerGas"; import { toBytes16 } from "./utils/toBytes16"; import { ContractCode } from "./utils/types"; +import { resourceIdToHex } from "@latticexyz/common"; export interface DeployConfig { profile?: string; @@ -151,7 +152,7 @@ export async function deploy( nonce: nonce++, contract: worldContract, func: "registerNamespace", - args: [toBytes16(mudConfig.namespace)], + args: [resourceIdToHex({ type: "namespace", namespace: mudConfig.namespace, name: "" })], }); console.log(chalk.green("Namespace registered")); }