@latticexyz/cli 2.0.7-main-7dfb82f7 → 2.0.8-account-kit-38709026
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.
@@ -6,7 +6,7 @@ gracefully shutting down from SIGINT (Crtl-C)`),t.kill(),process.exit()}),await
|
|
6
6
|
|
7
7
|
We recommend running your chain's node with \`--rpc.allow-unprotected-txs\` to enable determinstic deployments.
|
8
8
|
`),m("deploying CREATE2 deployer"),je(e,{chain:e.chain??null,data:`0x${T.creationCode}`});throw a}),i=await Me(e,{hash:s});if(!i.contractAddress)throw new Error("Deploy receipt did not have contract address, was the deployer not deployed?");return i.contractAddress!==ye&&console.warn(`
|
9
|
-
\u26A0\uFE0F CREATE2 deployer created at ${i.contractAddress} does not match the CREATE2 determinstic deployer we expected (${ye})`),i.contractAddress}import{waitForTransactionReceipt as nr}from"viem/actions";import{waitForTransactionReceipt as Ut}from"viem/actions";import{concatHex as Ht,getCreate2Address as Ft}from"viem";import{getBytecode as $t}from"viem/actions";import{padHex as kt}from"viem";import It from"@latticexyz/store/mud.config";import Pt from"@latticexyz/world/mud.config";import Ot from"@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json"assert{type:"json"};import Bt from"@latticexyz/world-modules/out/IModule.sol/IModule.abi.json"assert{type:"json"};import{resourceToHex as At}from"@latticexyz/common";import{resolveUserTypes as He}from"@latticexyz/store/internal";function z(e){let o={...e.userTypes,...Object.fromEntries(Object.entries(e.enums).map(([n])=>[n,{internalType:"uint8"}]))};return Object.fromEntries(Object.entries(e.tables).map(([n,t])=>[`${e.namespace}_${n}`,{namespace:e.namespace,name:t.name,tableId:At({type:t.offchainOnly?"offchainTable":"table",namespace:e.namespace,name:t.name}),keySchema:He(t.keySchema,o),valueSchema:He(t.valueSchema,o)}]))}import{helloStoreEvent as Wt}from"@latticexyz/store";import{helloWorldEvent as jt}from"@latticexyz/world";import{storeToV1 as Mt}from"@latticexyz/store/config/v2";import{worldToV1 as Rt}from"@latticexyz/world/config/v2";var C=kt("0x",{size:32}),N=parseInt("6000",16),H=z(Mt(It)),A=z(Rt(Pt)),Q=[Wt,jt],v=[...Ot,...Bt],Fe=["2.0.0","2.0.1"],$e=["2.0.0","2.0.1"];import{sendTransaction as Et}from"@latticexyz/common";import zt from"p-retry";import{wait as Nt}from"@latticexyz/common/utils";async function Ee({client:e,deployerAddress:o,bytecode:n,deployedBytecodeSize:t,label:r="contract"}){if(n.includes("__$"))throw new Error(`Found unlinked public library in ${r} bytecode`);let s=Ft({from:o,salt:C,bytecode:n});return await $t(e,{address:s,blockTag:"pending"})?(m("found",r,"at",s),[]):(t>N?console.warn(`
|
9
|
+
\u26A0\uFE0F CREATE2 deployer created at ${i.contractAddress} does not match the CREATE2 determinstic deployer we expected (${ye})`),i.contractAddress}import{waitForTransactionReceipt as nr}from"viem/actions";import{waitForTransactionReceipt as Ut}from"viem/actions";import{concatHex as Ht,getCreate2Address as Ft}from"viem";import{getBytecode as $t}from"viem/actions";import{padHex as kt}from"viem";import It from"@latticexyz/store/mud.config";import Pt from"@latticexyz/world/mud.config";import Ot from"@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json"assert{type:"json"};import Bt from"@latticexyz/world-modules/out/IModule.sol/IModule.abi.json"assert{type:"json"};import{resourceToHex as At}from"@latticexyz/common";import{resolveUserTypes as He}from"@latticexyz/store/internal";function z(e){let o={...e.userTypes,...Object.fromEntries(Object.entries(e.enums).map(([n])=>[n,{internalType:"uint8"}]))};return Object.fromEntries(Object.entries(e.tables).map(([n,t])=>[`${e.namespace}_${n}`,{namespace:e.namespace,name:t.name,tableId:At({type:t.offchainOnly?"offchainTable":"table",namespace:e.namespace,name:t.name}),keySchema:He(t.keySchema,o),valueSchema:He(t.valueSchema,o)}]))}import{helloStoreEvent as Wt}from"@latticexyz/store";import{helloWorldEvent as jt}from"@latticexyz/world";import{storeToV1 as Mt}from"@latticexyz/store/config/v2";import{worldToV1 as Rt}from"@latticexyz/world/config/v2";var C=kt("0x",{size:32}),N=parseInt("6000",16),H=z(Mt(It)),A=z(Rt(Pt)),Q=[Wt,jt],v=[...Ot,...Bt],Fe=["2.0.0","2.0.1","2.0.2"],$e=["2.0.0","2.0.1","2.0.2"];import{sendTransaction as Et}from"@latticexyz/common";import zt from"p-retry";import{wait as Nt}from"@latticexyz/common/utils";async function Ee({client:e,deployerAddress:o,bytecode:n,deployedBytecodeSize:t,label:r="contract"}){if(n.includes("__$"))throw new Error(`Found unlinked public library in ${r} bytecode`);let s=Ft({from:o,salt:C,bytecode:n});return await $t(e,{address:s,blockTag:"pending"})?(m("found",r,"at",s),[]):(t>N?console.warn(`
|
10
10
|
Bytecode for ${r} (${t} bytes) is over the contract size limit (${N} bytes). Run \`forge build --sizes\` for more info.
|
11
11
|
`):t>N*.95&&console.warn(`
|
12
12
|
Bytecode for ${r} (${t} bytes) is almost over the contract size limit (${N} bytes). Run \`forge build --sizes\` for more info.
|
@@ -20,7 +20,7 @@ Resolved config:
|
|
20
20
|
Run 'echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" > .env'
|
21
21
|
in your contracts directory to use the default anvil private key.`);let c=So({config:r,forgeSourceDir:s,forgeOutDir:i}),y=e.awsKmsKeyId??process.env.AWS_KMS_KEY_ID,u=y?await jn({keyId:y}):An(d),g=Dn({transport:vn(a,{batch:e.rpcBatch?{batchSize:100,wait:1e3}:void 0}),account:u});console.log("Deploying from",g.account.address);let b=Date.now(),p=await go({deployerAddress:e.deployerAddress,salt:o,worldAddress:e.worldAddress,client:g,config:c,withWorldProxy:t.deploy.upgradeableWorldImplementation});(e.worldAddress==null||e.alwaysRunPostDeploy)&&await Do(r.postDeployScript,p.address,a,n,e.forgeScriptOptions),console.log(F.green("Deployment completed in",(Date.now()-b)/1e3,"seconds"));let l={worldAddress:p.address,blockNumber:Number(p.deployBlock)};if(e.saveDeployment){let S=await Wn(g),x=xe.join(r.deploysDirectory,S.toString());Sn(x,{recursive:!0}),Se(xe.join(x,"latest.json"),JSON.stringify(l,null,2)),Se(xe.join(x,Date.now()+".json"),JSON.stringify(l,null,2));let D=[1337,31337],f=xn(r.worldsFile)?JSON.parse(Cn(r.worldsFile,"utf-8")):{};f[S]={address:l.worldAddress,blockNumber:D.includes(S)?void 0:l.blockNumber},Se(r.worldsFile,JSON.stringify(f,null,2)),console.log(F.bgGreen(F.whiteBright(`
|
22
22
|
Deployment result (written to ${r.worldsFile} and ${x}):
|
23
|
-
`)))}return console.log(l),p}var Mn={command:"deploy",describe:"Deploy MUD contracts",builder(e){return e.options(I)},async handler(e){try{await $(e)}catch(o){K(o),process.exit(1)}process.exit(0)}},To=Mn;import{loadConfig as Rn}from"@latticexyz/config/node";import{worldgen as Hn}from"@latticexyz/world/node";import{getSrcDirectory as Fn}from"@latticexyz/common/foundry";import Ao from"path";import{rmSync as $n}from"fs";var En={command:"worldgen",describe:"Autogenerate interfaces for Systems and World based on existing contracts and the config file",builder(e){return e.options({configPath:{type:"string",desc:"Path to the MUD config file"},clean:{type:"boolean",desc:"Clear the worldgen directory before generating new interfaces (defaults to true)",default:!0}})},async handler(e){await zn(e),process.exit(0)}};async function zn(e){let o=e.srcDir??await Fn(),n=k(o),t=e.config??await Rn(e.configPath),r=Ao.join(o,t.codegen.outputDirectory);e.clean&&$n(Ao.join(r,t.codegen.worldgenDirectory),{recursive:!0,force:!0}),await Hn(t,n,r)}var ko=En;import _ from"chalk";import{readFileSync as _n,writeFileSync as Kn}from"fs";import De from"path";import{MUDError as E}from"@latticexyz/common/errors";var Io={name:"@latticexyz/cli",version:"2.0.
|
23
|
+
`)))}return console.log(l),p}var Mn={command:"deploy",describe:"Deploy MUD contracts",builder(e){return e.options(I)},async handler(e){try{await $(e)}catch(o){K(o),process.exit(1)}process.exit(0)}},To=Mn;import{loadConfig as Rn}from"@latticexyz/config/node";import{worldgen as Hn}from"@latticexyz/world/node";import{getSrcDirectory as Fn}from"@latticexyz/common/foundry";import Ao from"path";import{rmSync as $n}from"fs";var En={command:"worldgen",describe:"Autogenerate interfaces for Systems and World based on existing contracts and the config file",builder(e){return e.options({configPath:{type:"string",desc:"Path to the MUD config file"},clean:{type:"boolean",desc:"Clear the worldgen directory before generating new interfaces (defaults to true)",default:!0}})},async handler(e){await zn(e),process.exit(0)}};async function zn(e){let o=e.srcDir??await Fn(),n=k(o),t=e.config??await Rn(e.configPath),r=Ao.join(o,t.codegen.outputDirectory);e.clean&&$n(Ao.join(r,t.codegen.worldgenDirectory),{recursive:!0,force:!0}),await Hn(t,n,r)}var ko=En;import _ from"chalk";import{readFileSync as _n,writeFileSync as Kn}from"fs";import De from"path";import{MUDError as E}from"@latticexyz/common/errors";var Io={name:"@latticexyz/cli",version:"2.0.7",description:"Command line interface for mud",repository:{type:"git",url:"https://github.com/latticexyz/mud.git",directory:"packages/cli"},license:"MIT",type:"module",exports:{".":"./dist/index.js"},types:"src/index.ts",bin:{mud:"./dist/mud.js"},scripts:{build:"pnpm run build:js && pnpm run build:test-tables","build:js":"tsup && chmod +x ./dist/mud.js","build:test-tables":"tsx ./scripts/generate-test-tables.ts",clean:"pnpm run clean:js && pnpm run clean:test-tables","clean:js":"rimraf dist","clean:test-tables":"rimraf src/codegen",dev:"tsup --watch",lint:"eslint . --ext .ts",prepare:"mkdir -p ./dist && touch ./dist/mud.js",test:"tsc --noEmit && forge test","test:ci":"pnpm run test"},dependencies:{"@aws-sdk/client-kms":"^3.556.0","@ethersproject/abi":"^5.7.0","@ethersproject/providers":"^5.7.2","@improbable-eng/grpc-web":"^0.15.0","@improbable-eng/grpc-web-node-http-transport":"^0.15.0","@latticexyz/abi-ts":"workspace:*","@latticexyz/common":"workspace:*","@latticexyz/config":"workspace:*","@latticexyz/gas-report":"workspace:*","@latticexyz/protocol-parser":"workspace:*","@latticexyz/schema-type":"workspace:*","@latticexyz/services":"workspace:*","@latticexyz/store":"workspace:*","@latticexyz/utils":"workspace:*","@latticexyz/world":"workspace:*","@latticexyz/world-modules":"workspace:*","asn1.js":"^5.4.1",chalk:"^5.0.1",chokidar:"^3.5.3",debug:"^4.3.4",dotenv:"^16.0.3",ejs:"^3.1.8",ethers:"^5.7.2",execa:"^7.0.0",glob:"^8.0.3","nice-grpc-web":"^2.0.1",openurl:"^1.1.1","p-queue":"^7.4.1","p-retry":"^5.1.2",path:"^0.12.7",rxjs:"7.5.5","throttle-debounce":"^5.0.0",toposort:"^2.0.2",typescript:"5.4.2",viem:"2.9.20",yargs:"^17.7.1",zod:"^3.21.4","zod-validation-error":"^1.3.0"},devDependencies:{"@types/debug":"^4.1.7","@types/ejs":"^3.1.1","@types/glob":"^7.2.0","@types/node":"^18.15.11","@types/openurl":"^1.0.0","@types/throttle-debounce":"^5.0.0","@types/toposort":"^2.0.6","@types/yargs":"^17.0.10","ds-test":"https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0","forge-std":"https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",tsup:"^6.7.0",tsx:"^3.12.6",vitest:"0.34.6"}};import Jn from"glob";import{ZodError as Un,z as Po}from"zod";var Ln=Po.object({MUD_PACKAGES:Po.string().transform(e=>JSON.parse(e))});function Vn(){try{return Ln.parse({MUD_PACKAGES:'{"@latticexyz/abi-ts":{"localPath":"packages/abi-ts"},"@latticexyz/account-kit":{"localPath":"packages/account-kit"},"@latticexyz/block-logs-stream":{"localPath":"packages/block-logs-stream"},"@latticexyz/cli":{"localPath":"packages/cli"},"@latticexyz/common":{"localPath":"packages/common"},"@latticexyz/config":{"localPath":"packages/config"},"create-mud":{"localPath":"packages/create-mud"},"@latticexyz/dev-tools":{"localPath":"packages/dev-tools"},"@latticexyz/faucet":{"localPath":"packages/faucet"},"@latticexyz/gas-report":{"localPath":"packages/gas-report"},"@latticexyz/gas-tank":{"localPath":"packages/gas-tank"},"@latticexyz/protocol-parser":{"localPath":"packages/protocol-parser"},"@latticexyz/query":{"localPath":"packages/query"},"@latticexyz/react":{"localPath":"packages/react"},"@latticexyz/recs":{"localPath":"packages/recs"},"@latticexyz/schema-type":{"localPath":"packages/schema-type"},"@latticexyz/services":{"localPath":"packages/services"},"solhint-config-mud":{"localPath":"packages/solhint-config-mud"},"solhint-plugin-mud":{"localPath":"packages/solhint-plugin-mud"},"@latticexyz/store-indexer":{"localPath":"packages/store-indexer"},"@latticexyz/store-sync":{"localPath":"packages/store-sync"},"@latticexyz/store":{"localPath":"packages/store"},"@latticexyz/utils":{"localPath":"packages/utils"},"@latticexyz/world-modules":{"localPath":"packages/world-modules"},"@latticexyz/world":{"localPath":"packages/world"}}'})}catch(e){if(e instanceof Un){let{...o}=e.format();console.error(`
|
24
24
|
Missing or invalid environment variables:
|
25
25
|
|
26
26
|
${Object.keys(o).join(`
|
@@ -35,4 +35,4 @@ Waiting for file changes\u2026
|
|
35
35
|
`))}}),Bs(Ws)).subscribe()}},Eo=Ms;import{getCreate2Address as ve,sliceHex as Hs,zeroHash as Fs}from"viem";import{forge as Rs}from"@latticexyz/common/foundry";async function R(e,o){let n=["verify-contract",e.address,e.name,"--rpc-url",e.rpc];e.verifier&&n.push("--verifier",e.verifier),e.verifierUrl&&n.push("--verifier-url",e.verifierUrl),await Rs(n,o)}import $s from"p-queue";import{MUDError as Es}from"@latticexyz/common/errors";import{getStorageAt as zs}from"viem/actions";var Ns="0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";async function zo({client:e,rpc:o,foundryProfile:n=process.env.FOUNDRY_PROFILE,systems:t,modules:r,worldAddress:s,deployerAddress:i,verifier:a,verifierUrl:d}){let c=i??await G(e);if(!c)throw new Es("No deployer");let y=await zs(e,{address:s,slot:Ns}),u=y&&y!==Fs,g=new $s({concurrency:1});if(t.map(({name:b,bytecode:p})=>g.add(()=>R({name:b,rpc:o,verifier:a,verifierUrl:d,address:ve({from:c,bytecode:p,salt:C})},{profile:n}).catch(l=>{console.error(`Error verifying system contract ${b}:`,l)}))),Object.entries(u?ee(c):X(c)).map(([b,{bytecode:p}])=>g.add(()=>R({name:b,rpc:o,verifier:a,verifierUrl:d,address:ve({from:c,bytecode:p,salt:C})},{profile:n,cwd:"node_modules/@latticexyz/world"}).catch(l=>{console.error(`Error verifying world factory contract ${b}:`,l)}))),r.map(({name:b,bytecode:p})=>g.add(()=>R({name:b,rpc:o,verifier:a,verifierUrl:d,address:ve({from:c,bytecode:p,salt:C})},{profile:n,cwd:"node_modules/@latticexyz/world-modules"}).catch(l=>{console.error(`Error verifying module contract ${b}:`,l)}))),u){let b=Hs(y,-20);g.add(()=>R({name:"WorldProxy",rpc:o,verifier:a,verifierUrl:d,address:s},{profile:n,cwd:"node_modules/@latticexyz/world"}).catch(p=>{console.error("Error verifying WorldProxy contract:",p)})),g.add(()=>R({name:"World",rpc:o,verifier:a,verifierUrl:d,address:b},{profile:n,cwd:"node_modules/@latticexyz/world"}).catch(p=>{console.error("Error verifying World contract:",p)}))}else g.add(()=>R({name:"World",rpc:o,verifier:a,verifierUrl:d,address:s},{profile:n,cwd:"node_modules/@latticexyz/world"}).catch(b=>{console.error("Error verifying World contract:",b)}))}import{loadConfig as Us}from"@latticexyz/config/node";import{resolveWorldConfig as Ls}from"@latticexyz/world/internal";import{worldToV1 as Vs}from"@latticexyz/world/config/v2";import{getOutDirectory as _s,getRpcUrl as Ks,getSrcDirectory as Js}from"@latticexyz/common/foundry";import{createWalletClient as qs,http as Ys}from"viem";import No from"chalk";var Gs={deployerAddress:{type:"string",desc:"Deploy using an existing deterministic deployer (https://github.com/Arachnid/deterministic-deployment-proxy)"},worldAddress:{type:"string",required:!0,desc:"Verify an existing World at the given address"},configPath:{type:"string",desc:"Path to the MUD config file"},profile:{type:"string",desc:"The foundry profile to use"},rpc:{type:"string",desc:"The RPC URL to use. Defaults to the RPC url from the local foundry.toml"},rpcBatch:{type:"boolean",desc:"Enable batch processing of RPC requests in viem client (defaults to batch size of 100 and wait of 1s)"},srcDir:{type:"string",desc:"Source directory. Defaults to foundry src directory."},verifier:{type:"string",desc:"The verifier to use"},verifierUrl:{type:"string",desc:"The verification provider."}},Qs={command:"verify",describe:"Verify contracts",builder(e){return e.options(Gs)},async handler(e){let o=e.profile??process.env.FOUNDRY_PROFILE,n=await Us(e.configPath),t=Vs(n),r=e.srcDir??await Js(o),s=await _s(o),i=e.rpc??await Ks(o);console.log(No.bgBlue(No.whiteBright(`
|
36
36
|
Verifying MUD contracts${o?" with profile "+o:""} to RPC ${i}
|
37
37
|
`)));let a=qs({transport:Ys(i,{batch:e.rpcBatch?{batchSize:100,wait:1e3}:void 0})}),d=k(r).map(({basename:g})=>g),c=Ls(t,d),y=Object.keys(c.systems).map(g=>{let b=W(`${g}.sol`,g,s);return{name:g,bytecode:b.bytecode}}),u=t.modules.map(g=>{let b=me.find(p=>p.name===g.name)??W(`${g.name}.sol`,g.name,s);return{name:g.name,bytecode:b.bytecode}});await zo({client:a,rpc:i,foundryProfile:o,systems:y,modules:u,deployerAddress:e.deployerAddress,worldAddress:e.worldAddress,verifier:e.verifier,verifierUrl:e.verifierUrl})}},Uo=Qs;var xy=[Ae,To,ke,Pe,Zs,Oe,Be,ko,Bo,Wo,$o,Eo,Xs,Uo];export{xy as commands};
|
38
|
-
//# sourceMappingURL=commands-
|
38
|
+
//# sourceMappingURL=commands-JFR6CQHL.js.map
|