@latticexyz/world 2.2.22-d83a0fd5283b7bea7e9a5372ea3c45ab9aea350f → 2.2.22-fb2745a7b2d4735a67adffa69e70ec7d1085f4da

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/node.js CHANGED
@@ -273,9 +273,6 @@ function renderSystemLibrary(options) {
273
273
  } = options;
274
274
  const functions = functionsInput.map((func) => ({
275
275
  ...func,
276
- // Format parameters (add auxiliary argument names, replace calldata location)
277
- parameters: formatParams(func.parameters),
278
- // Remove `payable` from stateMutability for library functions
279
276
  stateMutability: func.stateMutability.replace("payable", "")
280
277
  }));
281
278
  const imports = [
@@ -397,7 +394,7 @@ function renderErrors(errors) {
397
394
  }
398
395
  function renderUserTypeFunction(contractFunction, userTypeName) {
399
396
  const { name, parameters, stateMutability, returnParameters } = contractFunction;
400
- const args = [`${userTypeName} self`, ...parameters];
397
+ const args = [`${userTypeName} self`, ...parameters].map((arg) => arg.replace(/ calldata /, " memory "));
401
398
  const functionSignature = `
402
399
  function ${name}(
403
400
  ${renderArguments2(args)}
@@ -414,7 +411,7 @@ function renderUserTypeFunction(contractFunction, userTypeName) {
414
411
  }
415
412
  function renderCallWrapperFunction(contractFunction, callingFromRootSystemErrorName) {
416
413
  const { name, parameters, stateMutability, returnParameters } = contractFunction;
417
- const args = [`CallWrapper memory self`, ...parameters];
414
+ const args = [`CallWrapper memory self`, ...parameters].map((arg) => arg.replace(/ calldata /, " memory "));
418
415
  const functionSignature = `
419
416
  function ${name}(
420
417
  ${renderArguments2(args)}
@@ -458,7 +455,7 @@ function renderRootCallWrapperFunction(contractFunction, namespace) {
458
455
  if (namespace === "" && stateMutability != "") {
459
456
  return "";
460
457
  }
461
- const args = ["RootCallWrapper memory self", ...parameters];
458
+ const args = ["RootCallWrapper memory self", ...parameters].map((arg) => arg.replace(/ calldata /, " memory "));
462
459
  const functionSignature = `
463
460
  function ${name}(
464
461
  ${renderArguments2(args)}
@@ -519,14 +516,6 @@ function renderReturnParameters2(returnParameters) {
519
516
  if (returnParameters.length == 0) return "";
520
517
  return `returns (${renderArguments2(returnParameters)})`;
521
518
  }
522
- function formatParams(params) {
523
- let auxCount = 0;
524
- return params.map((arg) => arg.replace(/ calldata /, " memory ")).map((arg) => {
525
- const items = arg.split(" ");
526
- const needsAux = items.length === 1 || items.length === 2 && items[1] === "memory";
527
- return needsAux ? `${arg} __aux${auxCount++}` : arg;
528
- });
529
- }
530
519
 
531
520
  // ts/node/render-solidity/renderWorldInterface.ts
532
521
  import { renderArguments as renderArguments3, renderedSolidityHeader as renderedSolidityHeader3, renderImports as renderImports3 } from "@latticexyz/common/codegen";