Skip to content

Commit 8cdc57b

Browse files
authored
fix(cli): remove payable modifier from library functions (#3629)
1 parent 303714d commit 8cdc57b

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/world": patch
3+
---
4+
5+
System libraries are no longer generated with `payable` keyword.

packages/world/ts/node/render-solidity/renderSystemLibrary.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ export function renderSystemLibrary(options: RenderSystemLibraryOptions) {
1616
systemName,
1717
namespace,
1818
resourceId,
19-
functions,
19+
functions: functionsInput,
2020
errors: systemErrors,
2121
worldImportPath,
2222
storeImportPath,
2323
} = options;
2424

25+
// Remove `payable` from stateMutability for library functions
26+
const functions = functionsInput.map((func) => ({
27+
...func,
28+
stateMutability: func.stateMutability.replace("payable", ""),
29+
}));
30+
2531
// Add required imports, if they are already included they will get removed in renderImports
2632
const imports = [
2733
...systemImports,

0 commit comments

Comments
 (0)