From 6d2d6ddd2df4ca0ae86e997ba84b2cc12e64f910 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Fri, 29 May 2026 14:07:28 +0100 Subject: [PATCH 1/2] fix(deploy): record mod lineage on-chain The modded_from argument to the registry publish() call was read from options.moddedFrom, an option no caller sets, so the contract always received "" and never recorded a lineage edge or awarded the source owner the "your app is modded" XP. Route the value dot mod captures in dot.json (via readModdedFrom) into the publish call instead, with the explicit option kept as a fallback. Adds a test that writes a real dot.json and asserts the captured source domain reaches publish(). --- .changeset/modded-from-onchain.md | 10 ++++++++++ src/utils/deploy/playground.test.ts | 27 +++++++++++++++++++++++++++ src/utils/deploy/playground.ts | 14 ++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .changeset/modded-from-onchain.md diff --git a/.changeset/modded-from-onchain.md b/.changeset/modded-from-onchain.md new file mode 100644 index 0000000..31ef8f3 --- /dev/null +++ b/.changeset/modded-from-onchain.md @@ -0,0 +1,10 @@ +--- +"playground-cli": patch +--- + +Fix `dot deploy --playground` not recording mod lineage on-chain. The +`modded_from` argument to the registry `publish()` call was read from a +never-set option instead of the `moddedFrom` value `dot mod` captures in +`dot.json`, so the contract always received `""` and never awarded the source +owner the "your app is modded" XP. The deploy now passes the captured source +domain through to the registry. diff --git a/src/utils/deploy/playground.test.ts b/src/utils/deploy/playground.test.ts index 8d7261a..0f2f779 100644 --- a/src/utils/deploy/playground.test.ts +++ b/src/utils/deploy/playground.test.ts @@ -563,6 +563,33 @@ describe("publishToPlayground", () => { ); }); + it("forwards moddedFrom captured by `dot mod` in dot.json to registry.publish", async () => { + const dir = makeTmpDir(); + try { + writeFileSync(join(dir, "dot.json"), JSON.stringify({ moddedFrom: "original.dot" })); + await publishToPlayground({ + domain: "my-mod", + publishSigner: fakeSigner, + repositoryUrl: null, + cwd: dir, + }); + expect(publishTx).toHaveBeenCalledWith( + "my-mod.dot", + "bafymeta", + 1, + { + isSome: false, + value: "0x0000000000000000000000000000000000000000", + }, + "original.dot", + false, + false, + ); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + }); + it("retries up to 3 times on registry publish failure", async () => { publishTx.mockImplementationOnce(async () => { throw new Error("nonce race"); diff --git a/src/utils/deploy/playground.ts b/src/utils/deploy/playground.ts index 36153e8..60fecb3 100644 --- a/src/utils/deploy/playground.ts +++ b/src/utils/deploy/playground.ts @@ -93,8 +93,9 @@ export interface PublishToPlaygroundOptions { /** * Domain (`