@latticexyz/world 2.2.20-31870811b975d44f4b5d14ae69fd623914237584 → 2.2.20-b774ab28b3de6cefcbfce5e1bb6fcb68b9374abf
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/{chunk-NVV4GS3R.js → chunk-2W4TKC47.js} +2 -2
- package/dist/{chunk-6KRKTNJ5.js → chunk-SGZK356L.js} +22 -42
- package/dist/chunk-SGZK356L.js.map +1 -0
- package/dist/{chunk-6E2JY6MZ.js → chunk-XSBK355I.js} +1 -2
- package/dist/chunk-XSBK355I.js.map +1 -0
- package/dist/{dynamicResolution-Bul4y_B0.d.ts → dynamicResolution-AmVd5Qtd.d.ts} +5 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal.d.ts +18 -23
- package/dist/internal.js +7 -7
- package/dist/internal.js.map +1 -1
- package/dist/mud.config.d.ts +131 -242
- package/dist/mud.config.js +7 -9
- package/dist/node.d.ts +1 -1
- package/dist/node.js +19 -21
- package/dist/node.js.map +1 -1
- package/dist/{world-NqdA4pfW.d.ts → world-Nl5BmMma.d.ts} +1 -9
- package/out/AccessControl.t.sol/AccessControlTest.json +1 -1
- package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -1
- package/out/AddressArray.sol/AddressArray.json +1 -1
- package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -1
- package/out/Balances.sol/Balances.json +1 -1
- package/out/BatchCall.t.sol/BatchCallTest.json +1 -1
- package/out/BatchCall.t.sol/TestSystem.json +1 -1
- package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -1
- package/out/Bool.sol/Bool.json +1 -1
- package/out/Create2Factory.sol/Create2Factory.json +1 -1
- package/out/DelegationControlMock.sol/DelegationControlMock.json +1 -1
- package/out/EchoSubscriber.sol/EchoSubscriber.json +1 -1
- package/out/Factories.t.sol/FactoriesTest.json +1 -1
- package/out/FunctionSelectors.sol/FunctionSelectors.json +1 -1
- package/out/FunctionSignatures.sol/FunctionSignatures.json +1 -1
- package/out/GasReporter.sol/GasReporter.json +1 -1
- package/out/IAccessManagementSystem.sol/IAccessManagementSystem.json +1 -1
- package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.json +1 -1
- package/out/IBaseWorld.sol/IBaseWorld.json +1 -1
- package/out/IBatchCallSystem.sol/IBatchCallSystem.json +1 -1
- package/out/IModuleInstallationSystem.sol/IModuleInstallationSystem.json +1 -1
- package/out/IRegistrationSystem.sol/IRegistrationSystem.json +1 -1
- package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +1 -1
- package/out/InitModule.sol/InitModule.json +1 -1
- package/out/InitModule.t.sol/InitModuleTest.json +1 -1
- package/out/InitModule.t.sol/WorldMock.json +1 -1
- package/out/InitModuleAddress.sol/InitModuleAddress.json +1 -1
- package/out/InitSystems.t.sol/LimitedCallContextTest.json +1 -1
- package/out/InstalledModules.sol/InstalledModules.json +1 -1
- package/out/LimitedCallContext.sol/LimitedCallContext.json +1 -1
- package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.json +1 -1
- package/out/MudTest.t.sol/MudTest.json +1 -1
- package/out/NamespaceDelegationControl.sol/NamespaceDelegationControl.json +1 -1
- package/out/NamespaceOwner.sol/NamespaceOwner.json +1 -1
- package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -1
- package/out/ResourceAccess.sol/ResourceAccess.json +1 -1
- package/out/RevertSubscriber.sol/RevertSubscriber.json +1 -1
- package/out/RevertWithBytes.t.sol/RevertWithBytesTest.json +1 -1
- package/out/StdError.sol/stdError.json +1 -1
- package/out/StoreMock.sol/StoreMock.json +1 -1
- package/out/StoreRead.sol/StoreRead.json +1 -1
- package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.json +1 -1
- package/out/System.sol/System.json +1 -1
- package/out/System.t.sol/SystemTest.json +1 -1
- package/out/System.t.sol/TestSystem.json +1 -1
- package/out/SystemHook.t.sol/SystemHookTest.json +1 -1
- package/out/SystemHooks.sol/SystemHooks.json +1 -1
- package/out/SystemRegistry.sol/SystemRegistry.json +1 -1
- package/out/Systems.sol/Systems.json +1 -1
- package/out/TwoFields.sol/TwoFields.json +1 -1
- package/out/UserDelegationControl.sol/UserDelegationControl.json +1 -1
- package/out/Utils.t.sol/UtilsTest.json +1 -1
- package/out/Utils.t.sol/UtilsTestSystem.json +1 -1
- package/out/World.sol/World.json +1 -1
- package/out/World.t.sol/EchoSystemHook.json +1 -1
- package/out/World.t.sol/IWorldTestSystem.json +1 -1
- package/out/World.t.sol/PayableFallbackSystem.json +1 -1
- package/out/World.t.sol/RevertSystemHook.json +1 -1
- package/out/World.t.sol/WorldTest.json +1 -1
- package/out/World.t.sol/WorldTestSystem.json +1 -1
- package/out/WorldBalance.t.sol/WorldBalanceTest.json +1 -1
- package/out/WorldBalance.t.sol/WorldBalanceTestSystem.json +1 -1
- package/out/WorldContext.t.sol/TestContextConsumer.json +1 -1
- package/out/WorldContext.t.sol/WorldContextTest.json +1 -1
- package/out/WorldDynamicUpdate.t.sol/UpdateInDynamicFieldTest.json +1 -1
- package/out/WorldFactory.sol/WorldFactory.json +1 -1
- package/out/WorldProxy.sol/WorldProxy.json +1 -1
- package/out/WorldProxy.t.sol/WorldProxyTest.json +1 -1
- package/out/WorldProxyFactory.sol/WorldProxyFactory.json +1 -1
- package/out/WorldProxyFactory.t.sol/WorldProxyFactoryTest.json +1 -1
- package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.json +1 -1
- package/out/WorldResourceId.t.sol/WorldResourceIdTest.json +1 -1
- package/out/build-info/{6366a746548e984842b93ef762b76b99.json → 4a78a1cea15b250410c6bac766ef5562.json} +1 -1
- package/out/test.sol/DSTest.json +1 -1
- package/package.json +9 -9
- package/src/modules/init/implementations/ModuleInstallationSystem.sol +1 -1
- package/src/modules/init/implementations/StoreRegistrationSystem.sol +1 -2
- package/src/modules/init/implementations/WorldRegistrationSystem.sol +1 -1
- package/dist/chunk-6E2JY6MZ.js.map +0 -1
- package/dist/chunk-6KRKTNJ5.js.map +0 -1
- package/out/AccessManagementSystemLib.sol/AccessManagementSystemLib.abi.json +0 -7
- package/out/AccessManagementSystemLib.sol/AccessManagementSystemLib.abi.json.d.ts +0 -9
- package/out/AccessManagementSystemLib.sol/AccessManagementSystemLib.json +0 -1
- package/out/AccessManagementSystemLib.sol/_grantAccess_ResourceId_address.abi.json +0 -20
- package/out/AccessManagementSystemLib.sol/_grantAccess_ResourceId_address.abi.json.d.ts +0 -22
- package/out/AccessManagementSystemLib.sol/_grantAccess_ResourceId_address.json +0 -1
- package/out/AccessManagementSystemLib.sol/_renounceOwnership_ResourceId.abi.json +0 -15
- package/out/AccessManagementSystemLib.sol/_renounceOwnership_ResourceId.abi.json.d.ts +0 -17
- package/out/AccessManagementSystemLib.sol/_renounceOwnership_ResourceId.json +0 -1
- package/out/AccessManagementSystemLib.sol/_revokeAccess_ResourceId_address.abi.json +0 -20
- package/out/AccessManagementSystemLib.sol/_revokeAccess_ResourceId_address.abi.json.d.ts +0 -22
- package/out/AccessManagementSystemLib.sol/_revokeAccess_ResourceId_address.json +0 -1
- package/out/AccessManagementSystemLib.sol/_transferOwnership_ResourceId_address.abi.json +0 -20
- package/out/AccessManagementSystemLib.sol/_transferOwnership_ResourceId_address.abi.json.d.ts +0 -22
- package/out/AccessManagementSystemLib.sol/_transferOwnership_ResourceId_address.json +0 -1
- package/out/BalanceTransferSystemLib.sol/BalanceTransferSystemLib.abi.json +0 -7
- package/out/BalanceTransferSystemLib.sol/BalanceTransferSystemLib.abi.json.d.ts +0 -9
- package/out/BalanceTransferSystemLib.sol/BalanceTransferSystemLib.json +0 -1
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToAddress_ResourceId_address_uint256.abi.json +0 -25
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToAddress_ResourceId_address_uint256.abi.json.d.ts +0 -27
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToAddress_ResourceId_address_uint256.json +0 -1
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToNamespace_ResourceId_ResourceId_uint256.abi.json +0 -25
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToNamespace_ResourceId_ResourceId_uint256.abi.json.d.ts +0 -27
- package/out/BalanceTransferSystemLib.sol/_transferBalanceToNamespace_ResourceId_ResourceId_uint256.json +0 -1
- package/out/BatchCallSystemLib.sol/BatchCallSystemLib.abi.json +0 -7
- package/out/BatchCallSystemLib.sol/BatchCallSystemLib.abi.json.d.ts +0 -9
- package/out/BatchCallSystemLib.sol/BatchCallSystemLib.json +0 -1
- package/out/BatchCallSystemLib.sol/_batchCallFrom_SystemCallFromDataArray.abi.json +0 -32
- package/out/BatchCallSystemLib.sol/_batchCallFrom_SystemCallFromDataArray.abi.json.d.ts +0 -34
- package/out/BatchCallSystemLib.sol/_batchCallFrom_SystemCallFromDataArray.json +0 -1
- package/out/BatchCallSystemLib.sol/_batchCall_SystemCallDataArray.abi.json +0 -27
- package/out/BatchCallSystemLib.sol/_batchCall_SystemCallDataArray.abi.json.d.ts +0 -29
- package/out/BatchCallSystemLib.sol/_batchCall_SystemCallDataArray.json +0 -1
- package/out/IStoreRegistrationSystem.sol/IStoreRegistrationSystem.abi.json +0 -81
- package/out/IStoreRegistrationSystem.sol/IStoreRegistrationSystem.abi.json.d.ts +0 -83
- package/out/IStoreRegistrationSystem.sol/IStoreRegistrationSystem.json +0 -1
- package/out/ModuleInstallationSystemLib.sol/ModuleInstallationSystemLib.abi.json +0 -7
- package/out/ModuleInstallationSystemLib.sol/ModuleInstallationSystemLib.abi.json.d.ts +0 -9
- package/out/ModuleInstallationSystemLib.sol/ModuleInstallationSystemLib.json +0 -1
- package/out/ModuleInstallationSystemLib.sol/_installModule_IModule_bytes.abi.json +0 -20
- package/out/ModuleInstallationSystemLib.sol/_installModule_IModule_bytes.abi.json.d.ts +0 -22
- package/out/ModuleInstallationSystemLib.sol/_installModule_IModule_bytes.json +0 -1
- package/out/RegistrationSystemLib.sol/RegistrationSystemLib.abi.json +0 -7
- package/out/RegistrationSystemLib.sol/RegistrationSystemLib.abi.json.d.ts +0 -9
- package/out/RegistrationSystemLib.sol/RegistrationSystemLib.json +0 -1
- package/out/StoreRegistrationSystemLib.sol/StoreRegistrationSystemLib.abi.json +0 -7
- package/out/StoreRegistrationSystemLib.sol/StoreRegistrationSystemLib.abi.json.d.ts +0 -9
- package/out/StoreRegistrationSystemLib.sol/StoreRegistrationSystemLib.json +0 -1
- package/out/StoreRegistrationSystemLib.sol/_registerStoreHook_ResourceId_IStoreHook_uint8.abi.json +0 -25
- package/out/StoreRegistrationSystemLib.sol/_registerStoreHook_ResourceId_IStoreHook_uint8.abi.json.d.ts +0 -27
- package/out/StoreRegistrationSystemLib.sol/_registerStoreHook_ResourceId_IStoreHook_uint8.json +0 -1
- package/out/StoreRegistrationSystemLib.sol/_registerTable_ResourceId_FieldLayout_Schema_Schema_stringArray_stringArray.abi.json +0 -40
- package/out/StoreRegistrationSystemLib.sol/_registerTable_ResourceId_FieldLayout_Schema_Schema_stringArray_stringArray.abi.json.d.ts +0 -42
- package/out/StoreRegistrationSystemLib.sol/_registerTable_ResourceId_FieldLayout_Schema_Schema_stringArray_stringArray.json +0 -1
- package/out/StoreRegistrationSystemLib.sol/_unregisterStoreHook_ResourceId_IStoreHook.abi.json +0 -20
- package/out/StoreRegistrationSystemLib.sol/_unregisterStoreHook_ResourceId_IStoreHook.abi.json.d.ts +0 -22
- package/out/StoreRegistrationSystemLib.sol/_unregisterStoreHook_ResourceId_IStoreHook.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/WorldRegistrationSystemLib.abi.json +0 -7
- package/out/WorldRegistrationSystemLib.sol/WorldRegistrationSystemLib.abi.json.d.ts +0 -9
- package/out/WorldRegistrationSystemLib.sol/WorldRegistrationSystemLib.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerDelegation_address_ResourceId_bytes.abi.json +0 -25
- package/out/WorldRegistrationSystemLib.sol/_registerDelegation_address_ResourceId_bytes.abi.json.d.ts +0 -27
- package/out/WorldRegistrationSystemLib.sol/_registerDelegation_address_ResourceId_bytes.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerFunctionSelector_ResourceId_string.abi.json +0 -20
- package/out/WorldRegistrationSystemLib.sol/_registerFunctionSelector_ResourceId_string.abi.json.d.ts +0 -22
- package/out/WorldRegistrationSystemLib.sol/_registerFunctionSelector_ResourceId_string.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerNamespaceDelegation_ResourceId_ResourceId_bytes.abi.json +0 -25
- package/out/WorldRegistrationSystemLib.sol/_registerNamespaceDelegation_ResourceId_ResourceId_bytes.abi.json.d.ts +0 -27
- package/out/WorldRegistrationSystemLib.sol/_registerNamespaceDelegation_ResourceId_ResourceId_bytes.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerNamespace_ResourceId.abi.json +0 -15
- package/out/WorldRegistrationSystemLib.sol/_registerNamespace_ResourceId.abi.json.d.ts +0 -17
- package/out/WorldRegistrationSystemLib.sol/_registerNamespace_ResourceId.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerRootFunctionSelector_ResourceId_string_string.abi.json +0 -25
- package/out/WorldRegistrationSystemLib.sol/_registerRootFunctionSelector_ResourceId_string_string.abi.json.d.ts +0 -27
- package/out/WorldRegistrationSystemLib.sol/_registerRootFunctionSelector_ResourceId_string_string.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerSystemHook_ResourceId_ISystemHook_uint8.abi.json +0 -25
- package/out/WorldRegistrationSystemLib.sol/_registerSystemHook_ResourceId_ISystemHook_uint8.abi.json.d.ts +0 -27
- package/out/WorldRegistrationSystemLib.sol/_registerSystemHook_ResourceId_ISystemHook_uint8.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_registerSystem_ResourceId_System_bool.abi.json +0 -25
- package/out/WorldRegistrationSystemLib.sol/_registerSystem_ResourceId_System_bool.abi.json.d.ts +0 -27
- package/out/WorldRegistrationSystemLib.sol/_registerSystem_ResourceId_System_bool.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterDelegation_address.abi.json +0 -15
- package/out/WorldRegistrationSystemLib.sol/_unregisterDelegation_address.abi.json.d.ts +0 -17
- package/out/WorldRegistrationSystemLib.sol/_unregisterDelegation_address.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterNamespaceDelegation_ResourceId.abi.json +0 -15
- package/out/WorldRegistrationSystemLib.sol/_unregisterNamespaceDelegation_ResourceId.abi.json.d.ts +0 -17
- package/out/WorldRegistrationSystemLib.sol/_unregisterNamespaceDelegation_ResourceId.json +0 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterSystemHook_ResourceId_ISystemHook.abi.json +0 -20
- package/out/WorldRegistrationSystemLib.sol/_unregisterSystemHook_ResourceId_ISystemHook.abi.json.d.ts +0 -22
- package/out/WorldRegistrationSystemLib.sol/_unregisterSystemHook_ResourceId_ISystemHook.json +0 -1
- package/src/codegen/experimental/systems/AccessManagementSystemLib.sol +0 -182
- package/src/codegen/experimental/systems/BalanceTransferSystemLib.sol +0 -169
- package/src/codegen/experimental/systems/BatchCallSystemLib.sol +0 -153
- package/src/codegen/experimental/systems/ModuleInstallationSystemLib.sol +0 -107
- package/src/codegen/experimental/systems/RegistrationSystemLib.sol +0 -71
- package/src/codegen/experimental/systems/StoreRegistrationSystemLib.sol +0 -228
- package/src/codegen/experimental/systems/WorldRegistrationSystemLib.sol +0 -471
- package/src/codegen/interfaces/IStoreRegistrationSystem.sol +0 -29
- /package/dist/{chunk-NVV4GS3R.js.map → chunk-2W4TKC47.js.map} +0 -0
@@ -1,169 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
/* Autogenerated file. Do not edit manually. */
|
5
|
-
|
6
|
-
import { BalanceTransferSystem } from "../../../modules/init/implementations/BalanceTransferSystem.sol";
|
7
|
-
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
8
|
-
import { revertWithBytes } from "../../../revertWithBytes.sol";
|
9
|
-
import { IWorldCall } from "../../../IWorldKernel.sol";
|
10
|
-
import { SystemCall } from "../../../SystemCall.sol";
|
11
|
-
import { WorldContextConsumerLib } from "../../../WorldContext.sol";
|
12
|
-
import { Systems } from "../../../codegen/tables/Systems.sol";
|
13
|
-
import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
|
14
|
-
|
15
|
-
type BalanceTransferSystemType is bytes32;
|
16
|
-
|
17
|
-
// equivalent to WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "", name: "BalanceTransfer" }))
|
18
|
-
BalanceTransferSystemType constant balanceTransferSystem = BalanceTransferSystemType.wrap(
|
19
|
-
0x7379000000000000000000000000000042616c616e63655472616e7366657200
|
20
|
-
);
|
21
|
-
|
22
|
-
struct CallWrapper {
|
23
|
-
ResourceId systemId;
|
24
|
-
address from;
|
25
|
-
}
|
26
|
-
|
27
|
-
struct RootCallWrapper {
|
28
|
-
ResourceId systemId;
|
29
|
-
address from;
|
30
|
-
}
|
31
|
-
|
32
|
-
/**
|
33
|
-
* @title BalanceTransferSystemLib
|
34
|
-
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
35
|
-
* @dev This library is automatically generated from the corresponding system contract. Do not edit manually.
|
36
|
-
*/
|
37
|
-
library BalanceTransferSystemLib {
|
38
|
-
error BalanceTransferSystemLib_CallingFromRootSystem();
|
39
|
-
|
40
|
-
function transferBalanceToNamespace(
|
41
|
-
BalanceTransferSystemType self,
|
42
|
-
ResourceId fromNamespaceId,
|
43
|
-
ResourceId toNamespaceId,
|
44
|
-
uint256 amount
|
45
|
-
) internal {
|
46
|
-
return
|
47
|
-
CallWrapper(self.toResourceId(), address(0)).transferBalanceToNamespace(fromNamespaceId, toNamespaceId, amount);
|
48
|
-
}
|
49
|
-
|
50
|
-
function transferBalanceToAddress(
|
51
|
-
BalanceTransferSystemType self,
|
52
|
-
ResourceId fromNamespaceId,
|
53
|
-
address toAddress,
|
54
|
-
uint256 amount
|
55
|
-
) internal {
|
56
|
-
return CallWrapper(self.toResourceId(), address(0)).transferBalanceToAddress(fromNamespaceId, toAddress, amount);
|
57
|
-
}
|
58
|
-
|
59
|
-
function transferBalanceToNamespace(
|
60
|
-
CallWrapper memory self,
|
61
|
-
ResourceId fromNamespaceId,
|
62
|
-
ResourceId toNamespaceId,
|
63
|
-
uint256 amount
|
64
|
-
) internal {
|
65
|
-
// if the contract calling this function is a root system, it should use `callAsRoot`
|
66
|
-
if (address(_world()) == address(this)) revert BalanceTransferSystemLib_CallingFromRootSystem();
|
67
|
-
|
68
|
-
bytes memory systemCall = abi.encodeCall(
|
69
|
-
_transferBalanceToNamespace_ResourceId_ResourceId_uint256.transferBalanceToNamespace,
|
70
|
-
(fromNamespaceId, toNamespaceId, amount)
|
71
|
-
);
|
72
|
-
self.from == address(0)
|
73
|
-
? _world().call(self.systemId, systemCall)
|
74
|
-
: _world().callFrom(self.from, self.systemId, systemCall);
|
75
|
-
}
|
76
|
-
|
77
|
-
function transferBalanceToAddress(
|
78
|
-
CallWrapper memory self,
|
79
|
-
ResourceId fromNamespaceId,
|
80
|
-
address toAddress,
|
81
|
-
uint256 amount
|
82
|
-
) internal {
|
83
|
-
// if the contract calling this function is a root system, it should use `callAsRoot`
|
84
|
-
if (address(_world()) == address(this)) revert BalanceTransferSystemLib_CallingFromRootSystem();
|
85
|
-
|
86
|
-
bytes memory systemCall = abi.encodeCall(
|
87
|
-
_transferBalanceToAddress_ResourceId_address_uint256.transferBalanceToAddress,
|
88
|
-
(fromNamespaceId, toAddress, amount)
|
89
|
-
);
|
90
|
-
self.from == address(0)
|
91
|
-
? _world().call(self.systemId, systemCall)
|
92
|
-
: _world().callFrom(self.from, self.systemId, systemCall);
|
93
|
-
}
|
94
|
-
|
95
|
-
function transferBalanceToNamespace(
|
96
|
-
RootCallWrapper memory self,
|
97
|
-
ResourceId fromNamespaceId,
|
98
|
-
ResourceId toNamespaceId,
|
99
|
-
uint256 amount
|
100
|
-
) internal {
|
101
|
-
bytes memory systemCall = abi.encodeCall(
|
102
|
-
_transferBalanceToNamespace_ResourceId_ResourceId_uint256.transferBalanceToNamespace,
|
103
|
-
(fromNamespaceId, toNamespaceId, amount)
|
104
|
-
);
|
105
|
-
SystemCall.callWithHooksOrRevert(self.from, self.systemId, systemCall, msg.value);
|
106
|
-
}
|
107
|
-
|
108
|
-
function transferBalanceToAddress(
|
109
|
-
RootCallWrapper memory self,
|
110
|
-
ResourceId fromNamespaceId,
|
111
|
-
address toAddress,
|
112
|
-
uint256 amount
|
113
|
-
) internal {
|
114
|
-
bytes memory systemCall = abi.encodeCall(
|
115
|
-
_transferBalanceToAddress_ResourceId_address_uint256.transferBalanceToAddress,
|
116
|
-
(fromNamespaceId, toAddress, amount)
|
117
|
-
);
|
118
|
-
SystemCall.callWithHooksOrRevert(self.from, self.systemId, systemCall, msg.value);
|
119
|
-
}
|
120
|
-
|
121
|
-
function callFrom(BalanceTransferSystemType self, address from) internal pure returns (CallWrapper memory) {
|
122
|
-
return CallWrapper(self.toResourceId(), from);
|
123
|
-
}
|
124
|
-
|
125
|
-
function callAsRoot(BalanceTransferSystemType self) internal view returns (RootCallWrapper memory) {
|
126
|
-
return RootCallWrapper(self.toResourceId(), WorldContextConsumerLib._msgSender());
|
127
|
-
}
|
128
|
-
|
129
|
-
function callAsRootFrom(BalanceTransferSystemType self, address from) internal pure returns (RootCallWrapper memory) {
|
130
|
-
return RootCallWrapper(self.toResourceId(), from);
|
131
|
-
}
|
132
|
-
|
133
|
-
function toResourceId(BalanceTransferSystemType self) internal pure returns (ResourceId) {
|
134
|
-
return ResourceId.wrap(BalanceTransferSystemType.unwrap(self));
|
135
|
-
}
|
136
|
-
|
137
|
-
function fromResourceId(ResourceId resourceId) internal pure returns (BalanceTransferSystemType) {
|
138
|
-
return BalanceTransferSystemType.wrap(resourceId.unwrap());
|
139
|
-
}
|
140
|
-
|
141
|
-
function getAddress(BalanceTransferSystemType self) internal view returns (address) {
|
142
|
-
return Systems.getSystem(self.toResourceId());
|
143
|
-
}
|
144
|
-
|
145
|
-
function _world() private view returns (IWorldCall) {
|
146
|
-
return IWorldCall(StoreSwitch.getStoreAddress());
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
/**
|
151
|
-
* System Function Interfaces
|
152
|
-
*
|
153
|
-
* We generate an interface for each system function, which is then used for encoding system calls.
|
154
|
-
* This is necessary to handle function overloading correctly (which abi.encodeCall cannot).
|
155
|
-
*
|
156
|
-
* Each interface is uniquely named based on the function name and parameters to prevent collisions.
|
157
|
-
*/
|
158
|
-
|
159
|
-
interface _transferBalanceToNamespace_ResourceId_ResourceId_uint256 {
|
160
|
-
function transferBalanceToNamespace(ResourceId fromNamespaceId, ResourceId toNamespaceId, uint256 amount) external;
|
161
|
-
}
|
162
|
-
|
163
|
-
interface _transferBalanceToAddress_ResourceId_address_uint256 {
|
164
|
-
function transferBalanceToAddress(ResourceId fromNamespaceId, address toAddress, uint256 amount) external;
|
165
|
-
}
|
166
|
-
|
167
|
-
using BalanceTransferSystemLib for BalanceTransferSystemType global;
|
168
|
-
using BalanceTransferSystemLib for CallWrapper global;
|
169
|
-
using BalanceTransferSystemLib for RootCallWrapper global;
|
@@ -1,153 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
/* Autogenerated file. Do not edit manually. */
|
5
|
-
|
6
|
-
import { BatchCallSystem } from "../../../modules/init/implementations/BatchCallSystem.sol";
|
7
|
-
import { SystemCallData, SystemCallFromData } from "../../../modules/init/types.sol";
|
8
|
-
import { revertWithBytes } from "../../../revertWithBytes.sol";
|
9
|
-
import { IWorldCall } from "../../../IWorldKernel.sol";
|
10
|
-
import { SystemCall } from "../../../SystemCall.sol";
|
11
|
-
import { WorldContextConsumerLib } from "../../../WorldContext.sol";
|
12
|
-
import { Systems } from "../../../codegen/tables/Systems.sol";
|
13
|
-
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
14
|
-
import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
|
15
|
-
|
16
|
-
type BatchCallSystemType is bytes32;
|
17
|
-
|
18
|
-
// equivalent to WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "", name: "BatchCall" }))
|
19
|
-
BatchCallSystemType constant batchCallSystem = BatchCallSystemType.wrap(
|
20
|
-
0x73790000000000000000000000000000426174636843616c6c00000000000000
|
21
|
-
);
|
22
|
-
|
23
|
-
struct CallWrapper {
|
24
|
-
ResourceId systemId;
|
25
|
-
address from;
|
26
|
-
}
|
27
|
-
|
28
|
-
struct RootCallWrapper {
|
29
|
-
ResourceId systemId;
|
30
|
-
address from;
|
31
|
-
}
|
32
|
-
|
33
|
-
/**
|
34
|
-
* @title BatchCallSystemLib
|
35
|
-
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
36
|
-
* @dev This library is automatically generated from the corresponding system contract. Do not edit manually.
|
37
|
-
*/
|
38
|
-
library BatchCallSystemLib {
|
39
|
-
error BatchCallSystemLib_CallingFromRootSystem();
|
40
|
-
|
41
|
-
function batchCall(
|
42
|
-
BatchCallSystemType self,
|
43
|
-
SystemCallData[] memory systemCalls
|
44
|
-
) internal returns (bytes[] memory returnDatas) {
|
45
|
-
return CallWrapper(self.toResourceId(), address(0)).batchCall(systemCalls);
|
46
|
-
}
|
47
|
-
|
48
|
-
function batchCallFrom(
|
49
|
-
BatchCallSystemType self,
|
50
|
-
SystemCallFromData[] memory systemCalls
|
51
|
-
) internal returns (bytes[] memory returnDatas) {
|
52
|
-
return CallWrapper(self.toResourceId(), address(0)).batchCallFrom(systemCalls);
|
53
|
-
}
|
54
|
-
|
55
|
-
function batchCall(
|
56
|
-
CallWrapper memory self,
|
57
|
-
SystemCallData[] memory systemCalls
|
58
|
-
) internal returns (bytes[] memory returnDatas) {
|
59
|
-
// if the contract calling this function is a root system, it should use `callAsRoot`
|
60
|
-
if (address(_world()) == address(this)) revert BatchCallSystemLib_CallingFromRootSystem();
|
61
|
-
|
62
|
-
bytes memory systemCall = abi.encodeCall(_batchCall_SystemCallDataArray.batchCall, (systemCalls));
|
63
|
-
|
64
|
-
bytes memory result = self.from == address(0)
|
65
|
-
? _world().call(self.systemId, systemCall)
|
66
|
-
: _world().callFrom(self.from, self.systemId, systemCall);
|
67
|
-
return abi.decode(result, (bytes[]));
|
68
|
-
}
|
69
|
-
|
70
|
-
function batchCallFrom(
|
71
|
-
CallWrapper memory self,
|
72
|
-
SystemCallFromData[] memory systemCalls
|
73
|
-
) internal returns (bytes[] memory returnDatas) {
|
74
|
-
// if the contract calling this function is a root system, it should use `callAsRoot`
|
75
|
-
if (address(_world()) == address(this)) revert BatchCallSystemLib_CallingFromRootSystem();
|
76
|
-
|
77
|
-
bytes memory systemCall = abi.encodeCall(_batchCallFrom_SystemCallFromDataArray.batchCallFrom, (systemCalls));
|
78
|
-
|
79
|
-
bytes memory result = self.from == address(0)
|
80
|
-
? _world().call(self.systemId, systemCall)
|
81
|
-
: _world().callFrom(self.from, self.systemId, systemCall);
|
82
|
-
return abi.decode(result, (bytes[]));
|
83
|
-
}
|
84
|
-
|
85
|
-
function batchCall(
|
86
|
-
RootCallWrapper memory self,
|
87
|
-
SystemCallData[] memory systemCalls
|
88
|
-
) internal returns (bytes[] memory returnDatas) {
|
89
|
-
bytes memory systemCall = abi.encodeCall(_batchCall_SystemCallDataArray.batchCall, (systemCalls));
|
90
|
-
|
91
|
-
bytes memory result = SystemCall.callWithHooksOrRevert(self.from, self.systemId, systemCall, msg.value);
|
92
|
-
return abi.decode(result, (bytes[]));
|
93
|
-
}
|
94
|
-
|
95
|
-
function batchCallFrom(
|
96
|
-
RootCallWrapper memory self,
|
97
|
-
SystemCallFromData[] memory systemCalls
|
98
|
-
) internal returns (bytes[] memory returnDatas) {
|
99
|
-
bytes memory systemCall = abi.encodeCall(_batchCallFrom_SystemCallFromDataArray.batchCallFrom, (systemCalls));
|
100
|
-
|
101
|
-
bytes memory result = SystemCall.callWithHooksOrRevert(self.from, self.systemId, systemCall, msg.value);
|
102
|
-
return abi.decode(result, (bytes[]));
|
103
|
-
}
|
104
|
-
|
105
|
-
function callFrom(BatchCallSystemType self, address from) internal pure returns (CallWrapper memory) {
|
106
|
-
return CallWrapper(self.toResourceId(), from);
|
107
|
-
}
|
108
|
-
|
109
|
-
function callAsRoot(BatchCallSystemType self) internal view returns (RootCallWrapper memory) {
|
110
|
-
return RootCallWrapper(self.toResourceId(), WorldContextConsumerLib._msgSender());
|
111
|
-
}
|
112
|
-
|
113
|
-
function callAsRootFrom(BatchCallSystemType self, address from) internal pure returns (RootCallWrapper memory) {
|
114
|
-
return RootCallWrapper(self.toResourceId(), from);
|
115
|
-
}
|
116
|
-
|
117
|
-
function toResourceId(BatchCallSystemType self) internal pure returns (ResourceId) {
|
118
|
-
return ResourceId.wrap(BatchCallSystemType.unwrap(self));
|
119
|
-
}
|
120
|
-
|
121
|
-
function fromResourceId(ResourceId resourceId) internal pure returns (BatchCallSystemType) {
|
122
|
-
return BatchCallSystemType.wrap(resourceId.unwrap());
|
123
|
-
}
|
124
|
-
|
125
|
-
function getAddress(BatchCallSystemType self) internal view returns (address) {
|
126
|
-
return Systems.getSystem(self.toResourceId());
|
127
|
-
}
|
128
|
-
|
129
|
-
function _world() private view returns (IWorldCall) {
|
130
|
-
return IWorldCall(StoreSwitch.getStoreAddress());
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
/**
|
135
|
-
* System Function Interfaces
|
136
|
-
*
|
137
|
-
* We generate an interface for each system function, which is then used for encoding system calls.
|
138
|
-
* This is necessary to handle function overloading correctly (which abi.encodeCall cannot).
|
139
|
-
*
|
140
|
-
* Each interface is uniquely named based on the function name and parameters to prevent collisions.
|
141
|
-
*/
|
142
|
-
|
143
|
-
interface _batchCall_SystemCallDataArray {
|
144
|
-
function batchCall(SystemCallData[] memory systemCalls) external;
|
145
|
-
}
|
146
|
-
|
147
|
-
interface _batchCallFrom_SystemCallFromDataArray {
|
148
|
-
function batchCallFrom(SystemCallFromData[] memory systemCalls) external;
|
149
|
-
}
|
150
|
-
|
151
|
-
using BatchCallSystemLib for BatchCallSystemType global;
|
152
|
-
using BatchCallSystemLib for CallWrapper global;
|
153
|
-
using BatchCallSystemLib for RootCallWrapper global;
|
@@ -1,107 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
/* Autogenerated file. Do not edit manually. */
|
5
|
-
|
6
|
-
import { ModuleInstallationSystem } from "../../../modules/init/implementations/ModuleInstallationSystem.sol";
|
7
|
-
import { IModule } from "../../../IModule.sol";
|
8
|
-
import { revertWithBytes } from "../../../revertWithBytes.sol";
|
9
|
-
import { IWorldCall } from "../../../IWorldKernel.sol";
|
10
|
-
import { SystemCall } from "../../../SystemCall.sol";
|
11
|
-
import { WorldContextConsumerLib } from "../../../WorldContext.sol";
|
12
|
-
import { Systems } from "../../../codegen/tables/Systems.sol";
|
13
|
-
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
14
|
-
import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
|
15
|
-
|
16
|
-
type ModuleInstallationSystemType is bytes32;
|
17
|
-
|
18
|
-
// equivalent to WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "", name: "Registration" }))
|
19
|
-
ModuleInstallationSystemType constant moduleInstallationSystem = ModuleInstallationSystemType.wrap(
|
20
|
-
0x73790000000000000000000000000000526567697374726174696f6e00000000
|
21
|
-
);
|
22
|
-
|
23
|
-
struct CallWrapper {
|
24
|
-
ResourceId systemId;
|
25
|
-
address from;
|
26
|
-
}
|
27
|
-
|
28
|
-
struct RootCallWrapper {
|
29
|
-
ResourceId systemId;
|
30
|
-
address from;
|
31
|
-
}
|
32
|
-
|
33
|
-
/**
|
34
|
-
* @title ModuleInstallationSystemLib
|
35
|
-
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
36
|
-
* @dev This library is automatically generated from the corresponding system contract. Do not edit manually.
|
37
|
-
*/
|
38
|
-
library ModuleInstallationSystemLib {
|
39
|
-
error ModuleInstallationSystemLib_CallingFromRootSystem();
|
40
|
-
|
41
|
-
function installModule(ModuleInstallationSystemType self, IModule module, bytes memory encodedArgs) internal {
|
42
|
-
return CallWrapper(self.toResourceId(), address(0)).installModule(module, encodedArgs);
|
43
|
-
}
|
44
|
-
|
45
|
-
function installModule(CallWrapper memory self, IModule module, bytes memory encodedArgs) internal {
|
46
|
-
// if the contract calling this function is a root system, it should use `callAsRoot`
|
47
|
-
if (address(_world()) == address(this)) revert ModuleInstallationSystemLib_CallingFromRootSystem();
|
48
|
-
|
49
|
-
bytes memory systemCall = abi.encodeCall(_installModule_IModule_bytes.installModule, (module, encodedArgs));
|
50
|
-
self.from == address(0)
|
51
|
-
? _world().call(self.systemId, systemCall)
|
52
|
-
: _world().callFrom(self.from, self.systemId, systemCall);
|
53
|
-
}
|
54
|
-
|
55
|
-
function installModule(RootCallWrapper memory self, IModule module, bytes memory encodedArgs) internal {
|
56
|
-
bytes memory systemCall = abi.encodeCall(_installModule_IModule_bytes.installModule, (module, encodedArgs));
|
57
|
-
SystemCall.callWithHooksOrRevert(self.from, self.systemId, systemCall, msg.value);
|
58
|
-
}
|
59
|
-
|
60
|
-
function callFrom(ModuleInstallationSystemType self, address from) internal pure returns (CallWrapper memory) {
|
61
|
-
return CallWrapper(self.toResourceId(), from);
|
62
|
-
}
|
63
|
-
|
64
|
-
function callAsRoot(ModuleInstallationSystemType self) internal view returns (RootCallWrapper memory) {
|
65
|
-
return RootCallWrapper(self.toResourceId(), WorldContextConsumerLib._msgSender());
|
66
|
-
}
|
67
|
-
|
68
|
-
function callAsRootFrom(
|
69
|
-
ModuleInstallationSystemType self,
|
70
|
-
address from
|
71
|
-
) internal pure returns (RootCallWrapper memory) {
|
72
|
-
return RootCallWrapper(self.toResourceId(), from);
|
73
|
-
}
|
74
|
-
|
75
|
-
function toResourceId(ModuleInstallationSystemType self) internal pure returns (ResourceId) {
|
76
|
-
return ResourceId.wrap(ModuleInstallationSystemType.unwrap(self));
|
77
|
-
}
|
78
|
-
|
79
|
-
function fromResourceId(ResourceId resourceId) internal pure returns (ModuleInstallationSystemType) {
|
80
|
-
return ModuleInstallationSystemType.wrap(resourceId.unwrap());
|
81
|
-
}
|
82
|
-
|
83
|
-
function getAddress(ModuleInstallationSystemType self) internal view returns (address) {
|
84
|
-
return Systems.getSystem(self.toResourceId());
|
85
|
-
}
|
86
|
-
|
87
|
-
function _world() private view returns (IWorldCall) {
|
88
|
-
return IWorldCall(StoreSwitch.getStoreAddress());
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* System Function Interfaces
|
94
|
-
*
|
95
|
-
* We generate an interface for each system function, which is then used for encoding system calls.
|
96
|
-
* This is necessary to handle function overloading correctly (which abi.encodeCall cannot).
|
97
|
-
*
|
98
|
-
* Each interface is uniquely named based on the function name and parameters to prevent collisions.
|
99
|
-
*/
|
100
|
-
|
101
|
-
interface _installModule_IModule_bytes {
|
102
|
-
function installModule(IModule module, bytes memory encodedArgs) external;
|
103
|
-
}
|
104
|
-
|
105
|
-
using ModuleInstallationSystemLib for ModuleInstallationSystemType global;
|
106
|
-
using ModuleInstallationSystemLib for CallWrapper global;
|
107
|
-
using ModuleInstallationSystemLib for RootCallWrapper global;
|
@@ -1,71 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
2
|
-
pragma solidity >=0.8.24;
|
3
|
-
|
4
|
-
/* Autogenerated file. Do not edit manually. */
|
5
|
-
|
6
|
-
import { RegistrationSystem } from "../../../modules/init/RegistrationSystem.sol";
|
7
|
-
import { revertWithBytes } from "../../../revertWithBytes.sol";
|
8
|
-
import { IWorldCall } from "../../../IWorldKernel.sol";
|
9
|
-
import { SystemCall } from "../../../SystemCall.sol";
|
10
|
-
import { WorldContextConsumerLib } from "../../../WorldContext.sol";
|
11
|
-
import { Systems } from "../../../codegen/tables/Systems.sol";
|
12
|
-
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
13
|
-
import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
|
14
|
-
|
15
|
-
type RegistrationSystemType is bytes32;
|
16
|
-
|
17
|
-
// equivalent to WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "", name: "Registration" }))
|
18
|
-
RegistrationSystemType constant registrationSystem = RegistrationSystemType.wrap(
|
19
|
-
0x73790000000000000000000000000000526567697374726174696f6e00000000
|
20
|
-
);
|
21
|
-
|
22
|
-
struct CallWrapper {
|
23
|
-
ResourceId systemId;
|
24
|
-
address from;
|
25
|
-
}
|
26
|
-
|
27
|
-
struct RootCallWrapper {
|
28
|
-
ResourceId systemId;
|
29
|
-
address from;
|
30
|
-
}
|
31
|
-
|
32
|
-
/**
|
33
|
-
* @title RegistrationSystemLib
|
34
|
-
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
35
|
-
* @dev This library is automatically generated from the corresponding system contract. Do not edit manually.
|
36
|
-
*/
|
37
|
-
library RegistrationSystemLib {
|
38
|
-
error RegistrationSystemLib_CallingFromRootSystem();
|
39
|
-
|
40
|
-
function callFrom(RegistrationSystemType self, address from) internal pure returns (CallWrapper memory) {
|
41
|
-
return CallWrapper(self.toResourceId(), from);
|
42
|
-
}
|
43
|
-
|
44
|
-
function callAsRoot(RegistrationSystemType self) internal view returns (RootCallWrapper memory) {
|
45
|
-
return RootCallWrapper(self.toResourceId(), WorldContextConsumerLib._msgSender());
|
46
|
-
}
|
47
|
-
|
48
|
-
function callAsRootFrom(RegistrationSystemType self, address from) internal pure returns (RootCallWrapper memory) {
|
49
|
-
return RootCallWrapper(self.toResourceId(), from);
|
50
|
-
}
|
51
|
-
|
52
|
-
function toResourceId(RegistrationSystemType self) internal pure returns (ResourceId) {
|
53
|
-
return ResourceId.wrap(RegistrationSystemType.unwrap(self));
|
54
|
-
}
|
55
|
-
|
56
|
-
function fromResourceId(ResourceId resourceId) internal pure returns (RegistrationSystemType) {
|
57
|
-
return RegistrationSystemType.wrap(resourceId.unwrap());
|
58
|
-
}
|
59
|
-
|
60
|
-
function getAddress(RegistrationSystemType self) internal view returns (address) {
|
61
|
-
return Systems.getSystem(self.toResourceId());
|
62
|
-
}
|
63
|
-
|
64
|
-
function _world() private view returns (IWorldCall) {
|
65
|
-
return IWorldCall(StoreSwitch.getStoreAddress());
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
using RegistrationSystemLib for RegistrationSystemType global;
|
70
|
-
using RegistrationSystemLib for CallWrapper global;
|
71
|
-
using RegistrationSystemLib for RootCallWrapper global;
|