@latticexyz/cli 2.0.8-not-npmignore-cache-5d3a93b8 → 2.0.8-not-npmignore-cache-17f3bce8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mud.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import*as i from"dotenv";i.config();async function l(){let{default:r}=await import("yargs"),{default:o}=await import("chalk"),{hideBin:e}=await import("yargs/helpers"),{logError:s}=await import("./errors-MZURIB7V.js"),{commands:t}=await import("./commands-VJAW6WWR.js");r(e(process.argv)).scriptName("mud").command(t).strict().fail((a,n)=>{console.error(o.red(a)),a.includes("Missing required argument")&&console.log(o.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`)),console.log(""),n!=null&&(s(n),console.log("")),process.exit(1)}).alias({h:"help"}).argv}l();
2
+ import*as i from"dotenv";i.config();async function l(){let{default:r}=await import("yargs"),{default:o}=await import("chalk"),{hideBin:e}=await import("yargs/helpers"),{logError:s}=await import("./errors-MZURIB7V.js"),{commands:t}=await import("./commands-PYQLPHGU.js");r(e(process.argv)).scriptName("mud").command(t).strict().fail((a,n)=>{console.error(o.red(a)),a.includes("Missing required argument")&&console.log(o.yellow(`Run 'pnpm mud ${process.argv[2]} --help' for a list of available and required arguments.`)),console.log(""),n!=null&&(s(n),console.log("")),process.exit(1)}).alias({h:"help"}).argv}l();
3
3
  //# sourceMappingURL=mud.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/cli",
3
- "version": "2.0.8-not-npmignore-cache-5d3a93b8",
3
+ "version": "2.0.8-not-npmignore-cache-17f3bce8",
4
4
  "description": "Command line interface for mud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,17 +44,17 @@
44
44
  "yargs": "^17.7.1",
45
45
  "zod": "^3.21.4",
46
46
  "zod-validation-error": "^1.3.0",
47
- "@latticexyz/abi-ts": "2.0.8-not-npmignore-cache-5d3a93b8",
48
- "@latticexyz/common": "2.0.8-not-npmignore-cache-5d3a93b8",
49
- "@latticexyz/config": "2.0.8-not-npmignore-cache-5d3a93b8",
50
- "@latticexyz/gas-report": "2.0.8-not-npmignore-cache-5d3a93b8",
51
- "@latticexyz/protocol-parser": "2.0.8-not-npmignore-cache-5d3a93b8",
52
- "@latticexyz/schema-type": "2.0.8-not-npmignore-cache-5d3a93b8",
53
- "@latticexyz/services": "2.0.8-not-npmignore-cache-5d3a93b8",
54
- "@latticexyz/store": "2.0.8-not-npmignore-cache-5d3a93b8",
55
- "@latticexyz/utils": "2.0.8-not-npmignore-cache-5d3a93b8",
56
- "@latticexyz/world": "2.0.8-not-npmignore-cache-5d3a93b8",
57
- "@latticexyz/world-modules": "2.0.8-not-npmignore-cache-5d3a93b8"
47
+ "@latticexyz/abi-ts": "2.0.8-not-npmignore-cache-17f3bce8",
48
+ "@latticexyz/common": "2.0.8-not-npmignore-cache-17f3bce8",
49
+ "@latticexyz/config": "2.0.8-not-npmignore-cache-17f3bce8",
50
+ "@latticexyz/gas-report": "2.0.8-not-npmignore-cache-17f3bce8",
51
+ "@latticexyz/protocol-parser": "2.0.8-not-npmignore-cache-17f3bce8",
52
+ "@latticexyz/schema-type": "2.0.8-not-npmignore-cache-17f3bce8",
53
+ "@latticexyz/services": "2.0.8-not-npmignore-cache-17f3bce8",
54
+ "@latticexyz/store": "2.0.8-not-npmignore-cache-17f3bce8",
55
+ "@latticexyz/utils": "2.0.8-not-npmignore-cache-17f3bce8",
56
+ "@latticexyz/world": "2.0.8-not-npmignore-cache-17f3bce8",
57
+ "@latticexyz/world-modules": "2.0.8-not-npmignore-cache-17f3bce8"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/debug": "^4.1.7",
package/src/verify.ts CHANGED
@@ -7,6 +7,7 @@ import { getDeployer } from "./deploy/getDeployer";
7
7
  import { MUDError } from "@latticexyz/common/errors";
8
8
  import { salt } from "./deploy/common";
9
9
  import { getStorageAt } from "viem/actions";
10
+ import { execa } from "execa";
10
11
 
11
12
  type VerifyOptions = {
12
13
  client: Client<Transport, Chain | undefined>;
@@ -73,94 +74,103 @@ export async function verify({
73
74
  ),
74
75
  );
75
76
 
76
- Object.entries(
77
- usesProxy ? getWorldProxyFactoryContracts(deployerAddress) : getWorldFactoryContracts(deployerAddress),
78
- ).map(([name, { bytecode }]) =>
79
- verifyQueue.add(() =>
80
- verifyContract(
81
- {
82
- name,
83
- rpc,
84
- verifier,
85
- verifierUrl,
86
- address: getCreate2Address({
87
- from: deployerAddress,
88
- bytecode: bytecode,
89
- salt,
90
- }),
91
- },
92
- {
93
- profile: foundryProfile,
94
- cwd: "node_modules/@latticexyz/world",
95
- },
96
- ).catch((error) => {
97
- console.error(`Error verifying world factory contract ${name}:`, error);
98
- }),
99
- ),
100
- );
77
+ // If the verifier is Sourcify, attempt to verify MUD core contracts
78
+ if (verifier === "sourcify") {
79
+ // Install subdependencies so contracts can compile
80
+ await execa("npm", ["install"], {
81
+ cwd: "node_modules/@latticexyz/store",
82
+ });
83
+ await execa("npm", ["install"], {
84
+ cwd: "node_modules/@latticexyz/world",
85
+ });
86
+ await execa("npm", ["install"], {
87
+ cwd: "node_modules/@latticexyz/world-modules",
88
+ });
101
89
 
102
- modules.map(({ name, bytecode }) =>
103
- verifyQueue.add(() =>
104
- verifyContract(
105
- {
106
- name: name,
107
- rpc,
108
- verifier,
109
- verifierUrl,
110
- address: getCreate2Address({
111
- from: deployerAddress,
112
- bytecode: bytecode,
113
- salt,
114
- }),
115
- },
116
- {
117
- profile: foundryProfile,
118
- cwd: "node_modules/@latticexyz/world-modules",
119
- },
120
- ).catch((error) => {
121
- console.error(`Error verifying module contract ${name}:`, error);
122
- }),
123
- ),
124
- );
125
-
126
- // If the world was deployed as a Proxy, verify the proxy and implementation.
127
- if (usesProxy) {
128
- const implementationAddress = sliceHex(implementationStorage, -20);
129
-
130
- verifyQueue.add(() =>
131
- verifyContract(
132
- { name: "WorldProxy", rpc, verifier, verifierUrl, address: worldAddress },
133
- {
134
- profile: foundryProfile,
135
- cwd: "node_modules/@latticexyz/world",
136
- },
137
- ).catch((error) => {
138
- console.error(`Error verifying WorldProxy contract:`, error);
139
- }),
90
+ Object.entries(
91
+ usesProxy ? getWorldProxyFactoryContracts(deployerAddress) : getWorldFactoryContracts(deployerAddress),
92
+ ).map(([name, { bytecode }]) =>
93
+ verifyQueue.add(() =>
94
+ verifyContract(
95
+ {
96
+ name,
97
+ rpc,
98
+ verifier,
99
+ verifierUrl,
100
+ address: getCreate2Address({
101
+ from: deployerAddress,
102
+ bytecode: bytecode,
103
+ salt,
104
+ }),
105
+ },
106
+ {
107
+ cwd: "node_modules/@latticexyz/world",
108
+ },
109
+ ).catch((error) => {
110
+ console.error(`Error verifying world factory contract ${name}:`, error);
111
+ }),
112
+ ),
140
113
  );
141
114
 
142
- verifyQueue.add(() =>
143
- verifyContract(
144
- { name: "World", rpc, verifier, verifierUrl, address: implementationAddress },
145
- {
146
- profile: foundryProfile,
147
- cwd: "node_modules/@latticexyz/world",
148
- },
149
- ).catch((error) => {
150
- console.error(`Error verifying World contract:`, error);
151
- }),
152
- );
153
- } else {
154
- verifyQueue.add(() =>
155
- verifyContract(
156
- { name: "World", rpc, verifier, verifierUrl, address: worldAddress },
157
- {
158
- profile: foundryProfile,
159
- cwd: "node_modules/@latticexyz/world",
160
- },
161
- ).catch((error) => {
162
- console.error(`Error verifying World contract:`, error);
163
- }),
115
+ modules.map(({ name, bytecode }) =>
116
+ verifyQueue.add(() =>
117
+ verifyContract(
118
+ {
119
+ name: name,
120
+ rpc,
121
+ verifier,
122
+ verifierUrl,
123
+ address: getCreate2Address({
124
+ from: deployerAddress,
125
+ bytecode: bytecode,
126
+ salt,
127
+ }),
128
+ },
129
+ {
130
+ cwd: "node_modules/@latticexyz/world-modules",
131
+ },
132
+ ).catch((error) => {
133
+ console.error(`Error verifying module contract ${name}:`, error);
134
+ }),
135
+ ),
164
136
  );
137
+
138
+ // If the world was deployed as a Proxy, verify the proxy and implementation.
139
+ if (usesProxy) {
140
+ const implementationAddress = sliceHex(implementationStorage, -20);
141
+
142
+ verifyQueue.add(() =>
143
+ verifyContract(
144
+ { name: "WorldProxy", rpc, verifier, verifierUrl, address: worldAddress },
145
+ {
146
+ cwd: "node_modules/@latticexyz/world",
147
+ },
148
+ ).catch((error) => {
149
+ console.error(`Error verifying WorldProxy contract:`, error);
150
+ }),
151
+ );
152
+
153
+ verifyQueue.add(() =>
154
+ verifyContract(
155
+ { name: "World", rpc, verifier, verifierUrl, address: implementationAddress },
156
+ {
157
+ cwd: "node_modules/@latticexyz/world",
158
+ },
159
+ ).catch((error) => {
160
+ console.error(`Error verifying World contract:`, error);
161
+ }),
162
+ );
163
+ } else {
164
+ verifyQueue.add(() =>
165
+ verifyContract(
166
+ { name: "World", rpc, verifier, verifierUrl, address: worldAddress },
167
+ {
168
+ cwd: "node_modules/@latticexyz/world",
169
+ },
170
+ ).catch((error) => {
171
+ console.error(`Error verifying World contract:`, error);
172
+ }),
173
+ );
174
+ }
165
175
  }
166
176
  }