From cfec37a700b13a5b798a1c77d2c3ac3a6ff1dd7a Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 17:28:44 +0100 Subject: [PATCH 01/16] remove access control check for world calling itself --- packages/world/src/AccessControl.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/world/src/AccessControl.sol b/packages/world/src/AccessControl.sol index 6cb5cc12ce..dce03878a6 100644 --- a/packages/world/src/AccessControl.sol +++ b/packages/world/src/AccessControl.sol @@ -15,8 +15,7 @@ library AccessControl { */ function hasAccess(ResourceId resourceId, address caller) internal view returns (bool) { return - address(this) == caller || // First check if the World is calling itself - ResourceAccess._get(ResourceId.unwrap(resourceId.getNamespaceId()), caller) || // Then check access based on the namespace + ResourceAccess._get(ResourceId.unwrap(resourceId.getNamespaceId()), caller) || // First check access based on the namespace ResourceAccess._get(ResourceId.unwrap(resourceId), caller); // If caller has no namespace access, check access on the name } From 734cdac972a4976fe4a178685aba41574cf9ee53 Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 17:38:42 +0100 Subject: [PATCH 02/16] fix tests --- packages/world/test/AccessControl.t.sol | 2 ++ packages/world/test/World.t.sol | 20 ++++++++++---------- packages/world/test/WorldDynamicUpdate.t.sol | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/world/test/AccessControl.t.sol b/packages/world/test/AccessControl.t.sol index 413706328f..a8cb6765f2 100644 --- a/packages/world/test/AccessControl.t.sol +++ b/packages/world/test/AccessControl.t.sol @@ -88,6 +88,8 @@ contract AccessControlTest is Test, GasReporter, StoreMock { AccessControl.requireAccess(tableId, presetCaller); endGasReport(); + vm.prank(caller); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.AccessDenied.selector, tableId.toString(), address(this))); startGasReport("AccessControl: requireAccess (this address)"); AccessControl.requireAccess(tableId, address(this)); endGasReport(); diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 3b242852bc..05ca6fe870 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -707,8 +707,8 @@ contract WorldTest is Test, GasReporter { _expectAccessDenied(address(0x01), "testSetRecord", "testTable", RESOURCE_TABLE); Bool.set(world, tableId, true); - // Expect the World to have access - vm.prank(address(world)); + // Expect the World to not have access + _expectAccessDenied(address(world), "testSetRecord", "testTable", RESOURCE_TABLE); Bool.set(world, tableId, true); } @@ -733,8 +733,8 @@ contract WorldTest is Test, GasReporter { _expectAccessDenied(address(0x01), "testSetField", "testTable", RESOURCE_TABLE); world.setField(tableId, singletonKey, 0, abi.encodePacked(true), fieldLayout); - // Expect the World to have access - vm.prank(address(world)); + // Expect the World to not have access + _expectAccessDenied(address(world), "testSetField", "testTable", RESOURCE_TABLE); world.setField(tableId, singletonKey, 0, abi.encodePacked(true), fieldLayout); } @@ -775,8 +775,8 @@ contract WorldTest is Test, GasReporter { _expectAccessDenied(address(0x01), namespace, name, RESOURCE_TABLE); world.pushToField(tableId, keyTuple, 0, encodedData, fieldLayout); - // Expect the World to have access - vm.prank(address(world)); + // Expect the World to not have access + _expectAccessDenied(address(world), namespace, name, RESOURCE_TABLE); world.pushToField(tableId, keyTuple, 0, encodedData, fieldLayout); } @@ -824,8 +824,8 @@ contract WorldTest is Test, GasReporter { _expectAccessDenied(address(0x02), namespace, name, RESOURCE_TABLE); world.deleteRecord(tableId, singletonKey, fieldLayout); - // Expect the World to have access - vm.prank(address(world)); + // Expect the World to not have access + _expectAccessDenied(address(world), namespace, name, RESOURCE_TABLE); world.deleteRecord(tableId, singletonKey, fieldLayout); } @@ -864,8 +864,8 @@ contract WorldTest is Test, GasReporter { _expectAccessDenied(address(0x01), "namespace", "testSystem", RESOURCE_SYSTEM); world.call(systemId, abi.encodeCall(WorldTestSystem.msgSender, ())); - // Expect the World to have access - vm.prank(address(world)); + // Expect the World to have not access + _expectAccessDenied(address(world), "namespace", "testSystem", RESOURCE_SYSTEM); world.call(systemId, abi.encodeCall(WorldTestSystem.msgSender, ())); // Expect errors from the system to be forwarded diff --git a/packages/world/test/WorldDynamicUpdate.t.sol b/packages/world/test/WorldDynamicUpdate.t.sol index 409495592a..f7f8a0840f 100644 --- a/packages/world/test/WorldDynamicUpdate.t.sol +++ b/packages/world/test/WorldDynamicUpdate.t.sol @@ -132,7 +132,7 @@ contract UpdateInFieldTest is Test, GasReporter { world.popFromField(tableId, keyTuple, 0, 20, fieldLayout); // Expect the World to have access - vm.prank(address(world)); + _expectAccessDenied(address(world), tableId); world.popFromField(tableId, keyTuple, 0, 20, fieldLayout); } @@ -170,7 +170,7 @@ contract UpdateInFieldTest is Test, GasReporter { world.updateInField(tableId, keyTuple, 0, 0, EncodeArray.encode(dataForUpdate), fieldLayout); // Expect the World to have access - vm.prank(address(world)); + _expectAccessDenied(address(world), tableId); world.updateInField(tableId, keyTuple, 0, 0, EncodeArray.encode(dataForUpdate), fieldLayout); } } From cfd14ce0371653a2abe960482d77fa8956d60eb9 Mon Sep 17 00:00:00 2001 From: alvarius Date: Thu, 21 Sep 2023 17:41:47 +0100 Subject: [PATCH 03/16] Create brown-garlics-lie.md --- .changeset/brown-garlics-lie.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/brown-garlics-lie.md diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md new file mode 100644 index 0000000000..5718e3d01e --- /dev/null +++ b/.changeset/brown-garlics-lie.md @@ -0,0 +1,6 @@ +--- +"@latticexyz/world": patch +--- + +Removed an access control check for when the `World` is calling itself. +The `World` should not have implicit access to all resources, but only to those where it actually has access based on the `namespaceId` or `resourceId`. From 581abeca95977fe337d289e756a2462a0fa655b5 Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 17:46:14 +0100 Subject: [PATCH 04/16] update gas --- packages/world/gas-report.json | 58 +++++++++++++++------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 46c6292db7..f699fe79b7 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,37 +3,31 @@ "file": "test/AccessControl.t.sol", "test": "testAccessControl", "name": "AccessControl: hasAccess (cold)", - "gasUsed": 7179 + "gasUsed": 7135 }, { "file": "test/AccessControl.t.sol", "test": "testAccessControl", "name": "AccessControl: hasAccess (warm, namespace only)", - "gasUsed": 1727 + "gasUsed": 1683 }, { "file": "test/AccessControl.t.sol", "test": "testAccessControl", "name": "AccessControl: hasAccess (warm)", - "gasUsed": 3187 + "gasUsed": 3143 }, { "file": "test/AccessControl.t.sol", "test": "testRequireAccess", "name": "AccessControl: requireAccess (cold)", - "gasUsed": 7222 + "gasUsed": 7178 }, { "file": "test/AccessControl.t.sol", "test": "testRequireAccess", "name": "AccessControl: requireAccess (warm)", - "gasUsed": 3225 - }, - { - "file": "test/AccessControl.t.sol", - "test": "testRequireAccess", - "name": "AccessControl: requireAccess (this address)", - "gasUsed": 153 + "gasUsed": 3181 }, { "file": "test/KeysInTableModule.t.sol", @@ -51,7 +45,7 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 158382 + "gasUsed": 158250 }, { "file": "test/KeysInTableModule.t.sol", @@ -69,13 +63,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 22324 + "gasUsed": 22280 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 160664 + "gasUsed": 160268 }, { "file": "test/KeysInTableModule.t.sol", @@ -87,13 +81,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 21046 + "gasUsed": 21002 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 85764 + "gasUsed": 85544 }, { "file": "test/KeysWithValueModule.t.sol", @@ -123,7 +117,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 135760 + "gasUsed": 135628 }, { "file": "test/KeysWithValueModule.t.sol", @@ -135,13 +129,13 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 106140 + "gasUsed": 106008 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 35415 + "gasUsed": 35327 }, { "file": "test/KeysWithValueModule.t.sol", @@ -153,13 +147,13 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 148511 + "gasUsed": 148379 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 113270 + "gasUsed": 113138 }, { "file": "test/query.t.sol", @@ -261,7 +255,7 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 52137 + "gasUsed": 52093 }, { "file": "test/UniqueEntityModule.t.sol", @@ -273,13 +267,13 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 52137 + "gasUsed": 52093 }, { "file": "test/World.t.sol", "test": "testCall", "name": "call a system via the World", - "gasUsed": 12769 + "gasUsed": 12725 }, { "file": "test/World.t.sol", @@ -297,13 +291,13 @@ "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 9155 + "gasUsed": 9111 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 86882 + "gasUsed": 86838 }, { "file": "test/World.t.sol", @@ -351,37 +345,37 @@ "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 37413 + "gasUsed": 37369 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 35407 + "gasUsed": 35363 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 24643 + "gasUsed": 24599 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 13789 + "gasUsed": 13745 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 25248 + "gasUsed": 25204 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 14453 + "gasUsed": 14409 }, { "file": "test/WorldResourceId.t.sol", From 972a53d0772c1e6ce30a7ca8e4d63712b42b43ec Mon Sep 17 00:00:00 2001 From: alvarius Date: Thu, 21 Sep 2023 18:53:24 +0100 Subject: [PATCH 05/16] feat(world): prevent calls to self (#1564) --- packages/world/gas-report.json | 90 ++--- packages/world/mud.config.ts | 9 + packages/world/src/World.sol | 43 ++- packages/world/src/index.sol | 1 + .../world/src/interfaces/IWorldErrors.sol | 1 + .../world/src/modules/core/CoreModule.sol | 17 +- packages/world/src/modules/core/constants.sol | 9 + .../StoreRegistrationSystem.sol | 5 +- packages/world/test/World.t.sol | 36 +- packages/world/test/WorldDynamicUpdate.t.sol | 12 +- packages/world/test/tables/TwoFields.sol | 328 ++++++++++++++++++ 11 files changed, 459 insertions(+), 92 deletions(-) create mode 100644 packages/world/test/tables/TwoFields.sol diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index f699fe79b7..0729e1730c 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -33,67 +33,67 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1414806 + "gasUsed": 1414938 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1414806 + "gasUsed": 1414938 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 158250 + "gasUsed": 158313 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1414806 + "gasUsed": 1414938 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1414806 + "gasUsed": 1414938 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 22280 + "gasUsed": 22301 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 160268 + "gasUsed": 160457 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1414806 + "gasUsed": 1414938 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 21002 + "gasUsed": 21023 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 85544 + "gasUsed": 85649 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 665200 + "gasUsed": 654480 }, { "file": "test/KeysWithValueModule.t.sol", @@ -111,49 +111,49 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 665200 + "gasUsed": 654480 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 135628 + "gasUsed": 135691 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 665200 + "gasUsed": 654480 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 106008 + "gasUsed": 106071 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 35327 + "gasUsed": 35369 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 665200 + "gasUsed": 654480 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 148379 + "gasUsed": 148442 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 113138 + "gasUsed": 113201 }, { "file": "test/query.t.sol", @@ -225,157 +225,157 @@ "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromCallboundDelegation", "name": "register a callbound delegation", - "gasUsed": 114571 + "gasUsed": 114592 }, { "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromCallboundDelegation", "name": "call a system via a callbound delegation", - "gasUsed": 34058 + "gasUsed": 34079 }, { "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromTimeboundDelegation", "name": "register a timebound delegation", - "gasUsed": 109041 + "gasUsed": 109062 }, { "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromTimeboundDelegation", "name": "call a system via a timebound delegation", - "gasUsed": 27106 + "gasUsed": 27127 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 690323 + "gasUsed": 679566 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 52093 + "gasUsed": 52129 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 680596 + "gasUsed": 669881 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 52093 + "gasUsed": 52129 }, { "file": "test/World.t.sol", "test": "testCall", "name": "call a system via the World", - "gasUsed": 12725 + "gasUsed": 12746 }, { "file": "test/World.t.sol", "test": "testCallFromUnlimitedDelegation", "name": "register an unlimited delegation", - "gasUsed": 50615 + "gasUsed": 50636 }, { "file": "test/World.t.sol", "test": "testCallFromUnlimitedDelegation", "name": "call a system via an unlimited delegation", - "gasUsed": 12961 + "gasUsed": 12982 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 9111 + "gasUsed": 9132 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 86838 + "gasUsed": 86859 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 59404 + "gasUsed": 59419 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 52929 + "gasUsed": 52944 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 79998 + "gasUsed": 80013 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 123238 + "gasUsed": 123253 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 74842 + "gasUsed": 74857 }, { "file": "test/World.t.sol", "test": "testRegisterSystem", "name": "register a system", - "gasUsed": 165710 + "gasUsed": 165731 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 651789 + "gasUsed": 640951 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 37369 + "gasUsed": 37390 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 35363 + "gasUsed": 36534 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 24599 + "gasUsed": 24620 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 13745 + "gasUsed": 13766 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 25204 + "gasUsed": 25225 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 14409 + "gasUsed": 14430 }, { "file": "test/WorldResourceId.t.sol", diff --git a/packages/world/mud.config.ts b/packages/world/mud.config.ts index 9a3fe83257..2add7cfb72 100644 --- a/packages/world/mud.config.ts +++ b/packages/world/mud.config.ts @@ -170,6 +170,15 @@ export default mudConfig({ }, tableIdArgument: true, }, + TwoFields: { + directory: "../test/tables", + keySchema: {}, + valueSchema: { + value1: "bool", + value2: "bool", + }, + tableIdArgument: true, + }, AddressArray: { directory: "../test/tables", valueSchema: "address[]", diff --git a/packages/world/src/World.sol b/packages/world/src/World.sol index f24bf892e1..f9bea13bfd 100644 --- a/packages/world/src/World.sol +++ b/packages/world/src/World.sol @@ -49,10 +49,20 @@ contract World is StoreRead, IStoreData, IWorldKernel { emit HelloWorld(WORLD_VERSION); } + /** + * Prevent the World from calling itself. + */ + modifier requireNoCallback() { + if (msg.sender == address(this)) { + revert WorldCallbackNotAllowed(msg.sig); + } + _; + } + /** * Allows the creator of the World to initialize the World once. */ - function initialize(IModule coreModule) public { + function initialize(IModule coreModule) public requireNoCallback { // Only the initial creator of the World can initialize it if (msg.sender != creator) { revert AccessDenied(ROOT_NAMESPACE_ID.toString(), msg.sender); @@ -72,12 +82,12 @@ contract World is StoreRead, IStoreData, IWorldKernel { * Requires the caller to own the root namespace. * The module is delegatecalled and installed in the root namespace. */ - function installRootModule(IModule module, bytes memory args) public { + function installRootModule(IModule module, bytes memory args) public requireNoCallback { AccessControl.requireOwner(ROOT_NAMESPACE_ID, msg.sender); _installRootModule(module, args); } - function _installRootModule(IModule module, bytes memory args) internal { + function _installRootModule(IModule module, bytes memory args) internal requireNoCallback { // Require the provided address to implement the IModule interface requireInterface(address(module), MODULE_INTERFACE_ID); @@ -109,7 +119,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { PackedCounter encodedLengths, bytes calldata dynamicData, FieldLayout fieldLayout - ) public virtual { + ) public virtual requireNoCallback { // Require access to the namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -123,7 +133,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint48 start, uint40 deleteCount, bytes calldata data - ) public virtual { + ) public virtual requireNoCallback { // Require access to the namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -138,7 +148,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint40 startWithinField, uint40 deleteCount, bytes calldata data - ) public virtual { + ) public virtual requireNoCallback { // Require access to the namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -156,7 +166,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint8 fieldIndex, bytes calldata data, FieldLayout fieldLayout - ) public virtual { + ) public virtual requireNoCallback { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -174,7 +184,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint8 fieldIndex, bytes calldata dataToPush, FieldLayout fieldLayout - ) public virtual { + ) public virtual requireNoCallback { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -192,7 +202,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint8 fieldIndex, uint256 byteLengthToPop, FieldLayout fieldLayout - ) public virtual { + ) public virtual requireNoCallback { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -211,7 +221,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { uint256 startByteIndex, bytes calldata dataToSet, FieldLayout fieldLayout - ) public virtual { + ) public virtual requireNoCallback { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -223,7 +233,11 @@ contract World is StoreRead, IStoreData, IWorldKernel { * Delete a record in the table at the given tableId. * Requires the caller to have access to the namespace or name. */ - function deleteRecord(ResourceId tableId, bytes32[] calldata keyTuple, FieldLayout fieldLayout) public virtual { + function deleteRecord( + ResourceId tableId, + bytes32[] calldata keyTuple, + FieldLayout fieldLayout + ) public virtual requireNoCallback { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); @@ -241,7 +255,10 @@ contract World is StoreRead, IStoreData, IWorldKernel { * Call the system at the given system ID. * If the system is not public, the caller must have access to the namespace or name (encoded in the system ID). */ - function call(ResourceId systemId, bytes memory callData) external payable virtual returns (bytes memory) { + function call( + ResourceId systemId, + bytes memory callData + ) external payable virtual requireNoCallback returns (bytes memory) { return SystemCall.callWithHooksOrRevert(msg.sender, systemId, callData, msg.value); } @@ -253,7 +270,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { address delegator, ResourceId systemId, bytes memory callData - ) external payable virtual returns (bytes memory) { + ) external payable virtual requireNoCallback returns (bytes memory) { // If the delegator is the caller, call the system directly if (delegator == msg.sender) { return SystemCall.callWithHooksOrRevert(msg.sender, systemId, callData, msg.value); diff --git a/packages/world/src/index.sol b/packages/world/src/index.sol index 2e852c4973..d29dc778c0 100644 --- a/packages/world/src/index.sol +++ b/packages/world/src/index.sol @@ -19,4 +19,5 @@ import { UniqueEntity } from "./modules/uniqueentity/tables/UniqueEntity.sol"; import { CallboundDelegations, CallboundDelegationsTableId } from "./modules/std-delegations/tables/CallboundDelegations.sol"; import { TimeboundDelegations, TimeboundDelegationsTableId } from "./modules/std-delegations/tables/TimeboundDelegations.sol"; import { Bool } from "./../test/tables/Bool.sol"; +import { TwoFields, TwoFieldsData } from "./../test/tables/TwoFields.sol"; import { AddressArray } from "./../test/tables/AddressArray.sol"; diff --git a/packages/world/src/interfaces/IWorldErrors.sol b/packages/world/src/interfaces/IWorldErrors.sol index ef421ff6b7..56a26e48ca 100644 --- a/packages/world/src/interfaces/IWorldErrors.sol +++ b/packages/world/src/interfaces/IWorldErrors.sol @@ -16,4 +16,5 @@ interface IWorldErrors { error InsufficientBalance(uint256 balance, uint256 amount); error InterfaceNotSupported(address contractAddress, bytes4 interfaceId); error InvalidResourceType(bytes2 expected, ResourceId resourceId, string resourceIdString); + error WorldCallbackNotAllowed(bytes4 functionSelector); } diff --git a/packages/world/src/modules/core/CoreModule.sol b/packages/world/src/modules/core/CoreModule.sol index 9d5fc3a852..48873dac3c 100644 --- a/packages/world/src/modules/core/CoreModule.sol +++ b/packages/world/src/modules/core/CoreModule.sol @@ -18,7 +18,7 @@ import { InstalledModules } from "../../tables/InstalledModules.sol"; import { Delegations } from "../../tables/Delegations.sol"; import { CoreSystem } from "./CoreSystem.sol"; -import { CORE_MODULE_NAME, CORE_SYSTEM_NAME } from "./constants.sol"; +import { CORE_MODULE_NAME, CORE_SYSTEM_ID } from "./constants.sol"; import { Systems } from "./tables/Systems.sol"; import { FunctionSelectors } from "./tables/FunctionSelectors.sol"; @@ -87,14 +87,7 @@ contract CoreModule is Module { msgSender: _msgSender(), msgValue: 0, target: coreSystem, - callData: abi.encodeCall( - WorldRegistrationSystem.registerSystem, - ( - WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: ROOT_NAMESPACE, name: CORE_SYSTEM_NAME }), - CoreSystem(coreSystem), - true - ) - ) + callData: abi.encodeCall(WorldRegistrationSystem.registerSystem, (CORE_SYSTEM_ID, CoreSystem(coreSystem), true)) }); } @@ -135,11 +128,7 @@ contract CoreModule is Module { target: coreSystem, callData: abi.encodeCall( WorldRegistrationSystem.registerRootFunctionSelector, - ( - WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: ROOT_NAMESPACE, name: CORE_SYSTEM_NAME }), - functionSelectors[i], - functionSelectors[i] - ) + (CORE_SYSTEM_ID, functionSelectors[i], functionSelectors[i]) ) }); } diff --git a/packages/world/src/modules/core/constants.sol b/packages/world/src/modules/core/constants.sol index 5b6a6eb734..e2a6405263 100644 --- a/packages/world/src/modules/core/constants.sol +++ b/packages/world/src/modules/core/constants.sol @@ -1,5 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; +import { ResourceId } from "@latticexyz/store/src/ResourceId.sol"; + +import { ROOT_NAMESPACE } from "../../constants.sol"; +import { RESOURCE_SYSTEM } from "../../worldResourceTypes.sol"; + bytes16 constant CORE_MODULE_NAME = bytes16("core.m"); bytes16 constant CORE_SYSTEM_NAME = bytes16("core.s"); + +ResourceId constant CORE_SYSTEM_ID = ResourceId.wrap( + bytes32(abi.encodePacked(RESOURCE_SYSTEM, ROOT_NAMESPACE, CORE_SYSTEM_NAME)) +); diff --git a/packages/world/src/modules/core/implementations/StoreRegistrationSystem.sol b/packages/world/src/modules/core/implementations/StoreRegistrationSystem.sol index b86a42fabe..bf3fa92bc6 100644 --- a/packages/world/src/modules/core/implementations/StoreRegistrationSystem.sol +++ b/packages/world/src/modules/core/implementations/StoreRegistrationSystem.sol @@ -23,7 +23,7 @@ import { SystemRegistry } from "../tables/SystemRegistry.sol"; import { Systems } from "../tables/Systems.sol"; import { FunctionSelectors } from "../tables/FunctionSelectors.sol"; -import { CORE_SYSTEM_NAME } from "../constants.sol"; +import { CORE_SYSTEM_ID } from "../constants.sol"; import { WorldRegistrationSystem } from "./WorldRegistrationSystem.sol"; @@ -52,7 +52,8 @@ contract StoreRegistrationSystem is System, IWorldErrors { if (!ResourceIds._getExists(ResourceId.unwrap(namespaceId))) { // Since this is a root system, we're in the context of the World contract already, // so we can use delegatecall to register the namespace - (bool success, bytes memory data) = address(this).delegatecall( + (address coreSystemAddress, ) = Systems._get(ResourceId.unwrap(CORE_SYSTEM_ID)); + (bool success, bytes memory data) = coreSystemAddress.delegatecall( abi.encodeCall(WorldRegistrationSystem.registerNamespace, (namespaceId)) ); if (!success) revertWithBytes(data); diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 05ca6fe870..0410d64fb2 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -44,6 +44,7 @@ import { IWorldErrors } from "../src/interfaces/IWorldErrors.sol"; import { ISystemHook, SYSTEM_HOOK_INTERFACE_ID } from "../src/interfaces/ISystemHook.sol"; import { Bool } from "./tables/Bool.sol"; +import { TwoFields, TwoFieldsData } from "./tables/TwoFields.sol"; import { AddressArray } from "./tables/AddressArray.sol"; interface IWorldTestSystem { @@ -689,27 +690,30 @@ contract WorldTest is Test, GasReporter { // Register a new table world.registerTable( tableId, - Bool.getFieldLayout(), - defaultKeySchema, - Bool.getValueSchema(), - new string[](1), - new string[](1) + TwoFields.getFieldLayout(), + TwoFields.getKeySchema(), + TwoFields.getValueSchema(), + new string[](0), + new string[](2) ); startGasReport("Write data to the table"); - Bool.set(world, tableId, true); + TwoFields.set(world, tableId, true, true); endGasReport(); // Expect the data to be written - assertTrue(Bool.get(world, tableId)); + TwoFieldsData memory tableData = (TwoFields.get(world, tableId)); + assertTrue(tableData.value1); + assertTrue(tableData.value2); // Expect an error when trying to write from an address that doesn't have access _expectAccessDenied(address(0x01), "testSetRecord", "testTable", RESOURCE_TABLE); - Bool.set(world, tableId, true); + TwoFields.set(world, tableId, true, true); // Expect the World to not have access - _expectAccessDenied(address(world), "testSetRecord", "testTable", RESOURCE_TABLE); - Bool.set(world, tableId, true); + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.setRecord.selector)); + TwoFields.set(world, tableId, true, true); } function testSetField() public { @@ -734,7 +738,8 @@ contract WorldTest is Test, GasReporter { world.setField(tableId, singletonKey, 0, abi.encodePacked(true), fieldLayout); // Expect the World to not have access - _expectAccessDenied(address(world), "testSetField", "testTable", RESOURCE_TABLE); + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.setField.selector)); world.setField(tableId, singletonKey, 0, abi.encodePacked(true), fieldLayout); } @@ -776,7 +781,8 @@ contract WorldTest is Test, GasReporter { world.pushToField(tableId, keyTuple, 0, encodedData, fieldLayout); // Expect the World to not have access - _expectAccessDenied(address(world), namespace, name, RESOURCE_TABLE); + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.pushToField.selector)); world.pushToField(tableId, keyTuple, 0, encodedData, fieldLayout); } @@ -825,7 +831,8 @@ contract WorldTest is Test, GasReporter { world.deleteRecord(tableId, singletonKey, fieldLayout); // Expect the World to not have access - _expectAccessDenied(address(world), namespace, name, RESOURCE_TABLE); + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.deleteRecord.selector)); world.deleteRecord(tableId, singletonKey, fieldLayout); } @@ -865,7 +872,8 @@ contract WorldTest is Test, GasReporter { world.call(systemId, abi.encodeCall(WorldTestSystem.msgSender, ())); // Expect the World to have not access - _expectAccessDenied(address(world), "namespace", "testSystem", RESOURCE_SYSTEM); + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.call.selector)); world.call(systemId, abi.encodeCall(WorldTestSystem.msgSender, ())); // Expect errors from the system to be forwarded diff --git a/packages/world/test/WorldDynamicUpdate.t.sol b/packages/world/test/WorldDynamicUpdate.t.sol index f7f8a0840f..f2a725c857 100644 --- a/packages/world/test/WorldDynamicUpdate.t.sol +++ b/packages/world/test/WorldDynamicUpdate.t.sol @@ -131,8 +131,9 @@ contract UpdateInFieldTest is Test, GasReporter { _expectAccessDenied(address(0x01), tableId); world.popFromField(tableId, keyTuple, 0, 20, fieldLayout); - // Expect the World to have access - _expectAccessDenied(address(world), tableId); + // Expect the World to not have access + vm.prank(address(world)); + vm.expectRevert(abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.popFromField.selector)); world.popFromField(tableId, keyTuple, 0, 20, fieldLayout); } @@ -169,8 +170,11 @@ contract UpdateInFieldTest is Test, GasReporter { _expectAccessDenied(address(0x01), tableId); world.updateInField(tableId, keyTuple, 0, 0, EncodeArray.encode(dataForUpdate), fieldLayout); - // Expect the World to have access - _expectAccessDenied(address(world), tableId); + // Expect the World to not have access + vm.prank(address(world)); + vm.expectRevert( + abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.updateInField.selector) + ); world.updateInField(tableId, keyTuple, 0, 0, EncodeArray.encode(dataForUpdate), fieldLayout); } } diff --git a/packages/world/test/tables/TwoFields.sol b/packages/world/test/tables/TwoFields.sol new file mode 100644 index 0000000000..c257dd902e --- /dev/null +++ b/packages/world/test/tables/TwoFields.sol @@ -0,0 +1,328 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +/* Autogenerated file. Do not edit manually. */ + +// Import schema type +import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol"; + +// Import store internals +import { IStore } from "@latticexyz/store/src/IStore.sol"; +import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; +import { StoreCore } from "@latticexyz/store/src/StoreCore.sol"; +import { Bytes } from "@latticexyz/store/src/Bytes.sol"; +import { Memory } from "@latticexyz/store/src/Memory.sol"; +import { SliceLib } from "@latticexyz/store/src/Slice.sol"; +import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol"; +import { FieldLayout, FieldLayoutLib } from "@latticexyz/store/src/FieldLayout.sol"; +import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol"; +import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol"; +import { ResourceId } from "@latticexyz/store/src/ResourceId.sol"; +import { RESOURCE_TABLE, RESOURCE_OFFCHAIN_TABLE } from "@latticexyz/store/src/storeResourceTypes.sol"; + +FieldLayout constant _fieldLayout = FieldLayout.wrap( + 0x0002020001010000000000000000000000000000000000000000000000000000 +); + +struct TwoFieldsData { + bool value1; + bool value2; +} + +library TwoFields { + /** Get the table values' field layout */ + function getFieldLayout() internal pure returns (FieldLayout) { + return _fieldLayout; + } + + /** Get the table's key schema */ + function getKeySchema() internal pure returns (Schema) { + SchemaType[] memory _keySchema = new SchemaType[](0); + + return SchemaLib.encode(_keySchema); + } + + /** Get the table's value schema */ + function getValueSchema() internal pure returns (Schema) { + SchemaType[] memory _valueSchema = new SchemaType[](2); + _valueSchema[0] = SchemaType.BOOL; + _valueSchema[1] = SchemaType.BOOL; + + return SchemaLib.encode(_valueSchema); + } + + /** Get the table's key names */ + function getKeyNames() internal pure returns (string[] memory keyNames) { + keyNames = new string[](0); + } + + /** Get the table's field names */ + function getFieldNames() internal pure returns (string[] memory fieldNames) { + fieldNames = new string[](2); + fieldNames[0] = "value1"; + fieldNames[1] = "value2"; + } + + /** Register the table with its config */ + function register(ResourceId _tableId) internal { + StoreSwitch.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); + } + + /** Register the table with its config */ + function _register(ResourceId _tableId) internal { + StoreCore.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); + } + + /** Register the table with its config (using the specified store) */ + function register(IStore _store, ResourceId _tableId) internal { + _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); + } + + /** Get value1 */ + function getValue1(ResourceId _tableId) internal view returns (bool value1) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = StoreSwitch.getStaticField(_tableId, _keyTuple, 0, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Get value1 */ + function _getValue1(ResourceId _tableId) internal view returns (bool value1) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = StoreCore.getStaticField(_tableId, _keyTuple, 0, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Get value1 (using the specified store) */ + function getValue1(IStore _store, ResourceId _tableId) internal view returns (bool value1) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = _store.getStaticField(_tableId, _keyTuple, 0, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Set value1 */ + function setValue1(ResourceId _tableId, bool value1) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreSwitch.setField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); + } + + /** Set value1 */ + function _setValue1(ResourceId _tableId, bool value1) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreCore.setField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); + } + + /** Set value1 (using the specified store) */ + function setValue1(IStore _store, ResourceId _tableId, bool value1) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + _store.setField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); + } + + /** Get value2 */ + function getValue2(ResourceId _tableId) internal view returns (bool value2) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = StoreSwitch.getStaticField(_tableId, _keyTuple, 1, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Get value2 */ + function _getValue2(ResourceId _tableId) internal view returns (bool value2) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = StoreCore.getStaticField(_tableId, _keyTuple, 1, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Get value2 (using the specified store) */ + function getValue2(IStore _store, ResourceId _tableId) internal view returns (bool value2) { + bytes32[] memory _keyTuple = new bytes32[](0); + + bytes32 _blob = _store.getStaticField(_tableId, _keyTuple, 1, _fieldLayout); + return (_toBool(uint8(bytes1(_blob)))); + } + + /** Set value2 */ + function setValue2(ResourceId _tableId, bool value2) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreSwitch.setField(_tableId, _keyTuple, 1, abi.encodePacked((value2)), _fieldLayout); + } + + /** Set value2 */ + function _setValue2(ResourceId _tableId, bool value2) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreCore.setField(_tableId, _keyTuple, 1, abi.encodePacked((value2)), _fieldLayout); + } + + /** Set value2 (using the specified store) */ + function setValue2(IStore _store, ResourceId _tableId, bool value2) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + _store.setField(_tableId, _keyTuple, 1, abi.encodePacked((value2)), _fieldLayout); + } + + /** Get the full data */ + function get(ResourceId _tableId) internal view returns (TwoFieldsData memory _table) { + bytes32[] memory _keyTuple = new bytes32[](0); + + (bytes memory _staticData, PackedCounter _encodedLengths, bytes memory _dynamicData) = StoreSwitch.getRecord( + _tableId, + _keyTuple, + _fieldLayout + ); + return decode(_staticData, _encodedLengths, _dynamicData); + } + + /** Get the full data */ + function _get(ResourceId _tableId) internal view returns (TwoFieldsData memory _table) { + bytes32[] memory _keyTuple = new bytes32[](0); + + (bytes memory _staticData, PackedCounter _encodedLengths, bytes memory _dynamicData) = StoreCore.getRecord( + _tableId, + _keyTuple, + _fieldLayout + ); + return decode(_staticData, _encodedLengths, _dynamicData); + } + + /** Get the full data (using the specified store) */ + function get(IStore _store, ResourceId _tableId) internal view returns (TwoFieldsData memory _table) { + bytes32[] memory _keyTuple = new bytes32[](0); + + (bytes memory _staticData, PackedCounter _encodedLengths, bytes memory _dynamicData) = _store.getRecord( + _tableId, + _keyTuple, + _fieldLayout + ); + return decode(_staticData, _encodedLengths, _dynamicData); + } + + /** Set the full data using individual values */ + function set(ResourceId _tableId, bool value1, bool value2) internal { + bytes memory _staticData = encodeStatic(value1, value2); + + PackedCounter _encodedLengths; + bytes memory _dynamicData; + + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreSwitch.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData, _fieldLayout); + } + + /** Set the full data using individual values */ + function _set(ResourceId _tableId, bool value1, bool value2) internal { + bytes memory _staticData = encodeStatic(value1, value2); + + PackedCounter _encodedLengths; + bytes memory _dynamicData; + + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreCore.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData, _fieldLayout); + } + + /** Set the full data using individual values (using the specified store) */ + function set(IStore _store, ResourceId _tableId, bool value1, bool value2) internal { + bytes memory _staticData = encodeStatic(value1, value2); + + PackedCounter _encodedLengths; + bytes memory _dynamicData; + + bytes32[] memory _keyTuple = new bytes32[](0); + + _store.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData, _fieldLayout); + } + + /** Set the full data using the data struct */ + function set(ResourceId _tableId, TwoFieldsData memory _table) internal { + set(_tableId, _table.value1, _table.value2); + } + + /** Set the full data using the data struct */ + function _set(ResourceId _tableId, TwoFieldsData memory _table) internal { + set(_tableId, _table.value1, _table.value2); + } + + /** Set the full data using the data struct (using the specified store) */ + function set(IStore _store, ResourceId _tableId, TwoFieldsData memory _table) internal { + set(_store, _tableId, _table.value1, _table.value2); + } + + /** + * Decode the tightly packed blob of static data using this table's field layout + * Undefined behaviour for invalid blobs + */ + function decodeStatic(bytes memory _blob) internal pure returns (bool value1, bool value2) { + value1 = (_toBool(uint8(Bytes.slice1(_blob, 0)))); + + value2 = (_toBool(uint8(Bytes.slice1(_blob, 1)))); + } + + /** + * Decode the tightly packed blob using this table's field layout. + * Undefined behaviour for invalid blobs. + */ + function decode( + bytes memory _staticData, + PackedCounter, + bytes memory + ) internal pure returns (TwoFieldsData memory _table) { + (_table.value1, _table.value2) = decodeStatic(_staticData); + } + + /** Delete all data for given keys */ + function deleteRecord(ResourceId _tableId) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreSwitch.deleteRecord(_tableId, _keyTuple, _fieldLayout); + } + + /** Delete all data for given keys */ + function _deleteRecord(ResourceId _tableId) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + StoreCore.deleteRecord(_tableId, _keyTuple, _fieldLayout); + } + + /** Delete all data for given keys (using the specified store) */ + function deleteRecord(IStore _store, ResourceId _tableId) internal { + bytes32[] memory _keyTuple = new bytes32[](0); + + _store.deleteRecord(_tableId, _keyTuple, _fieldLayout); + } + + /** Tightly pack static data using this table's schema */ + function encodeStatic(bool value1, bool value2) internal pure returns (bytes memory) { + return abi.encodePacked(value1, value2); + } + + /** Tightly pack full data using this table's field layout */ + function encode(bool value1, bool value2) internal pure returns (bytes memory, PackedCounter, bytes memory) { + bytes memory _staticData = encodeStatic(value1, value2); + + PackedCounter _encodedLengths; + bytes memory _dynamicData; + + return (_staticData, _encodedLengths, _dynamicData); + } + + /** Encode keys as a bytes32 array using this table's field layout */ + function encodeKeyTuple() internal pure returns (bytes32[] memory) { + bytes32[] memory _keyTuple = new bytes32[](0); + + return _keyTuple; + } +} + +function _toBool(uint8 value) pure returns (bool result) { + assembly { + result := value + } +} From 6f9c35734357774b5f46e0f544c7ba7cf0ff3f10 Mon Sep 17 00:00:00 2001 From: alvarius Date: Thu, 21 Sep 2023 19:04:53 +0100 Subject: [PATCH 06/16] Update brown-garlics-lie.md --- .changeset/brown-garlics-lie.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index 5718e3d01e..eabd4f87ff 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -1,6 +1,8 @@ --- -"@latticexyz/world": patch +"@latticexyz/world": major --- - -Removed an access control check for when the `World` is calling itself. -The `World` should not have implicit access to all resources, but only to those where it actually has access based on the `namespaceId` or `resourceId`. +All `World` methods now revert if the `World` calls itself. +The `World` should never need to call itself, since all internal table operations are done as library calls, and all root system operations are done as delegate call to the system contract. +It should not be possible to make the `World` call itself as an external actor. +If it were possible to make the `World` call itself, it would be possible to write to internal tables that only the `World` should have access to. +As this is a very important invariance, we decided to codify it in an explicit requirement check in every `World` method, instead of just relying on making it impossible to trigger the `World` to call itself. From 3114329aef9e34dd8e78cd6b43d6eeefb1911cca Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 19:43:55 +0100 Subject: [PATCH 07/16] update test data --- test-data/world-logs.json | 284 +++++++++++++++++++------------------- 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/test-data/world-logs.json b/test-data/world-logs.json index 9ff96aa813..999167e9d1 100644 --- a/test-data/world-logs.json +++ b/test-data/world-logs.json @@ -6,9 +6,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000022000000000a0000000000002c00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000174626d756473746f72650000000000005461626c65730000000000000000000000000000000000000000000000000000000000000000000000000000000000600060030220202000000000000000000000000000000000000000000000000000002001005f000000000000000000000000000000000000000000000000000000006003025f5f5fc4c4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000077461626c654964000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000b6669656c644c61796f757400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000096b6579536368656d610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b76616c7565536368656d610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012616269456e636f6465644b65794e616d657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014616269456e636f6465644669656c644e616d6573000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x0", "transactionLogIndex": "0x0", @@ -21,9 +21,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000174626d756473746f72650000000000005461626c65730000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1", "transactionLogIndex": "0x1", @@ -36,9 +36,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a0000000000001400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000174626d756473746f726500000000000053746f7265486f6f6b7300000000000000000000000000000000000000000000000000000000000000000000000000600000000100000000000000000000000000000000000000000000000000000000002001005f00000000000000000000000000000000000000000000000000000000000001b6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000036b65790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2", "transactionLogIndex": "0x2", @@ -51,9 +51,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000174626d756473746f726500000000000053746f7265486f6f6b7300000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x3", "transactionLogIndex": "0x3", @@ -66,9 +66,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a0000000000001400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000174626d756473746f72650000000000005265736f75726365496473000000000000000000000000000000000000000000000000000000000000000000000000600001010001000000000000000000000000000000000000000000000000000000002001005f00000000000000000000000000000000000000000000000000000000010100600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a7265736f7572636549640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000066578697374730000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x4", "transactionLogIndex": "0x4", @@ -81,9 +81,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000174626d756473746f72650000000000005265736f75726365496473000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x5", "transactionLogIndex": "0x5", @@ -96,9 +96,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a00000000000014000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e616d6573706163654f776e6572000000000000000000000000000000000000000000000000000000000000000000600014010014000000000000000000000000000000000000000000000000000000002001005f00000000000000000000000000000000000000000000000000000000140100610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b6e616d657370616365496400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000056f776e6572000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x6", "transactionLogIndex": "0x6", @@ -111,9 +111,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e616d6573706163654f776e6572000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x7", "transactionLogIndex": "0x7", @@ -126,9 +126,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a000000000000140000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000042616c616e636573000000000000000000000000000000000000000000000000000000000000000000000000000000600020010020000000000000000000000000000000000000000000000000000000002001005f000000000000000000000000000000000000000000000000000000002001001f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b6e616d6573706163654964000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000762616c616e636500000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x8", "transactionLogIndex": "0x8", @@ -141,9 +141,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000042616c616e636573000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x9", "transactionLogIndex": "0x9", @@ -156,9 +156,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a00000000100000000000001a00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000174620000000000000000000000000000496e7374616c6c65644d6f64756c657300000000000000000000000000000000000000000000000000000000000000600014010014000000000000000000000000000000000000000000000000000000003002004f5f0000000000000000000000000000000000000000000000000000001401006100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000a6d6f64756c654e616d6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d617267756d656e74734861736800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d6d6f64756c654164647265737300000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xa", "transactionLogIndex": "0xa", @@ -171,9 +171,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000174620000000000000000000000000000496e7374616c6c65644d6f64756c657300000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xb", "transactionLogIndex": "0xb", @@ -186,9 +186,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a00000000100000000000001a0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000044656c65676174696f6e730000000000000000000000000000000000000000000000000000000000000000000000006000200100200000000000000000000000000000000000000000000000000000000028020061610000000000000000000000000000000000000000000000000000002001005f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000964656c656761746f720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964656c6567617465650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001364656c65676174696f6e436f6e74726f6c496400000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xc", "transactionLogIndex": "0xc", @@ -201,9 +201,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000044656c65676174696f6e73000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xd", "transactionLogIndex": "0xd", @@ -216,9 +216,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a00000000100000000000001a000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000005265736f75726365416363657373000000000000000000000000000000000000000000000000000000000000000000600001010001000000000000000000000000000000000000000000000000000000003402005f610000000000000000000000000000000000000000000000000000000101006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000a7265736f75726365496400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000663616c6c6572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000066163636573730000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xe", "transactionLogIndex": "0xe", @@ -231,9 +231,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000005265736f75726365416363657373000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0xf", "transactionLogIndex": "0xf", @@ -246,9 +246,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000010000000000a0000000000001a0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d7300000000000000000000000000000000000000000000000000000000000000000000000000000000600015020014010000000000000000000000000000000000000000000000000000002001005f000000000000000000000000000000000000000000000000000000001502006160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000873797374656d49640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000673797374656d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c7075626c69634163636573730000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x10", "transactionLogIndex": "0x10", @@ -261,9 +261,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d7300000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x11", "transactionLogIndex": "0x11", @@ -276,9 +276,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000010000000000a0000000000001a0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000046756e6374696f6e53656c6563746f72000000000000000000000000000000000000000000000000000000000000006000240200200400000000000000000000000000000000000000000000000000000004010043000000000000000000000000000000000000000000000000000000002402005f43000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001066756e6374696f6e53656c6563746f72000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000873797374656d4964000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001673797374656d46756e6374696f6e53656c6563746f7200000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x12", "transactionLogIndex": "0x12", @@ -291,9 +291,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000046756e6374696f6e53656c6563746f7200000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x13", "transactionLogIndex": "0x13", @@ -306,9 +306,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a000000000000140000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d486f6f6b73000000000000000000000000000000000000000000000000000000000000000000000000600000000100000000000000000000000000000000000000000000000000000000002001005f00000000000000000000000000000000000000000000000000000000000001b60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000873797374656d4964000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x14", "transactionLogIndex": "0x14", @@ -321,9 +321,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d486f6f6b73000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x15", "transactionLogIndex": "0x15", @@ -336,9 +336,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a000000000000140000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d52656769737472790000000000000000000000000000000000000000000000000000000000000000006000200100200000000000000000000000000000000000000000000000000000000014010061000000000000000000000000000000000000000000000000000000002001005f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000673797374656d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000873797374656d4964000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x16", "transactionLogIndex": "0x16", @@ -351,9 +351,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000017462000000000000000000000000000053797374656d5265676973747279000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x17", "transactionLogIndex": "0x17", @@ -366,9 +366,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000016e7300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x18", "transactionLogIndex": "0x18", @@ -381,9 +381,9 @@ "0x746200000000000000000000000000004e616d6573706163654f776e65720000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000016e730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x19", "transactionLogIndex": "0x19", @@ -396,9 +396,9 @@ "0x746200000000000000000000000000005265736f757263654163636573730000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000026e73000000000000000000000000000000000000000000000000000000000000000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1a", "transactionLogIndex": "0x1a", @@ -411,9 +411,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000173790000000000000000000000000000636f72652e730000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1b", "transactionLogIndex": "0x1b", @@ -426,9 +426,9 @@ "0x7462000000000000000000000000000053797374656d73000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000173790000000000000000000000000000636f72652e73000000000000000000000000000000000000000000000000000000000000000000000000000000000015cafac3dd18ac6c6e92c921884f9e4176737c052c0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1c", "transactionLogIndex": "0x1c", @@ -441,9 +441,9 @@ "0x7462000000000000000000000000000053797374656d52656769737472790000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cafac3dd18ac6c6e92c921884f9e4176737c052c000000000000000000000000000000000000000000000000000000000000002073790000000000000000000000000000636f72652e7300000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1d", "transactionLogIndex": "0x1d", @@ -456,9 +456,9 @@ "0x746200000000000000000000000000005265736f757263654163636573730000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000026e73000000000000000000000000000000000000000000000000000000000000000000000000000000000000cafac3dd18ac6c6e92c921884f9e4176737c052c00000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1e", "transactionLogIndex": "0x1e", @@ -471,9 +471,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000140554c3a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e730000000000000000000040554c3a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x1f", "transactionLogIndex": "0x1f", @@ -486,9 +486,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000018d53b20800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000008d53b208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x20", "transactionLogIndex": "0x20", @@ -501,9 +501,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001ef5d6bbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000ef5d6bbb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x21", "transactionLogIndex": "0x21", @@ -516,9 +516,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001c9c85a6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000c9c85a60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x22", "transactionLogIndex": "0x22", @@ -531,9 +531,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000145afd19900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e730000000000000000000045afd199000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x23", "transactionLogIndex": "0x23", @@ -546,9 +546,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000018da798da00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000008da798da000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x24", "transactionLogIndex": "0x24", @@ -561,9 +561,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000010ba51f4900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000000ba51f49000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x25", "transactionLogIndex": "0x25", @@ -576,9 +576,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001530f4b6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000530f4b60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x26", "transactionLogIndex": "0x26", @@ -591,9 +591,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000010560912900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e730000000000000000000005609129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x27", "transactionLogIndex": "0x27", @@ -606,9 +606,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001b29e408900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000b29e4089000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x28", "transactionLogIndex": "0x28", @@ -621,9 +621,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001d5f8337f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000d5f8337f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x29", "transactionLogIndex": "0x29", @@ -636,9 +636,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001a92813ad00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000a92813ad000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2a", "transactionLogIndex": "0x2a", @@ -651,9 +651,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000013350b6a900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000003350b6a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2b", "transactionLogIndex": "0x2b", @@ -666,9 +666,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000013c03a51c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000003c03a51c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2c", "transactionLogIndex": "0x2c", @@ -681,9 +681,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001b7a3c75600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e7300000000000000000000b7a3c756000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2d", "transactionLogIndex": "0x2d", @@ -696,9 +696,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000011d2257ba00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000636f72652e73000000000000000000001d2257ba000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2e", "transactionLogIndex": "0x2e", @@ -711,9 +711,9 @@ "0x74620000000000000000000000000000496e7374616c6c65644d6f64756c6573" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000002636f72652e6d0000000000000000000000000000000000000000000000000000c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4700000000000000000000000000000000000000000000000000000000000000014e7f1725e7734ce288f8367e1bb143e90bb3f0512000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x7e2f055f66d3576d1f74a5b4d50612da661bc8a0aadeb4a7bab1d68ebcec2987", + "transactionHash": "0x08b9293e6dccdfb5b0b5833d0131b28965c4368da93846dffe9b85d290b7dba7", "transactionIndex": "0x0", "logIndex": "0x2f", "transactionLogIndex": "0x2f", @@ -726,9 +726,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a000000000a00000000000014000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e756d626572000000000000000000000000000000000000000000000000000000000000000000000000000000000060000401000400000000000000000000000000000000000000000000000000000000040100030000000000000000000000000000000000000000000000000000000004010003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000036b65790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xfee34092d2be35f9cb4747048fba17f73969fdd2bea418fdabfd123e9fccfdd3", + "transactionHash": "0xc67d1009eb88cbfd3f7978bd8c4a3ef7be4a77548b62b86d51658eca803a19ca", "transactionIndex": "0x1", "logIndex": "0x30", "transactionLogIndex": "0x0", @@ -741,9 +741,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e756d6265720000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xfee34092d2be35f9cb4747048fba17f73969fdd2bea418fdabfd123e9fccfdd3", + "transactionHash": "0xc67d1009eb88cbfd3f7978bd8c4a3ef7be4a77548b62b86d51658eca803a19ca", "transactionIndex": "0x1", "logIndex": "0x31", "transactionLogIndex": "0x1", @@ -756,9 +756,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000010000000000a0000000000001a00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000174620000000000000000000000000000566563746f7200000000000000000000000000000000000000000000000000000000000000000000000000000000006000080200040400000000000000000000000000000000000000000000000000000004010003000000000000000000000000000000000000000000000000000000000802002323000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000036b6579000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017900000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xfdbe3cacafcfe2f5841a693f23a8cf6971ba5fd688185820eb3801cbee3a9929", + "transactionHash": "0x7da609d0c973afb2c9c92136b5ac637ffbd8104d3eb29c4c972cad6fa3463926", "transactionIndex": "0x2", "logIndex": "0x32", "transactionLogIndex": "0x0", @@ -771,9 +771,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000174620000000000000000000000000000566563746f720000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xfdbe3cacafcfe2f5841a693f23a8cf6971ba5fd688185820eb3801cbee3a9929", + "transactionHash": "0x7da609d0c973afb2c9c92136b5ac637ffbd8104d3eb29c4c972cad6fa3463926", "transactionIndex": "0x2", "logIndex": "0x33", "transactionLogIndex": "0x1", @@ -786,9 +786,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000a00000000040000000000000e000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e756d6265724c697374000000000000000000000000000000000000000000000000000000000000000000000000006000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x27e29a882fdeb2c02feeb5003780c26c767d29d19bf24a76e3b79849468fdc78", + "transactionHash": "0xd0f99765ceaac129b4ba5905e0ce6f2e40c6306baf049c770876a3bcf118e26d", "transactionIndex": "0x3", "logIndex": "0x34", "transactionLogIndex": "0x0", @@ -801,9 +801,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004e756d6265724c69737400000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x27e29a882fdeb2c02feeb5003780c26c767d29d19bf24a76e3b79849468fdc78", + "transactionHash": "0xd0f99765ceaac129b4ba5905e0ce6f2e40c6306baf049c770876a3bcf118e26d", "transactionIndex": "0x3", "logIndex": "0x35", "transactionLogIndex": "0x1", @@ -816,9 +816,9 @@ "0x74626d756473746f72650000000000005461626c657300000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000010000000001c0000000000002c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004d756c74690000000000000000000000000000000000000000000000000000000000000000000000000000000000006000210200200100000000000000000000000000000000000000000000000000000034040003601f2e000000000000000000000000000000000000000000000000002102003f60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000016100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000162000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000036e756d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000576616c7565000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x470b581c9a1cac85fda4feb069e47f881b6c6444c68ffe52385ff85f8e67f0b7", + "transactionHash": "0x7dc8e7e796af5bc299da96aab69da00fe23489ee3b9d85e0ebb3e9849d2772e4", "transactionIndex": "0x4", "logIndex": "0x36", "transactionLogIndex": "0x0", @@ -831,9 +831,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001746200000000000000000000000000004d756c7469000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x470b581c9a1cac85fda4feb069e47f881b6c6444c68ffe52385ff85f8e67f0b7", + "transactionHash": "0x7dc8e7e796af5bc299da96aab69da00fe23489ee3b9d85e0ebb3e9849d2772e4", "transactionIndex": "0x4", "logIndex": "0x37", "transactionLogIndex": "0x1", @@ -846,9 +846,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000173790000000000000000000000000000437573746f6d4572726f72735379737400000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xc7a43a7856187b487496b0246a8417e332ed34a586ce98b0bf80111dcf5387a3", + "transactionHash": "0x6134c8cd952eba1e84b1e068602534ea606a93b65a4c04fcd2e7784c47cb74b7", "transactionIndex": "0x5", "logIndex": "0x38", "transactionLogIndex": "0x0", @@ -861,9 +861,9 @@ "0x7462000000000000000000000000000053797374656d73000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000173790000000000000000000000000000437573746f6d4572726f72735379737400000000000000000000000000000000000000000000000000000000000000155fc8d32690cc91d4c39d9d3abcbd16989f8757070100000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xc7a43a7856187b487496b0246a8417e332ed34a586ce98b0bf80111dcf5387a3", + "transactionHash": "0x6134c8cd952eba1e84b1e068602534ea606a93b65a4c04fcd2e7784c47cb74b7", "transactionIndex": "0x5", "logIndex": "0x39", "transactionLogIndex": "0x1", @@ -876,9 +876,9 @@ "0x7462000000000000000000000000000053797374656d52656769737472790000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005fc8d32690cc91d4c39d9d3abcbd16989f875707000000000000000000000000000000000000000000000000000000000000002073790000000000000000000000000000437573746f6d4572726f727353797374", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xc7a43a7856187b487496b0246a8417e332ed34a586ce98b0bf80111dcf5387a3", + "transactionHash": "0x6134c8cd952eba1e84b1e068602534ea606a93b65a4c04fcd2e7784c47cb74b7", "transactionIndex": "0x5", "logIndex": "0x3a", "transactionLogIndex": "0x2", @@ -891,9 +891,9 @@ "0x746200000000000000000000000000005265736f757263654163636573730000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000026e730000000000000000000000000000000000000000000000000000000000000000000000000000000000005fc8d32690cc91d4c39d9d3abcbd16989f87570700000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xc7a43a7856187b487496b0246a8417e332ed34a586ce98b0bf80111dcf5387a3", + "transactionHash": "0x6134c8cd952eba1e84b1e068602534ea606a93b65a4c04fcd2e7784c47cb74b7", "transactionIndex": "0x5", "logIndex": "0x3b", "transactionLogIndex": "0x3", @@ -906,9 +906,9 @@ "0x74626d756473746f72650000000000005265736f757263654964730000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001737900000000000000000000000000004e756d6265724c69737453797374656d00000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xe43ef0b86a52b4da0f61cdc2ea334e5b7fa66f7588983f640e5deb328f669d51", + "transactionHash": "0x695a4db04d8e7bbe5721f8d701741aef5625b88b23a849d31ad0a2b9540b5fa6", "transactionIndex": "0x6", "logIndex": "0x3c", "transactionLogIndex": "0x0", @@ -921,9 +921,9 @@ "0x7462000000000000000000000000000053797374656d73000000000000000000" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001737900000000000000000000000000004e756d6265724c69737453797374656d00000000000000000000000000000000000000000000000000000000000000150165878a594ca255338adfa4d48449f69242eb8f0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xe43ef0b86a52b4da0f61cdc2ea334e5b7fa66f7588983f640e5deb328f669d51", + "transactionHash": "0x695a4db04d8e7bbe5721f8d701741aef5625b88b23a849d31ad0a2b9540b5fa6", "transactionIndex": "0x6", "logIndex": "0x3d", "transactionLogIndex": "0x1", @@ -936,9 +936,9 @@ "0x7462000000000000000000000000000053797374656d52656769737472790000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000165878a594ca255338adfa4d48449f69242eb8f0000000000000000000000000000000000000000000000000000000000000020737900000000000000000000000000004e756d6265724c69737453797374656d", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xe43ef0b86a52b4da0f61cdc2ea334e5b7fa66f7588983f640e5deb328f669d51", + "transactionHash": "0x695a4db04d8e7bbe5721f8d701741aef5625b88b23a849d31ad0a2b9540b5fa6", "transactionIndex": "0x6", "logIndex": "0x3e", "transactionLogIndex": "0x2", @@ -951,9 +951,9 @@ "0x746200000000000000000000000000005265736f757263654163636573730000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000026e730000000000000000000000000000000000000000000000000000000000000000000000000000000000000165878a594ca255338adfa4d48449f69242eb8f00000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xe43ef0b86a52b4da0f61cdc2ea334e5b7fa66f7588983f640e5deb328f669d51", + "transactionHash": "0x695a4db04d8e7bbe5721f8d701741aef5625b88b23a849d31ad0a2b9540b5fa6", "transactionIndex": "0x6", "logIndex": "0x3f", "transactionLogIndex": "0x3", @@ -966,9 +966,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000015f644e3c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002473790000000000000000000000000000437573746f6d4572726f7273537973745f644e3c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x8af9c1dc64c54b515e45eada457deeefb8c41f28a5dcd383b08e1974aba9deeb", + "transactionHash": "0x893811d12562ed9e9fbaeba1b854926d2e46d40cb993e57ae80af0ebb349c1fd", "transactionIndex": "0x7", "logIndex": "0x40", "transactionLogIndex": "0x0", @@ -981,9 +981,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001a4ece52c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024737900000000000000000000000000004e756d6265724c69737453797374656da4ece52c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x594595958fab259d43d21eff2b843d5f4a8b72eaba5bfc7d7ac57a64429baa46", + "transactionHash": "0x1592cb4f9be4afb5919b71fef97982aad555a6c4dfde8d376de6a296bed1a201", "transactionIndex": "0x8", "logIndex": "0x41", "transactionLogIndex": "0x0", @@ -996,9 +996,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001f7f0e440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024737900000000000000000000000000004e756d6265724c69737453797374656df7f0e440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x1ad0a4cb99bb91696c2fdc950ef8f725a033126b014ef9f8dc33fe5e60651a58", + "transactionHash": "0xa05e51bdaae6d0e8fb44e7101954c1dc280c0c197ace0499e81976d87231ea46", "transactionIndex": "0x9", "logIndex": "0x42", "transactionLogIndex": "0x0", @@ -1011,9 +1011,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001306d61a5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024737900000000000000000000000000004e756d6265724c69737453797374656d306d61a5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0x74242eea32fbe3313d212eb94d4b0e9a1b41d4a3ca73b8e43409652d0d1033b4", + "transactionHash": "0x6a76aeaeebbbfb6229a5cc8348f6f1f6621cf9104625f50c84e775a7710f32a0", "transactionIndex": "0xa", "logIndex": "0x43", "transactionLogIndex": "0x0", @@ -1026,9 +1026,9 @@ "0x7462000000000000000000000000000046756e6374696f6e53656c6563746f72" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001b8a44c7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024737900000000000000000000000000004e756d6265724c69737453797374656db8a44c7c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7704cb23795595159707f7ec7ef212f8a1727f88b980d34b605e994bb9f9e403", + "blockHash": "0x57d3773f3ee2f802840a19ecf23d4f59fc728efebf06eee6874bf828ea01d014", "blockNumber": "0x4", - "transactionHash": "0xb7ae5d81eac3cada387ee8aa84b200810a20239fc9d28c8d88b1928b52df89fe", + "transactionHash": "0xfd3053eb72396b19de3535167a1edc92ef0a6210c9ecba1ad01e30a7f33538aa", "transactionIndex": "0xb", "logIndex": "0x44", "transactionLogIndex": "0x0", @@ -1041,9 +1041,9 @@ "0x746200000000000000000000000000004e756d6265724c697374000000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000001a400000000000000000000000000000000000000000000000000000000", - "blockHash": "0x59ae5d5807af461e28ea34b5c32a06c5deb94686c0039bc439cd2c5d4f000cc2", + "blockHash": "0x8d6fd7a2752d222f0951b3e0c3b4f823dc585b3857171c3575ab6a47b434b2c4", "blockNumber": "0x5", - "transactionHash": "0x36889a5ee3c55bfaac027f3581de07e578bada31ae0ac3b015ce6eb8977ef084", + "transactionHash": "0x55b3ca7cb3919467ed19814185e085c84e86dc15736546083beb64f76097991a", "transactionIndex": "0x0", "logIndex": "0x0", "transactionLogIndex": "0x0", @@ -1056,9 +1056,9 @@ "0x746200000000000000000000000000004e756d6265724c697374000000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000800000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000004500000000000000000000000000000000000000000000000000000000", - "blockHash": "0x59ae5d5807af461e28ea34b5c32a06c5deb94686c0039bc439cd2c5d4f000cc2", + "blockHash": "0x8d6fd7a2752d222f0951b3e0c3b4f823dc585b3857171c3575ab6a47b434b2c4", "blockNumber": "0x5", - "transactionHash": "0x5feacc4cdda19482f80e612fb3e7d8e3d5c9260b14a2da727f882a2f3d7dd07c", + "transactionHash": "0xdadc772a464ca74d1811962d71891c791c8876406930608694647a0ad039b3a1", "transactionIndex": "0x1", "logIndex": "0x1", "transactionLogIndex": "0x0", From 0fa29cc49728680ce4da183abc7415eb66087a00 Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 22:11:57 +0100 Subject: [PATCH 08/16] upgrade modules to use delegatecall --- packages/world/src/World.sol | 2 +- .../keyswithvalue/KeysWithValueModule.sol | 24 ++++++++++++++++--- .../uniqueentity/UniqueEntityModule.sol | 18 +++++++++++++- packages/world/test/World.t.sol | 17 +++++++++---- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/packages/world/src/World.sol b/packages/world/src/World.sol index f9c2bd0ad1..c63a42042a 100644 --- a/packages/world/src/World.sol +++ b/packages/world/src/World.sol @@ -311,7 +311,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { /** * Fallback function to call registered function selectors */ - fallback() external payable { + fallback() external payable requireNoCallback { (bytes32 systemId, bytes4 systemFunctionSelector) = FunctionSelectors._get(msg.sig); if (systemId == 0) revert FunctionSelectorNotFound(msg.sig); diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol index 41c56358a9..ba2b037eed 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.21; +import { console } from "forge-std/console.sol"; + import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { BEFORE_SET_RECORD, BEFORE_SPLICE_STATIC_DATA, AFTER_SPLICE_STATIC_DATA, BEFORE_SPLICE_DYNAMIC_DATA, AFTER_SPLICE_DYNAMIC_DATA, BEFORE_DELETE_RECORD } from "@latticexyz/store/src/storeHookTypes.sol"; import { Module } from "../../Module.sol"; @@ -46,13 +48,29 @@ contract KeysWithValueModule is Module { IBaseWorld world = IBaseWorld(_world()); // Register the target table - KeysWithValue.register(world, targetTableSelector); + (bool success, bytes memory returnData) = address(world).delegatecall( + abi.encodeCall( + world.registerTable, + ( + targetTableSelector, + KeysWithValue.getFieldLayout(), + KeysWithValue.getKeySchema(), + KeysWithValue.getValueSchema(), + KeysWithValue.getKeyNames(), + KeysWithValue.getFieldNames() + ) + ) + ); // Grant the hook access to the target table - world.grantAccess(targetTableSelector, address(hook)); + (success, returnData) = address(world).delegatecall( + abi.encodeCall(world.grantAccess, (targetTableSelector, address(hook))) + ); + + if (!success) revertWithBytes(returnData); // Register a hook that is called when a value is set in the source table - (bool success, bytes memory returnData) = address(world).delegatecall( + (success, returnData) = address(world).delegatecall( abi.encodeCall( world.registerStoreHook, ( diff --git a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol index 981d5efb1f..8d7cbb5490 100644 --- a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol +++ b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol @@ -5,6 +5,7 @@ import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { Module } from "../../Module.sol"; import { WorldContextConsumer } from "../../WorldContext.sol"; +import { revertWithBytes } from "../../revertWithBytes.sol"; import { UniqueEntity } from "./tables/UniqueEntity.sol"; import { UniqueEntitySystem } from "./UniqueEntitySystem.sol"; @@ -25,7 +26,22 @@ contract UniqueEntityModule is Module { } function installRoot(bytes memory args) public { - install(args); + IBaseWorld world = IBaseWorld(_world()); + + // Register table + UniqueEntity._register(TABLE_ID); + + // Register system + (bool success, bytes memory data) = address(world).delegatecall( + abi.encodeCall(world.registerSystem, (SYSTEM_ID, uniqueEntitySystem, true)) + ); + if (!success) revertWithBytes(data); + + // Register system's functions + (success, data) = address(world).delegatecall( + abi.encodeCall(world.registerFunctionSelector, (SYSTEM_ID, "getUniqueEntity", "()")) + ); + if (!success) revertWithBytes(data); } function install(bytes memory) public { diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 0beabca97b..451d3861dd 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -452,7 +452,10 @@ contract WorldTest is Test, GasReporter { world.registerTable(otherTableId, fieldLayout, defaultKeySchema, valueSchema, keyNames, fieldNames); // Expect the World to not be allowed to call registerTable via an external call - _expectAccessDenied(address(world), namespace, "", RESOURCE_NAMESPACE); + vm.prank(address(world)); + vm.expectRevert( + abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.registerTable.selector) + ); world.registerTable(otherTableId, fieldLayout, defaultKeySchema, valueSchema, keyNames, fieldNames); } @@ -542,8 +545,11 @@ contract WorldTest is Test, GasReporter { true ); - // Expect the registration to fail when coming from the World (since the World address doesn't have access) - _expectAccessDenied(address(world), "", "", RESOURCE_NAMESPACE); + // Expect the registration to fail when coming from the World + vm.prank(address(world)); + vm.expectRevert( + abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.registerSystem.selector) + ); world.registerSystem( WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "", name: "rootSystem" }), yetAnotherSystem, @@ -1376,7 +1382,10 @@ contract WorldTest is Test, GasReporter { world.registerRootFunctionSelector(systemId, worldFunc, sysFunc); // Expect the World to not be able to register a root function selector when calling the function externally - _expectAccessDenied(address(world), "", "", RESOURCE_NAMESPACE); + vm.prank(address(world)); + vm.expectRevert( + abi.encodeWithSelector(IWorldErrors.WorldCallbackNotAllowed.selector, world.registerRootFunctionSelector.selector) + ); world.registerRootFunctionSelector(systemId, "smth", "smth"); startGasReport("Register a root function selector"); From 5ae4d6c8f9503f95db411a3f6998ac13a92e8d6f Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 22:13:14 +0100 Subject: [PATCH 09/16] update gas-report --- packages/world/gas-report.json | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 33ecf3d0f4..28112555d3 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -33,19 +33,19 @@ "file": "test/CallBatch.t.sol", "test": "testCallBatchReturnData", "name": "call systems with callBatch", - "gasUsed": 45603 + "gasUsed": 45624 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1415201 + "gasUsed": 1415306 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1415201 + "gasUsed": 1415306 }, { "file": "test/KeysInTableModule.t.sol", @@ -57,13 +57,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1415201 + "gasUsed": 1415306 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1415201 + "gasUsed": 1415306 }, { "file": "test/KeysInTableModule.t.sol", @@ -81,7 +81,7 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1415201 + "gasUsed": 1415306 }, { "file": "test/KeysInTableModule.t.sol", @@ -99,7 +99,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 654812 + "gasUsed": 656402 }, { "file": "test/KeysWithValueModule.t.sol", @@ -117,7 +117,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 654812 + "gasUsed": 656402 }, { "file": "test/KeysWithValueModule.t.sol", @@ -129,7 +129,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 654812 + "gasUsed": 656402 }, { "file": "test/KeysWithValueModule.t.sol", @@ -147,7 +147,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 654812 + "gasUsed": 656402 }, { "file": "test/KeysWithValueModule.t.sol", @@ -231,7 +231,7 @@ "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromCallboundDelegation", "name": "register a callbound delegation", - "gasUsed": 114750 + "gasUsed": 114771 }, { "file": "test/StandardDelegationsModule.t.sol", @@ -243,7 +243,7 @@ "file": "test/StandardDelegationsModule.t.sol", "test": "testCallFromTimeboundDelegation", "name": "register a timebound delegation", - "gasUsed": 109245 + "gasUsed": 109266 }, { "file": "test/StandardDelegationsModule.t.sol", @@ -255,25 +255,25 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 679866 + "gasUsed": 680060 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 52168 + "gasUsed": 52189 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 670104 + "gasUsed": 647162 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 52168 + "gasUsed": 52189 }, { "file": "test/World.t.sol", @@ -285,7 +285,7 @@ "file": "test/World.t.sol", "test": "testCallFromUnlimitedDelegation", "name": "register an unlimited delegation", - "gasUsed": 50638 + "gasUsed": 50659 }, { "file": "test/World.t.sol", @@ -309,43 +309,43 @@ "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 59362 + "gasUsed": 59383 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 52987 + "gasUsed": 53008 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 79928 + "gasUsed": 79949 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 123240 + "gasUsed": 123261 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 74900 + "gasUsed": 74921 }, { "file": "test/World.t.sol", "test": "testRegisterSystem", "name": "register a system", - "gasUsed": 165793 + "gasUsed": 165814 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 641176 + "gasUsed": 641197 }, { "file": "test/World.t.sol", From a1a2cefc1fe524bd6515d0a1b9e9c3f49221d5fd Mon Sep 17 00:00:00 2001 From: alvarius Date: Thu, 21 Sep 2023 22:17:46 +0100 Subject: [PATCH 10/16] Update brown-garlics-lie.md --- .changeset/brown-garlics-lie.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index eabd4f87ff..634ae1c7d8 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -2,7 +2,11 @@ "@latticexyz/world": major --- All `World` methods now revert if the `World` calls itself. -The `World` should never need to call itself, since all internal table operations are done as library calls, and all root system operations are done as delegate call to the system contract. +The `World` should never need to externally call itself, since all internal table operations happen via library calls, and all root system operations happen via delegate call. + It should not be possible to make the `World` call itself as an external actor. If it were possible to make the `World` call itself, it would be possible to write to internal tables that only the `World` should have access to. -As this is a very important invariance, we decided to codify it in an explicit requirement check in every `World` method, instead of just relying on making it impossible to trigger the `World` to call itself. +As this is a very important invariance, we decided to codify it in an explicit requirement check in every `World` method, rather than of just relying on making it impossible to trigger the `World` to call itself. + +This is a breaking change for modules that previously used external calls to the `World` in the `installRoot` method. +In the `installRoot` method, the `World` can only be called via `delegatecall`, and table operations should be performed via the internal table methods (e.g. `_set` instead of `set`). From 1c6087894c2e7e7cc016326b5fd288ea5bf2f268 Mon Sep 17 00:00:00 2001 From: alvarius Date: Thu, 21 Sep 2023 22:24:33 +0100 Subject: [PATCH 11/16] Update brown-garlics-lie.md --- .changeset/brown-garlics-lie.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index 634ae1c7d8..316c75053f 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -10,3 +10,15 @@ As this is a very important invariance, we decided to codify it in an explicit r This is a breaking change for modules that previously used external calls to the `World` in the `installRoot` method. In the `installRoot` method, the `World` can only be called via `delegatecall`, and table operations should be performed via the internal table methods (e.g. `_set` instead of `set`). + +Example for how to replacing external calls to `world` in `installRoot` with `delegatecall`: +```diff ++ import { revertWithBytes } from "@latticexyz/world/src/revertWithBytes.sol"; + +- world.grantAccess(tableId, address(hook)); ++ (bool success, bytes memory returnData) = address(world).delegatecall( ++ abi.encodeCall(world.grantAccess, (tableId, address(hook))) ++ ); + ++ if (!success) revertWithBytes(returnData); +``` From 9ae0c12fe2a10114e033eeaea1240c97f2a1d31f Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 22:38:55 +0100 Subject: [PATCH 12/16] prettier --- .changeset/brown-garlics-lie.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index 316c75053f..c4a7680d17 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -1,6 +1,7 @@ --- "@latticexyz/world": major --- + All `World` methods now revert if the `World` calls itself. The `World` should never need to externally call itself, since all internal table operations happen via library calls, and all root system operations happen via delegate call. From 4438df8cd3ee9a366bea37b616d529619eeeafb4 Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 21 Sep 2023 22:51:31 +0100 Subject: [PATCH 13/16] prettiest --- .changeset/brown-garlics-lie.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index c4a7680d17..37da848532 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -13,6 +13,7 @@ This is a breaking change for modules that previously used external calls to the In the `installRoot` method, the `World` can only be called via `delegatecall`, and table operations should be performed via the internal table methods (e.g. `_set` instead of `set`). Example for how to replacing external calls to `world` in `installRoot` with `delegatecall`: + ```diff + import { revertWithBytes } from "@latticexyz/world/src/revertWithBytes.sol"; From 0118a25d047c07e793ef7bf0645019305cf30172 Mon Sep 17 00:00:00 2001 From: alvarius Date: Fri, 22 Sep 2023 11:37:48 +0100 Subject: [PATCH 14/16] Apply suggestions from code review --- .changeset/brown-garlics-lie.md | 4 ++-- packages/world/src/modules/core/constants.sol | 5 ++--- .../world/src/modules/keyswithvalue/KeysWithValueModule.sol | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.changeset/brown-garlics-lie.md b/.changeset/brown-garlics-lie.md index 37da848532..b8c963d98f 100644 --- a/.changeset/brown-garlics-lie.md +++ b/.changeset/brown-garlics-lie.md @@ -7,12 +7,12 @@ The `World` should never need to externally call itself, since all internal tabl It should not be possible to make the `World` call itself as an external actor. If it were possible to make the `World` call itself, it would be possible to write to internal tables that only the `World` should have access to. -As this is a very important invariance, we decided to codify it in an explicit requirement check in every `World` method, rather than of just relying on making it impossible to trigger the `World` to call itself. +As this is a very important invariance, we made it explicit in a requirement check in every `World` method, rather than just relying on making it impossible to trigger the `World` to call itself. This is a breaking change for modules that previously used external calls to the `World` in the `installRoot` method. In the `installRoot` method, the `World` can only be called via `delegatecall`, and table operations should be performed via the internal table methods (e.g. `_set` instead of `set`). -Example for how to replacing external calls to `world` in `installRoot` with `delegatecall`: +Example for how to replace external calls to `world` in root systems / root modules (`installRoot`) with `delegatecall`: ```diff + import { revertWithBytes } from "@latticexyz/world/src/revertWithBytes.sol"; diff --git a/packages/world/src/modules/core/constants.sol b/packages/world/src/modules/core/constants.sol index ab3e173ecc..e228f9d3bf 100644 --- a/packages/world/src/modules/core/constants.sol +++ b/packages/world/src/modules/core/constants.sol @@ -6,9 +6,8 @@ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol"; import { ROOT_NAMESPACE } from "../../constants.sol"; import { RESOURCE_SYSTEM } from "../../worldResourceTypes.sol"; -bytes16 constant CORE_MODULE_NAME = bytes16("core.m"); -bytes16 constant CORE_SYSTEM_NAME = bytes16("core.s"); +bytes16 constant CORE_MODULE_NAME = bytes16("core"); ResourceId constant CORE_SYSTEM_ID = ResourceId.wrap( - bytes32(abi.encodePacked(RESOURCE_SYSTEM, ROOT_NAMESPACE, CORE_SYSTEM_NAME)) + bytes32(abi.encodePacked(RESOURCE_SYSTEM, ROOT_NAMESPACE, CORE_MODULE_NAME)) ); diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol index ba2b037eed..ea0eb947e4 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol @@ -1,8 +1,5 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.21; - -import { console } from "forge-std/console.sol"; - import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { BEFORE_SET_RECORD, BEFORE_SPLICE_STATIC_DATA, AFTER_SPLICE_STATIC_DATA, BEFORE_SPLICE_DYNAMIC_DATA, AFTER_SPLICE_DYNAMIC_DATA, BEFORE_DELETE_RECORD } from "@latticexyz/store/src/storeHookTypes.sol"; import { Module } from "../../Module.sol"; From 3dc1a2d9d8842e3f7c501f4271188ca858a75fa2 Mon Sep 17 00:00:00 2001 From: alvrs Date: Fri, 22 Sep 2023 11:50:48 +0100 Subject: [PATCH 15/16] fix world factory test --- packages/world/test/Factories.t.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/world/test/Factories.t.sol b/packages/world/test/Factories.t.sol index a0bbff1890..c6a9ee6087 100644 --- a/packages/world/test/Factories.t.sol +++ b/packages/world/test/Factories.t.sol @@ -8,6 +8,7 @@ import { WORLD_VERSION } from "../src/version.sol"; import { World } from "../src/World.sol"; import { ResourceId } from "../src/WorldResourceId.sol"; import { CoreModule } from "../src/modules/core/CoreModule.sol"; +import { CORE_MODULE_NAME } from "../src/modules/core/constants.sol"; import { Create2Factory } from "../src/factories/Create2Factory.sol"; import { WorldFactory } from "../src/factories/WorldFactory.sol"; import { IWorldFactory } from "../src/factories/IWorldFactory.sol"; @@ -72,7 +73,7 @@ contract FactoriesTest is Test { StoreSwitch.setStoreAddress(calculatedAddress); // Retrieve CoreModule address from InstalledModule table - address installedModule = InstalledModules.get(bytes16("core.m"), keccak256(new bytes(0))); + address installedModule = InstalledModules.get(CORE_MODULE_NAME, keccak256(new bytes(0))); // Confirm correct Core is installed assertEq(installedModule, address(coreModule)); From 0ad8bff64f75513d99c84831eba2b33da62b1146 Mon Sep 17 00:00:00 2001 From: alvrs Date: Fri, 22 Sep 2023 11:53:49 +0100 Subject: [PATCH 16/16] remove unnecessary check and rerun gas report --- packages/world/gas-report.json | 20 ++++++++++---------- packages/world/src/World.sol | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 28112555d3..62aff370c5 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -39,13 +39,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1415306 + "gasUsed": 1415285 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1415306 + "gasUsed": 1415285 }, { "file": "test/KeysInTableModule.t.sol", @@ -57,13 +57,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1415306 + "gasUsed": 1415285 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1415306 + "gasUsed": 1415285 }, { "file": "test/KeysInTableModule.t.sol", @@ -81,7 +81,7 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1415306 + "gasUsed": 1415285 }, { "file": "test/KeysInTableModule.t.sol", @@ -99,7 +99,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 656402 + "gasUsed": 656381 }, { "file": "test/KeysWithValueModule.t.sol", @@ -117,7 +117,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 656402 + "gasUsed": 656381 }, { "file": "test/KeysWithValueModule.t.sol", @@ -129,7 +129,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 656402 + "gasUsed": 656381 }, { "file": "test/KeysWithValueModule.t.sol", @@ -147,7 +147,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 656402 + "gasUsed": 656381 }, { "file": "test/KeysWithValueModule.t.sol", @@ -267,7 +267,7 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 647162 + "gasUsed": 647141 }, { "file": "test/UniqueEntityModule.t.sol", diff --git a/packages/world/src/World.sol b/packages/world/src/World.sol index c63a42042a..9627fea7cf 100644 --- a/packages/world/src/World.sol +++ b/packages/world/src/World.sol @@ -87,7 +87,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { _installRootModule(module, args); } - function _installRootModule(IModule module, bytes memory args) internal requireNoCallback { + function _installRootModule(IModule module, bytes memory args) internal { // Require the provided address to implement the IModule interface requireInterface(address(module), MODULE_INTERFACE_ID);