From 28fdf8d3ccc6a95eafe7c13fba0e281352498fdc Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 19:38:45 +0300 Subject: [PATCH 01/25] refactor(store): replace isStore with storeAddress --- packages/store/abi/IStore.sol/IStore.abi.json | 26 ++- .../abi/IStore.sol/IStoreConsumer.abi.json | 21 ++ .../store/abi/IStore.sol/IStoreData.abi.json | 26 ++- .../store/abi/IStore.sol/IStoreHook.abi.json | 19 ++ .../store/abi/IStore.sol/IStoreRead.abi.json | 18 +- .../MirrorSubscriber.abi.json | 203 ++++++++++++++++++ .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ++ .../abi/StoreHook.sol/StoreHook.abi.json | 118 ++++++++++ .../abi/StoreMock.sol/StoreMock.abi.json | 37 +++- .../abi/StoreRead.sol/StoreRead.abi.json | 29 ++- .../StoreReadWithStubs.abi.json | 37 +++- .../abi/StoreSwitch.sol/StoreSwitch.abi.json | 10 +- .../store/abi/console.sol/console.abi.json | 1 + packages/store/gas-report.json | 90 ++++---- packages/store/src/IStore.sol | 19 +- packages/store/src/StoreConsumer.sol | 16 ++ packages/store/src/StoreHook.sol | 13 ++ packages/store/src/StoreRead.sol | 6 +- packages/store/src/StoreSwitch.sol | 27 ++- packages/store/test/MirrorSubscriber.sol | 35 +++ packages/store/test/StoreCore.t.sol | 31 +-- packages/store/test/StoreCoreGas.t.sol | 31 +-- packages/store/test/StoreSwitch.t.sol | 13 +- 23 files changed, 679 insertions(+), 168 deletions(-) create mode 100644 packages/store/abi/IStore.sol/IStoreConsumer.abi.json create mode 100644 packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json create mode 100644 packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json create mode 100644 packages/store/abi/StoreHook.sol/StoreHook.abi.json create mode 100644 packages/store/abi/console.sol/console.abi.json create mode 100644 packages/store/src/StoreConsumer.sol create mode 100644 packages/store/src/StoreHook.sol create mode 100644 packages/store/test/MirrorSubscriber.sol diff --git a/packages/store/abi/IStore.sol/IStore.abi.json b/packages/store/abi/IStore.sol/IStore.abi.json index fa4b3d868f..5767c6757d 100644 --- a/packages/store/abi/IStore.sol/IStore.abi.json +++ b/packages/store/abi/IStore.sol/IStore.abi.json @@ -428,13 +428,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -606,6 +599,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreConsumer.abi.json b/packages/store/abi/IStore.sol/IStoreConsumer.abi.json new file mode 100644 index 0000000000..24ce1a4cb2 --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreData.abi.json b/packages/store/abi/IStore.sol/IStoreData.abi.json index 44c5939df8..80b613f33e 100644 --- a/packages/store/abi/IStore.sol/IStoreData.abi.json +++ b/packages/store/abi/IStore.sol/IStoreData.abi.json @@ -290,13 +290,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -404,6 +397,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreHook.abi.json b/packages/store/abi/IStore.sol/IStoreHook.abi.json index f192f8efc5..b1a5ec5fd9 100644 --- a/packages/store/abi/IStore.sol/IStoreHook.abi.json +++ b/packages/store/abi/IStore.sol/IStoreHook.abi.json @@ -95,5 +95,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreRead.abi.json b/packages/store/abi/IStore.sol/IStoreRead.abi.json index 182dfafa10..171c382553 100644 --- a/packages/store/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/store/abi/IStore.sol/IStoreRead.abi.json @@ -198,9 +198,21 @@ "type": "function" }, { - "inputs": [], - "name": "isStore", - "outputs": [], + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json new file mode 100644 index 0000000000..53d8d5785b --- /dev/null +++ b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json @@ -0,0 +1,203 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "schema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + } + ], + "name": "onDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json b/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json new file mode 100644 index 0000000000..927b8ed2da --- /dev/null +++ b/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreHook.sol/StoreHook.abi.json b/packages/store/abi/StoreHook.sol/StoreHook.abi.json new file mode 100644 index 0000000000..086ec0e67d --- /dev/null +++ b/packages/store/abi/StoreHook.sol/StoreHook.abi.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + } + ], + "name": "onDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json b/packages/store/abi/StoreMock.sol/StoreMock.abi.json index b6a0214721..dcd5374951 100644 --- a/packages/store/abi/StoreMock.sol/StoreMock.abi.json +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json @@ -126,6 +126,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -465,13 +476,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -643,6 +647,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json b/packages/store/abi/StoreRead.sol/StoreRead.abi.json index d3224ec101..b6752912dc 100644 --- a/packages/store/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json @@ -110,6 +110,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -309,9 +320,21 @@ "type": "function" }, { - "inputs": [], - "name": "isStore", - "outputs": [], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json index 14a409eab1..a718e994e6 100644 --- a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json +++ b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json @@ -131,6 +131,17 @@ "name": "StoreReadWithStubs_NotImplemented", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -470,13 +481,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -648,6 +652,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json b/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json index 613386a47c..554b526e5b 100644 --- a/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,7 +1,13 @@ [ { - "inputs": [], - "name": "StoreSwitch_InvalidInsideConstructor", + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", "type": "error" } ] \ No newline at end of file diff --git a/packages/store/abi/console.sol/console.abi.json b/packages/store/abi/console.sol/console.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/console.sol/console.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index 7df41d1e35..ca4bdecdbc 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -99,7 +99,7 @@ "file": "test/KeyEncoding.t.sol", "test": "testRegisterAndGetSchema", "name": "register KeyEncoding schema", - "gasUsed": 64686 + "gasUsed": 65082 }, { "file": "test/Mixed.t.sol", @@ -111,19 +111,19 @@ "file": "test/Mixed.t.sol", "test": "testRegisterAndGetSchema", "name": "register Mixed schema", - "gasUsed": 61218 + "gasUsed": 61537 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "set record in Mixed", - "gasUsed": 112166 + "gasUsed": 112805 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "get record from Mixed", - "gasUsed": 13455 + "gasUsed": 13775 }, { "file": "test/PackedCounter.t.sol", @@ -333,25 +333,25 @@ "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (cold, 1 slot, 1 uint32 item)", - "gasUsed": 29291 + "gasUsed": 29687 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (warm, 1 slot, 1 uint32 item)", - "gasUsed": 19346 + "gasUsed": 19743 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (cold, 2 slots, 10 uint32 items)", - "gasUsed": 31174 + "gasUsed": 31570 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (warm, 2 slots, 10 uint32 items)", - "gasUsed": 19229 + "gasUsed": 19626 }, { "file": "test/StoreCoreGas.t.sol", @@ -387,7 +387,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testDeleteData", "name": "delete record (complex data, 3 slots)", - "gasUsed": 10994 + "gasUsed": 11325 }, { "file": "test/StoreCoreGas.t.sol", @@ -405,61 +405,61 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "register subscriber", - "gasUsed": 65560 + "gasUsed": 66214 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 73961 + "gasUsed": 74919 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set static field on table with subscriber", - "gasUsed": 32051 + "gasUsed": 33006 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "delete record on table with subscriber", - "gasUsed": 24585 + "gasUsed": 25526 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "register subscriber", - "gasUsed": 65560 + "gasUsed": 66214 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 167398 + "gasUsed": 168356 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) field on table with subscriber", - "gasUsed": 35081 + "gasUsed": 36035 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "delete (dynamic) record on table with subscriber", - "gasUsed": 26057 + "gasUsed": 26998 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (1 slot, 1 uint32 item)", - "gasUsed": 17065 + "gasUsed": 17397 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (2 slots, 10 uint32 items)", - "gasUsed": 39781 + "gasUsed": 40114 }, { "file": "test/StoreCoreGas.t.sol", @@ -483,7 +483,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetDynamicData", "name": "set complex record with dynamic data (4 slots)", - "gasUsed": 107707 + "gasUsed": 108038 }, { "file": "test/StoreCoreGas.t.sol", @@ -525,19 +525,19 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (1 slot)", - "gasUsed": 37985 + "gasUsed": 38316 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "get static field (1 slot)", - "gasUsed": 2975 + "gasUsed": 2976 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (overlap 2 slot)", - "gasUsed": 35007 + "gasUsed": 35337 }, { "file": "test/StoreCoreGas.t.sol", @@ -549,7 +549,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, first dynamic field)", - "gasUsed": 57386 + "gasUsed": 57718 }, { "file": "test/StoreCoreGas.t.sol", @@ -561,31 +561,31 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, second dynamic field)", - "gasUsed": 35518 + "gasUsed": 35851 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "get dynamic field (1 slot, second dynamic field)", - "gasUsed": 3826 + "gasUsed": 3827 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "set static record (1 slot)", - "gasUsed": 37374 + "gasUsed": 37705 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "get static record (1 slot)", - "gasUsed": 1320 + "gasUsed": 1321 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticDataSpanningWords", "name": "set static record (2 slots)", - "gasUsed": 59942 + "gasUsed": 60272 }, { "file": "test/StoreCoreGas.t.sol", @@ -597,79 +597,79 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetMetadata", "name": "StoreCore: set table metadata", - "gasUsed": 251866 + "gasUsed": 252528 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "update in field (1 slot, 1 uint32 item)", - "gasUsed": 16605 + "gasUsed": 16938 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "push to field (2 slots, 6 uint64 items)", - "gasUsed": 17696 + "gasUsed": 18028 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 250181 + "gasUsed": 250962 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "get record from StoreMetadataTable", - "gasUsed": 12116 + "gasUsed": 12503 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsDelegatecall", "name": "check if delegatecall", - "gasUsed": 683 + "gasUsed": 1018 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsNoDelegatecall", "name": "check if delegatecall", - "gasUsed": 703 + "gasUsed": 1014 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "set field in Callbacks", - "gasUsed": 63203 + "gasUsed": 63952 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "get field from Callbacks (warm)", - "gasUsed": 5785 + "gasUsed": 6161 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "push field to Callbacks", - "gasUsed": 40890 + "gasUsed": 41642 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "set field in Hooks", - "gasUsed": 63360 + "gasUsed": 64109 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "get field from Hooks (warm)", - "gasUsed": 5935 + "gasUsed": 6310 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "push field to Hooks", - "gasUsed": 40881 + "gasUsed": 41632 }, { "file": "test/tightcoder/DecodeSlice.t.sol", @@ -729,18 +729,18 @@ "file": "test/Vector2.t.sol", "test": "testRegisterAndGetSchema", "name": "register Vector2 schema", - "gasUsed": 57995 + "gasUsed": 58403 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "set Vector2 record", - "gasUsed": 38660 + "gasUsed": 39477 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "get Vector2 record", - "gasUsed": 5090 + "gasUsed": 5499 } ] diff --git a/packages/store/src/IStore.sol b/packages/store/src/IStore.sol index d76cfe604d..677f64a316 100644 --- a/packages/store/src/IStore.sol +++ b/packages/store/src/IStore.sol @@ -4,7 +4,17 @@ pragma solidity >=0.8.0; import { IStoreErrors } from "./IStoreErrors.sol"; import { Schema } from "./Schema.sol"; -interface IStoreRead { +interface IStoreConsumer { + // TODO: benchmark this vs. using a known storage slot to determine the Store address + // (see https://github.com/latticexyz/mud/issues/444) + /** + * Returns the Store address used by this consumer (like Hooks, Store itself, World Systems, or tests/scripts) + * for StoreSwitch to determine how to interact with the Store. + */ + function storeAddress(address msgSender) external view returns (address storeAddress); +} + +interface IStoreRead is IStoreConsumer { function getSchema(bytes32 table) external view returns (Schema schema); function getKeySchema(bytes32 table) external view returns (Schema schema); @@ -35,11 +45,6 @@ interface IStoreRead { uint256 start, uint256 end ) external view returns (bytes memory data); - - // If this function exists on the contract, it is a store - // TODO: benchmark this vs. using a known storage slot to determine whether a contract is a Store - // (see https://github.com/latticexyz/mud/issues/444) - function isStore() external view; } interface IStoreWrite { @@ -104,7 +109,7 @@ interface IStoreRegistration { interface IStore is IStoreData, IStoreRegistration, IStoreEphemeral, IStoreErrors {} -interface IStoreHook { +interface IStoreHook is IStoreConsumer { function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) external; // Split onSetField into pre and post to simplify the implementation of hooks diff --git a/packages/store/src/StoreConsumer.sol b/packages/store/src/StoreConsumer.sol new file mode 100644 index 0000000000..bb3a14adb8 --- /dev/null +++ b/packages/store/src/StoreConsumer.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import { IStoreConsumer } from "./IStore.sol"; + +/** + * Default Store consumers consider their caller to be the Store, thus delegating access control to the Store. + * The Store contract considers itself to be the Store (so StoreRead has a different storeAddress definition). + * Tests/scripts may override this value for convenience. + * WARNING: World Systems rely on storeAddress being msg.sender for access control! + */ +contract StoreConsumer is IStoreConsumer { + function storeAddress(address msgSender) public pure returns (address) { + return msgSender; + } +} diff --git a/packages/store/src/StoreHook.sol b/packages/store/src/StoreHook.sol new file mode 100644 index 0000000000..8157c937f7 --- /dev/null +++ b/packages/store/src/StoreHook.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import { IStoreHook } from "./IStore.sol"; +import { StoreConsumer } from "./StoreConsumer.sol"; + +/** + * When making a hook, prefer inheriting StoreHook over IStoreHook for convenience + * (hooks should use the default StoreConsumer). + */ +abstract contract StoreHook is IStoreHook, StoreConsumer { + +} diff --git a/packages/store/src/StoreRead.sol b/packages/store/src/StoreRead.sol index f1b5ea9ca6..cb954841b3 100644 --- a/packages/store/src/StoreRead.sol +++ b/packages/store/src/StoreRead.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStoreRead, IStoreHook } from "./IStore.sol"; +import { IStoreRead } from "./IStore.sol"; import { StoreCore } from "./StoreCore.sol"; import { Schema } from "./Schema.sol"; @@ -61,5 +61,7 @@ contract StoreRead is IStoreRead { return StoreCore.getFieldSlice(tableId, key, schemaIndex, schema, start, end); } - function isStore() public view {} + function storeAddress(address) public view returns (address) { + return address(this); + } } diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index 629cb5c08d..b4bb61e8f8 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStore, IStoreHook } from "./IStore.sol"; +import { IStore, IStoreHook, IStoreConsumer } from "./IStore.sol"; import { StoreCore } from "./StoreCore.sol"; import { Schema } from "./Schema.sol"; @@ -9,13 +9,16 @@ import { Schema } from "./Schema.sol"; * Call IStore functions on self or msg.sender, depending on whether the call is a delegatecall or regular call. */ library StoreSwitch { - error StoreSwitch_InvalidInsideConstructor(); + error StoreSwitch_MissingOrInvalidStoreAddressFunction(bytes lowLevelData); /** * Detect whether the current call is a delegatecall or regular call. - * (The isStore method doesn't return a value to save gas, but it if exists, the call will succeed.) */ - function isDelegateCall() internal view returns (bool success) { + function isDelegateCall() internal view returns (bool) { + return storeAddress() == address(this); + } + + function storeAddress() internal view returns (address) { // Detect calls from within a constructor uint256 codeSize; assembly { @@ -23,20 +26,16 @@ library StoreSwitch { } // If the call is from within a constructor, use StoreCore to write to own storage - if (codeSize == 0) return true; + if (codeSize == 0) return address(this); - // Check whether this contract implements the IStore interface - try IStore(address(this)).isStore() { - success = true; - } catch { - success = false; + try IStoreConsumer(address(this)).storeAddress(msg.sender) returns (address _storeAddress) { + return _storeAddress; + } catch (bytes memory lowLevelData) { + // catch and rename the error, otherwise it's usually "EvmError: Revert" which is very unhelpful + revert StoreSwitch_MissingOrInvalidStoreAddressFunction(lowLevelData); } } - function inferStoreAddress() internal view returns (address) { - return isDelegateCall() ? address(this) : msg.sender; - } - function registerStoreHook(bytes32 table, IStoreHook hook) internal { if (isDelegateCall()) { StoreCore.registerStoreHook(table, hook); diff --git a/packages/store/test/MirrorSubscriber.sol b/packages/store/test/MirrorSubscriber.sol new file mode 100644 index 0000000000..a6fc7da438 --- /dev/null +++ b/packages/store/test/MirrorSubscriber.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0; + +import { IStore } from "../src/IStore.sol"; +import { StoreSwitch } from "../src/StoreSwitch.sol"; +import { StoreHook } from "../src/StoreHook.sol"; +import { Schema } from "../src/Schema.sol"; + +bytes32 constant indexerTableId = keccak256("indexer.table"); + +contract MirrorSubscriber is StoreHook { + bytes32 _table; + + constructor(bytes32 table, Schema schema, Schema keySchema) { + IStore(msg.sender).registerSchema(indexerTableId, schema, keySchema); + _table = table; + } + + function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) public { + if (table != table) revert("invalid table"); + StoreSwitch.setRecord(indexerTableId, key, data); + } + + function onBeforeSetField(bytes32 table, bytes32[] memory key, uint8 schemaIndex, bytes memory data) public { + if (table != table) revert("invalid table"); + StoreSwitch.setField(indexerTableId, key, schemaIndex, data); + } + + function onAfterSetField(bytes32, bytes32[] memory, uint8, bytes memory) public {} + + function onDeleteRecord(bytes32 table, bytes32[] memory key) public { + if (table != table) revert("invalid table"); + StoreSwitch.deleteRecord(indexerTableId, key); + } +} diff --git a/packages/store/test/StoreCore.t.sol b/packages/store/test/StoreCore.t.sol index 682c9f26bb..f9cc44990b 100644 --- a/packages/store/test/StoreCore.t.sol +++ b/packages/store/test/StoreCore.t.sol @@ -13,10 +13,11 @@ import { Schema, SchemaLib } from "../src/Schema.sol"; import { PackedCounter, PackedCounterLib } from "../src/PackedCounter.sol"; import { StoreReadWithStubs } from "../src/StoreReadWithStubs.sol"; import { IStoreErrors } from "../src/IStoreErrors.sol"; -import { IStore, IStoreHook } from "../src/IStore.sol"; +import { IStore } from "../src/IStore.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; import { StoreMetadataData, StoreMetadata } from "../src/codegen/Tables.sol"; import { StoreMock } from "./StoreMock.sol"; +import { MirrorSubscriber, indexerTableId } from "./MirrorSubscriber.sol"; struct TestStruct { uint128 firstData; @@ -840,31 +841,3 @@ contract StoreCoreTest is Test, StoreMock { assertEq(keccak256(indexedData), keccak256(abi.encodePacked(bytes16(0)))); } } - -bytes32 constant indexerTableId = keccak256("indexer.table"); - -contract MirrorSubscriber is IStoreHook { - bytes32 _table; - - constructor(bytes32 table, Schema schema, Schema keySchema) { - IStore(msg.sender).registerSchema(indexerTableId, schema, keySchema); - _table = table; - } - - function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) public { - if (table != table) revert("invalid table"); - StoreSwitch.setRecord(indexerTableId, key, data); - } - - function onBeforeSetField(bytes32 table, bytes32[] memory key, uint8 schemaIndex, bytes memory data) public { - if (table != table) revert("invalid table"); - StoreSwitch.setField(indexerTableId, key, schemaIndex, data); - } - - function onAfterSetField(bytes32, bytes32[] memory, uint8, bytes memory) public {} - - function onDeleteRecord(bytes32 table, bytes32[] memory key) public { - if (table != table) revert("invalid table"); - StoreSwitch.deleteRecord(indexerTableId, key); - } -} diff --git a/packages/store/test/StoreCoreGas.t.sol b/packages/store/test/StoreCoreGas.t.sol index a05d7257a9..d062996bc9 100644 --- a/packages/store/test/StoreCoreGas.t.sol +++ b/packages/store/test/StoreCoreGas.t.sol @@ -13,10 +13,11 @@ import { Schema, SchemaLib } from "../src/Schema.sol"; import { PackedCounter, PackedCounterLib } from "../src/PackedCounter.sol"; import { StoreReadWithStubs } from "../src/StoreReadWithStubs.sol"; import { IStoreErrors } from "../src/IStoreErrors.sol"; -import { IStore, IStoreHook } from "../src/IStore.sol"; +import { IStore } from "../src/IStore.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; import { StoreMetadataData, StoreMetadata } from "../src/codegen/Tables.sol"; import { StoreMock } from "./StoreMock.sol"; +import { MirrorSubscriber } from "./MirrorSubscriber.sol"; struct TestStruct { uint128 firstData; @@ -640,31 +641,3 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { endGasReport(); } } - -bytes32 constant indexerTableId = keccak256("indexer.table"); - -contract MirrorSubscriber is IStoreHook { - bytes32 _table; - - constructor(bytes32 table, Schema schema, Schema keySchema) { - IStore(msg.sender).registerSchema(indexerTableId, schema, keySchema); - _table = table; - } - - function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) public { - if (table != table) revert("invalid table"); - StoreSwitch.setRecord(indexerTableId, key, data); - } - - function onBeforeSetField(bytes32 table, bytes32[] memory key, uint8 schemaIndex, bytes memory data) public { - if (table != table) revert("invalid table"); - StoreSwitch.setField(indexerTableId, key, schemaIndex, data); - } - - function onAfterSetField(bytes32, bytes32[] memory, uint8, bytes memory) public {} - - function onDeleteRecord(bytes32 table, bytes32[] memory key) public { - if (table != table) revert("invalid table"); - StoreSwitch.deleteRecord(indexerTableId, key); - } -} diff --git a/packages/store/test/StoreSwitch.t.sol b/packages/store/test/StoreSwitch.t.sol index 1d186136e7..cbfebeb780 100644 --- a/packages/store/test/StoreSwitch.t.sol +++ b/packages/store/test/StoreSwitch.t.sol @@ -4,28 +4,29 @@ pragma solidity >=0.8.0; import { Test } from "forge-std/Test.sol"; import { GasReporter } from "@latticexyz/std-contracts/src/test/GasReporter.sol"; import { StoreCore } from "../src/StoreCore.sol"; +import { StoreConsumer } from "../src/StoreConsumer.sol"; import { StoreReadWithStubs } from "../src/StoreReadWithStubs.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; -// Mock Store to call MockSystem +// Mock Store and its consumer contract StoreSwitchTestStore is StoreReadWithStubs { - MockSystem mockSystem = new MockSystem(); + MockStoreConsumer mockConsumer = new MockStoreConsumer(); function callViaDelegateCall() public returns (bool isDelegate) { - (bool success, bytes memory data) = address(mockSystem).delegatecall(abi.encodeWithSignature("isDelegateCall()")); + (bool success, bytes memory data) = address(mockConsumer).delegatecall(abi.encodeWithSignature("isDelegateCall()")); if (!success) revert("delegatecall failed"); isDelegate = abi.decode(data, (bool)); } function callViaCall() public returns (bool isDelegate) { - (bool success, bytes memory data) = address(mockSystem).call(abi.encodeWithSignature("isDelegateCall()")); + (bool success, bytes memory data) = address(mockConsumer).call(abi.encodeWithSignature("isDelegateCall()")); if (!success) revert("delegatecall failed"); isDelegate = abi.decode(data, (bool)); } } -// Mock system to wrap StoreSwitch.isDelegateCall() -contract MockSystem is GasReporter { +// Mock consumer to wrap StoreSwitch.isDelegateCall() +contract MockStoreConsumer is StoreConsumer, GasReporter { function isDelegateCall() public returns (bool isDelegate) { startGasReport("check if delegatecall"); isDelegate = StoreSwitch.isDelegateCall(); From 4cf590b937e2ac20e8c05bb482d6bbc12025cbfb Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 20:04:17 +0300 Subject: [PATCH 02/25] refactor(world): replace isStore with storeAddress --- packages/world/src/WorldContext.sol | 5 +++-- .../world/src/modules/keysintable/KeysInTableHook.sol | 4 ++-- .../world/src/modules/keyswithvalue/KeysWithValueHook.sol | 4 ++-- .../world/src/modules/uniqueentity/getUniqueEntity.sol | 2 +- packages/world/test/World.t.sol | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/world/src/WorldContext.sol b/packages/world/src/WorldContext.sol index bb511ffaed..5fbfc88e4d 100644 --- a/packages/world/src/WorldContext.sol +++ b/packages/world/src/WorldContext.sol @@ -1,11 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; +import { StoreConsumer } from "@latticexyz/store/src/StoreConsumer.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; // Similar to https://eips.ethereum.org/EIPS/eip-2771, but any contract can be the trusted forwarder. // This should only be used for contracts without own storage, like Systems. -abstract contract WorldContext { +abstract contract WorldContext is StoreConsumer { // Extract the trusted msg.sender value appended to the calldata function _msgSender() internal view returns (address sender) { assembly { @@ -16,6 +17,6 @@ abstract contract WorldContext { } function _world() internal view returns (address) { - return StoreSwitch.inferStoreAddress(); + return StoreSwitch.storeAddress(); } } diff --git a/packages/world/src/modules/keysintable/KeysInTableHook.sol b/packages/world/src/modules/keysintable/KeysInTableHook.sol index 747b5a709b..eb0ab99f23 100644 --- a/packages/world/src/modules/keysintable/KeysInTableHook.sol +++ b/packages/world/src/modules/keysintable/KeysInTableHook.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; +import { StoreHook } from "@latticexyz/store/src/StoreHook.sol"; import { KeysInTable } from "./tables/KeysInTable.sol"; import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; @@ -9,7 +9,7 @@ import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; /** * Note: if a table with composite keys is used, only the first key is indexed */ -contract KeysInTableHook is IStoreHook { +contract KeysInTableHook is StoreHook { function handleSet(bytes32 tableId, bytes32[] memory key) internal { bytes32 keysHash = keccak256(abi.encode(key)); diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol index e5214553e6..649e13191c 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; +import { StoreHook } from "@latticexyz/store/src/StoreHook.sol"; import { Bytes } from "@latticexyz/store/src/Bytes.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; @@ -20,7 +20,7 @@ import { getTargetTableSelector } from "../utils/getTargetTableSelector.sol"; * * Note: if a table with composite keys is used, only the first key is indexed */ -contract KeysWithValueHook is IStoreHook { +contract KeysWithValueHook is StoreHook { using ArrayLib for bytes32[]; using ResourceSelector for bytes32; diff --git a/packages/world/src/modules/uniqueentity/getUniqueEntity.sol b/packages/world/src/modules/uniqueentity/getUniqueEntity.sol index 2482056b51..bf377d5998 100644 --- a/packages/world/src/modules/uniqueentity/getUniqueEntity.sol +++ b/packages/world/src/modules/uniqueentity/getUniqueEntity.sol @@ -13,7 +13,7 @@ import { IUniqueEntitySystem } from "../../interfaces/IUniqueEntitySystem.sol"; * For usage outside of a World, use the overload that takes an explicit store argument. */ function getUniqueEntity() returns (bytes32 uniqueEntity) { - address world = StoreSwitch.inferStoreAddress(); + address world = StoreSwitch.storeAddress(); return IUniqueEntitySystem(world).uniqueEntity_system_getUniqueEntity(); } diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index be1e3c3349..868bd42f3c 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -6,7 +6,7 @@ import { GasReporter } from "@latticexyz/std-contracts/src/test/GasReporter.sol" import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol"; -import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; +import { IStoreHook, StoreHook } from "@latticexyz/store/src/StoreHook.sol"; import { StoreCore, StoreCoreInternal } from "@latticexyz/store/src/StoreCore.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol"; @@ -99,7 +99,7 @@ contract PayableFallbackSystem is System { fallback() external payable {} } -contract WorldTestTableHook is IStoreHook { +contract WorldTestTableHook is StoreHook { event HookCalled(bytes data); function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) public { @@ -191,8 +191,8 @@ contract WorldTest is Test, GasReporter { assertTrue(ResourceAccess.get(world, ROOT_NAMESPACE, address(this))); } - function testIsStore() public view { - world.isStore(); + function testStoreAddress() public { + assertEq(world.storeAddress(msg.sender), address(world)); } function testRegisterNamespace() public { From 9a57fdc53f96110266e038896f2e2bdb9ceca0e3 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 20:09:41 +0300 Subject: [PATCH 03/25] rename WorldContext to WorldConsumer --- .../AccessManagementSystem.abi.json | 30 +++++ .../abi/CoreModule.sol/CoreModule.abi.json | 30 +++++ .../abi/CoreSystem.sol/CoreSystem.abi.json | 30 +++++ .../EphemeralRecordSystem.abi.json | 30 +++++ .../abi/IBaseWorld.sol/IBaseWorld.abi.json | 26 ++-- packages/world/abi/IStore.sol/IStore.abi.json | 26 ++-- .../abi/IStore.sol/IStoreConsumer.abi.json | 21 ++++ .../world/abi/IStore.sol/IStoreData.abi.json | 26 ++-- .../world/abi/IStore.sol/IStoreHook.abi.json | 19 +++ .../world/abi/IStore.sol/IStoreRead.abi.json | 18 ++- .../KeysInTableHook.abi.json | 30 +++++ .../KeysInTableModule.abi.json | 30 +++++ .../KeysWithValueHook.abi.json | 30 +++++ .../KeysWithValueModule.abi.json | 30 +++++ .../ModuleInstallationSystem.abi.json | 30 +++++ .../SnapSyncModule.abi.json | 30 +++++ .../SnapSyncSystem.abi.json | 30 +++++ .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ++++ .../abi/StoreHook.sol/StoreHook.abi.json | 118 ++++++++++++++++++ .../abi/StoreRead.sol/StoreRead.abi.json | 29 ++++- .../StoreRegistrationSystem.abi.json | 30 +++++ .../abi/StoreSwitch.sol/StoreSwitch.abi.json | 10 +- packages/world/abi/System.sol/System.abi.json | 22 +++- .../UniqueEntityModule.abi.json | 30 +++++ .../UniqueEntitySystem.abi.json | 30 +++++ packages/world/abi/World.sol/World.abi.json | 37 ++++-- .../WorldConsumer.sol/WorldConsumer.abi.json | 21 ++++ .../WorldRegistrationSystem.abi.json | 30 +++++ .../world/abi/src/IStore.sol/IStore.abi.json | 26 ++-- .../src/IStore.sol/IStoreConsumer.abi.json | 21 ++++ .../abi/src/IStore.sol/IStoreData.abi.json | 26 ++-- .../abi/src/IStore.sol/IStoreHook.abi.json | 19 +++ .../abi/src/IStore.sol/IStoreRead.abi.json | 18 ++- .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ++++ .../src/StoreSwitch.sol/StoreSwitch.abi.json | 10 +- packages/world/src/System.sol | 6 +- .../{WorldContext.sol => WorldConsumer.sol} | 2 +- .../world/src/modules/core/CoreModule.sol | 4 +- .../modules/keysintable/KeysInTableModule.sol | 4 +- .../keyswithvalue/KeysWithValueModule.sol | 4 +- .../src/modules/snapsync/SnapSyncModule.sol | 4 +- .../uniqueentity/UniqueEntityModule.sol | 4 +- 42 files changed, 943 insertions(+), 70 deletions(-) create mode 100644 packages/world/abi/IStore.sol/IStoreConsumer.abi.json create mode 100644 packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json create mode 100644 packages/world/abi/StoreHook.sol/StoreHook.abi.json create mode 100644 packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json create mode 100644 packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json rename packages/world/src/{WorldContext.sol => WorldConsumer.sol} (93%) diff --git a/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json b/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json index 7801e6816e..01f2c560ac 100644 --- a/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json +++ b/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json @@ -68,6 +68,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -113,5 +124,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/CoreModule.sol/CoreModule.abi.json b/packages/world/abi/CoreModule.sol/CoreModule.abi.json index 1bb5e1625b..2d69e9380f 100644 --- a/packages/world/abi/CoreModule.sol/CoreModule.abi.json +++ b/packages/world/abi/CoreModule.sol/CoreModule.abi.json @@ -111,6 +111,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getName", @@ -136,5 +147,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json index 8c58fee71b..0d17d7cade 100644 --- a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json +++ b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json @@ -187,6 +187,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -647,5 +658,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json index 3e51350f67..77adf33608 100644 --- a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json +++ b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json @@ -68,6 +68,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -143,5 +154,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json index 665470de35..8fc5708187 100644 --- a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json +++ b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json @@ -666,13 +666,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -1240,6 +1233,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStore.abi.json b/packages/world/abi/IStore.sol/IStore.abi.json index fa4b3d868f..5767c6757d 100644 --- a/packages/world/abi/IStore.sol/IStore.abi.json +++ b/packages/world/abi/IStore.sol/IStore.abi.json @@ -428,13 +428,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -606,6 +599,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/IStore.sol/IStoreConsumer.abi.json new file mode 100644 index 0000000000..24ce1a4cb2 --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreData.abi.json b/packages/world/abi/IStore.sol/IStoreData.abi.json index 44c5939df8..80b613f33e 100644 --- a/packages/world/abi/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/IStore.sol/IStoreData.abi.json @@ -290,13 +290,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -404,6 +397,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreHook.abi.json b/packages/world/abi/IStore.sol/IStoreHook.abi.json index f192f8efc5..b1a5ec5fd9 100644 --- a/packages/world/abi/IStore.sol/IStoreHook.abi.json +++ b/packages/world/abi/IStore.sol/IStoreHook.abi.json @@ -95,5 +95,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreRead.abi.json b/packages/world/abi/IStore.sol/IStoreRead.abi.json index 182dfafa10..171c382553 100644 --- a/packages/world/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/IStore.sol/IStoreRead.abi.json @@ -198,9 +198,21 @@ "type": "function" }, { - "inputs": [], - "name": "isStore", - "outputs": [], + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json index aff14f41e8..83fc0e84ee 100644 --- a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json +++ b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json @@ -89,6 +89,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -185,5 +196,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json b/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json index b281783ba3..b1d923eede 100644 --- a/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json +++ b/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json @@ -42,6 +42,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getName", @@ -67,5 +78,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json index d26dcd0e71..0b31b76570 100644 --- a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json +++ b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json @@ -57,6 +57,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -153,5 +164,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json b/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json index d616cf972b..2986b8f883 100644 --- a/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json +++ b/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json @@ -68,6 +68,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getName", @@ -93,5 +104,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json b/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json index ac5d10ea5d..5d64f1908c 100644 --- a/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json +++ b/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json @@ -52,6 +52,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -69,5 +80,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json b/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json index 32a46a1787..41bce1785c 100644 --- a/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json +++ b/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json @@ -10,6 +10,17 @@ "name": "RequiredModuleNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getName", @@ -35,5 +46,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json b/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json index fe0862a126..bf173d53b6 100644 --- a/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json +++ b/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json @@ -36,6 +36,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -100,5 +111,24 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json b/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json new file mode 100644 index 0000000000..927b8ed2da --- /dev/null +++ b/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/StoreHook.sol/StoreHook.abi.json b/packages/world/abi/StoreHook.sol/StoreHook.abi.json new file mode 100644 index 0000000000..086ec0e67d --- /dev/null +++ b/packages/world/abi/StoreHook.sol/StoreHook.abi.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + } + ], + "name": "onDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "table", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "key", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/StoreRead.sol/StoreRead.abi.json b/packages/world/abi/StoreRead.sol/StoreRead.abi.json index d3224ec101..b6752912dc 100644 --- a/packages/world/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/world/abi/StoreRead.sol/StoreRead.abi.json @@ -110,6 +110,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -309,9 +320,21 @@ "type": "function" }, { - "inputs": [], - "name": "isStore", - "outputs": [], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json b/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json index 7815ac594a..3507844036 100644 --- a/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json +++ b/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json @@ -15,6 +15,17 @@ "name": "SchemaLib_StaticTypeAfterDynamicType", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -78,5 +89,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json b/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json index 613386a47c..554b526e5b 100644 --- a/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,7 +1,13 @@ [ { - "inputs": [], - "name": "StoreSwitch_InvalidInsideConstructor", + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", "type": "error" } ] \ No newline at end of file diff --git a/packages/world/abi/System.sol/System.abi.json b/packages/world/abi/System.sol/System.abi.json index 0637a088a0..927b8ed2da 100644 --- a/packages/world/abi/System.sol/System.abi.json +++ b/packages/world/abi/System.sol/System.abi.json @@ -1 +1,21 @@ -[] \ No newline at end of file +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json b/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json index 646de1964b..beba2c0feb 100644 --- a/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json +++ b/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json @@ -26,6 +26,17 @@ "name": "SchemaLib_StaticTypeAfterDynamicType", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getName", @@ -51,5 +62,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json b/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json index 51b519610a..0e857a53be 100644 --- a/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json +++ b/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json @@ -52,6 +52,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [], "name": "getUniqueEntity", @@ -64,5 +75,24 @@ ], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/World.sol/World.abi.json b/packages/world/abi/World.sol/World.abi.json index e30e1bae77..14029575f7 100644 --- a/packages/world/abi/World.sol/World.abi.json +++ b/packages/world/abi/World.sol/World.abi.json @@ -208,6 +208,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -590,13 +601,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -831,6 +835,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json b/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json new file mode 100644 index 0000000000..927b8ed2da --- /dev/null +++ b/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json b/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json index c0f14dc135..4c4dc23b11 100644 --- a/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json +++ b/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json @@ -187,6 +187,17 @@ "name": "StoreCore_TableNotFound", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", + "type": "error" + }, { "inputs": [ { @@ -443,5 +454,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStore.abi.json b/packages/world/abi/src/IStore.sol/IStore.abi.json index fa4b3d868f..5767c6757d 100644 --- a/packages/world/abi/src/IStore.sol/IStore.abi.json +++ b/packages/world/abi/src/IStore.sol/IStore.abi.json @@ -428,13 +428,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -606,6 +599,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json new file mode 100644 index 0000000000..24ce1a4cb2 --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreData.abi.json b/packages/world/abi/src/IStore.sol/IStoreData.abi.json index 44c5939df8..80b613f33e 100644 --- a/packages/world/abi/src/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreData.abi.json @@ -290,13 +290,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "isStore", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -404,6 +397,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreHook.abi.json b/packages/world/abi/src/IStore.sol/IStoreHook.abi.json index f192f8efc5..b1a5ec5fd9 100644 --- a/packages/world/abi/src/IStore.sol/IStoreHook.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreHook.abi.json @@ -95,5 +95,24 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json index 182dfafa10..171c382553 100644 --- a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json @@ -198,9 +198,21 @@ "type": "function" }, { - "inputs": [], - "name": "isStore", - "outputs": [], + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "storeAddress", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json b/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json new file mode 100644 index 0000000000..927b8ed2da --- /dev/null +++ b/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json @@ -0,0 +1,21 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json b/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json index 613386a47c..554b526e5b 100644 --- a/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,7 +1,13 @@ [ { - "inputs": [], - "name": "StoreSwitch_InvalidInsideConstructor", + "inputs": [ + { + "internalType": "bytes", + "name": "lowLevelData", + "type": "bytes" + } + ], + "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", "type": "error" } ] \ No newline at end of file diff --git a/packages/world/src/System.sol b/packages/world/src/System.sol index aa1bfd0ebf..c0ed5ecc23 100644 --- a/packages/world/src/System.sol +++ b/packages/world/src/System.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { WorldContext } from "./WorldContext.sol"; +import { WorldConsumer } from "./WorldConsumer.sol"; -// For now System is just an alias for `WorldContext`, +// For now System is just an alias for `WorldConsumer`, // but we might add more default functionality in the future. -contract System is WorldContext { +contract System is WorldConsumer { } diff --git a/packages/world/src/WorldContext.sol b/packages/world/src/WorldConsumer.sol similarity index 93% rename from packages/world/src/WorldContext.sol rename to packages/world/src/WorldConsumer.sol index 5fbfc88e4d..cf93043017 100644 --- a/packages/world/src/WorldContext.sol +++ b/packages/world/src/WorldConsumer.sol @@ -6,7 +6,7 @@ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; // Similar to https://eips.ethereum.org/EIPS/eip-2771, but any contract can be the trusted forwarder. // This should only be used for contracts without own storage, like Systems. -abstract contract WorldContext is StoreConsumer { +abstract contract WorldConsumer is StoreConsumer { // Extract the trusted msg.sender value appended to the calldata function _msgSender() internal view returns (address sender) { assembly { diff --git a/packages/world/src/modules/core/CoreModule.sol b/packages/world/src/modules/core/CoreModule.sol index 3f9ceca643..ad24f52ffc 100644 --- a/packages/world/src/modules/core/CoreModule.sol +++ b/packages/world/src/modules/core/CoreModule.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0; import { Call } from "../../Call.sol"; import { ROOT_NAMESPACE } from "../../constants.sol"; -import { WorldContext } from "../../WorldContext.sol"; +import { WorldConsumer } from "../../WorldConsumer.sol"; import { Resource } from "../../Types.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; @@ -38,7 +38,7 @@ import { EphemeralRecordSystem } from "./implementations/EphemeralRecordSystem.s * This module is required to be delegatecalled (via `World.registerRootSystem`), * because it needs to install root tables, systems and function selectors. */ -contract CoreModule is IModule, WorldContext { +contract CoreModule is IModule, WorldConsumer { // Since the CoreSystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. address immutable coreSystem = address(new CoreSystem()); diff --git a/packages/world/src/modules/keysintable/KeysInTableModule.sol b/packages/world/src/modules/keysintable/KeysInTableModule.sol index e908d01a55..b78498aaaa 100644 --- a/packages/world/src/modules/keysintable/KeysInTableModule.sol +++ b/packages/world/src/modules/keysintable/KeysInTableModule.sol @@ -7,7 +7,7 @@ import { Resource } from "../../Types.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldContext } from "../../WorldContext.sol"; +import { WorldConsumer } from "../../WorldConsumer.sol"; import { ResourceSelector } from "../../ResourceSelector.sol"; import { KeysInTableHook } from "./KeysInTableHook.sol"; @@ -24,7 +24,7 @@ import { UsedKeysIndex, UsedKeysIndexTableId } from "./tables/UsedKeysIndex.sol" * Note: this module currently expects to be `delegatecalled` via World.installRootModule. * Support for installing it via `World.installModule` depends on `World.callFrom` being implemented. */ -contract KeysInTableModule is IModule, WorldContext { +contract KeysInTableModule is IModule, WorldConsumer { using ResourceSelector for bytes32; // The KeysInTableHook is deployed once and infers the target table id diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol index f6af846bd5..c236ab49ea 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol @@ -6,7 +6,7 @@ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldContext } from "../../WorldContext.sol"; +import { WorldConsumer } from "../../WorldConsumer.sol"; import { ResourceSelector } from "../../ResourceSelector.sol"; import { MODULE_NAMESPACE } from "./constants.sol"; @@ -25,7 +25,7 @@ import { getTargetTableSelector } from "../utils/getTargetTableSelector.sol"; * Note: this module currently expects to be `delegatecalled` via World.installRootModule. * Support for installing it via `World.installModule` depends on `World.callFrom` being implemented. */ -contract KeysWithValueModule is IModule, WorldContext { +contract KeysWithValueModule is IModule, WorldConsumer { using ResourceSelector for bytes32; // The KeysWithValueHook is deployed once and infers the target table id diff --git a/packages/world/src/modules/snapsync/SnapSyncModule.sol b/packages/world/src/modules/snapsync/SnapSyncModule.sol index b35ef982c8..1970e64229 100644 --- a/packages/world/src/modules/snapsync/SnapSyncModule.sol +++ b/packages/world/src/modules/snapsync/SnapSyncModule.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.0; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldContext } from "../../WorldContext.sol"; +import { WorldConsumer } from "../../WorldConsumer.sol"; import { SnapSyncSystem } from "./SnapSyncSystem.sol"; @@ -15,7 +15,7 @@ import { NAMESPACE, MODULE_NAME, SYSTEM_NAME, TABLE_NAME } from "./constants.sol * This module registers a system that allows clients to load a snapshot of the World state * by using view functions. */ -contract SnapSyncModule is IModule, WorldContext { +contract SnapSyncModule is IModule, WorldConsumer { // Since the SnapSyncSystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. SnapSyncSystem private immutable snapSyncSystem = new SnapSyncSystem(); diff --git a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol index d86a040b6e..00810d03d9 100644 --- a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol +++ b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.0; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldContext } from "../../WorldContext.sol"; +import { WorldConsumer } from "../../WorldConsumer.sol"; import { UniqueEntity } from "./tables/UniqueEntity.sol"; import { UniqueEntitySystem } from "./UniqueEntitySystem.sol"; @@ -15,7 +15,7 @@ import { NAMESPACE, MODULE_NAME, SYSTEM_NAME, TABLE_NAME } from "./constants.sol * This module creates a table that stores a nonce, and * a public system that returns an incremented nonce each time. */ -contract UniqueEntityModule is IModule, WorldContext { +contract UniqueEntityModule is IModule, WorldConsumer { // Since the UniqueEntitySystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. UniqueEntitySystem immutable uniqueEntitySystem = new UniqueEntitySystem(); From 64ec40f3bbc1c799f963653ceb810f5c1a256b6c Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 20:09:50 +0300 Subject: [PATCH 04/25] gas-report --- packages/world/gas-report.json | 98 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index d3037819bb..4bd7d8b7ba 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,67 +3,67 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1286951 + "gasUsed": 1303862 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1286951 + "gasUsed": 1303862 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 193905 + "gasUsed": 197985 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1286951 + "gasUsed": 1303862 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1286951 + "gasUsed": 1303862 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 30072 + "gasUsed": 31107 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 292113 + "gasUsed": 305696 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1286951 + "gasUsed": 1303862 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 28686 + "gasUsed": 29722 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 153351 + "gasUsed": 160625 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValue", "name": "install keys with value module", - "gasUsed": 626518 + "gasUsed": 638683 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,79 +81,79 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 626518 + "gasUsed": 638683 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 165703 + "gasUsed": 169568 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 626518 + "gasUsed": 638683 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 135356 + "gasUsed": 139222 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 54297 + "gasUsed": 56746 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 626518 + "gasUsed": 638683 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 173712 + "gasUsed": 177644 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 138070 + "gasUsed": 142003 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueNotQuery", "name": "CombinedHasHasValueNotQuery", - "gasUsed": 169289 + "gasUsed": 169220 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueQuery", "name": "CombinedHasHasValueQuery", - "gasUsed": 79072 + "gasUsed": 79049 }, { "file": "test/query.t.sol", "test": "testCombinedHasNotQuery", "name": "CombinedHasNotQuery", - "gasUsed": 233194 + "gasUsed": 233079 }, { "file": "test/query.t.sol", "test": "testCombinedHasQuery", "name": "CombinedHasQuery", - "gasUsed": 146486 + "gasUsed": 146394 }, { "file": "test/query.t.sol", "test": "testCombinedHasValueNotQuery", "name": "CombinedHasValueNotQuery", - "gasUsed": 145184 + "gasUsed": 145115 }, { "file": "test/query.t.sol", @@ -165,19 +165,19 @@ "file": "test/query.t.sol", "test": "testHasQuery", "name": "HasQuery", - "gasUsed": 33097 + "gasUsed": 33074 }, { "file": "test/query.t.sol", "test": "testHasQuery1000Keys", "name": "HasQuery with 1000 keys", - "gasUsed": 11312135 + "gasUsed": 11312112 }, { "file": "test/query.t.sol", "test": "testHasQuery100Keys", "name": "HasQuery with 100 keys", - "gasUsed": 1060038 + "gasUsed": 1060015 }, { "file": "test/query.t.sol", @@ -189,132 +189,132 @@ "file": "test/query.t.sol", "test": "testNotValueQuery", "name": "NotValueQuery", - "gasUsed": 72252 + "gasUsed": 72229 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 43866 + "gasUsed": 45930 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 62553 + "gasUsed": 65221 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 824003 + "gasUsed": 842466 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 73377 + "gasUsed": 75985 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 794078 + "gasUsed": 810686 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 73377 + "gasUsed": 75985 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 16152 + "gasUsed": 16909 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 96511 + "gasUsed": 97267 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 87012 + "gasUsed": 90040 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 78196 + "gasUsed": 81246 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 107607 + "gasUsed": 110634 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 161669 + "gasUsed": 165455 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 94099 + "gasUsed": 97149 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 262388 + "gasUsed": 267695 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 44813 + "gasUsed": 45592 }, { "file": "test/World.t.sol", "test": "testSetMetadata", "name": "Set metadata", - "gasUsed": 283384 + "gasUsed": 285656 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 42690 + "gasUsed": 43447 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 38033 + "gasUsed": 38745 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 22830 + "gasUsed": 23542 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 40364 + "gasUsed": 41121 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 25566 + "gasUsed": 26323 } ] From 399518135a4d37e330707cff2dba4fa7ca0251d5 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 21:52:00 +0300 Subject: [PATCH 05/25] ignore storeAddress in deploy --- packages/cli/src/utils/deploy.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/cli/src/utils/deploy.ts b/packages/cli/src/utils/deploy.ts index 765cdf42ac..249a49637e 100644 --- a/packages/cli/src/utils/deploy.ts +++ b/packages/cli/src/utils/deploy.ts @@ -453,16 +453,20 @@ export async function deploy( async function loadFunctionSignatures(contractName: string): Promise { const { abi } = await getContractData(contractName); - return abi - .filter((item) => ["fallback", "function"].includes(item.type)) - .map((item) => { - if (item.type === "fallback") return { functionName: "", functionArgs: "" }; - - return { - functionName: item.name, - functionArgs: parseComponents(item.inputs), - }; - }); + return ( + abi + .filter((item) => ["fallback", "function"].includes(item.type)) + // storeAddress is a special StoreConsumer function inherited by Systems, and shouldn't be registered + .filter((item) => !["storeAddress"].includes(item.name)) + .map((item) => { + if (item.type === "fallback") return { functionName: "", functionArgs: "" }; + + return { + functionName: item.name, + functionArgs: parseComponents(item.inputs), + }; + }) + ); } /** From caffe5369b45a1c1e1f1c3535fd3140175eb1b89 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 20 Jun 2023 21:53:45 +0300 Subject: [PATCH 06/25] add storeAddress to MudV2Test --- packages/std-contracts/package.json | 1 + packages/std-contracts/remappings.txt | 1 + packages/std-contracts/src/test/MudV2Test.t.sol | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/std-contracts/package.json b/packages/std-contracts/package.json index 6c9235f24e..01018f6830 100644 --- a/packages/std-contracts/package.json +++ b/packages/std-contracts/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@latticexyz/solecs": "workspace:*", + "@latticexyz/store": "workspace:*", "@solidstate/contracts": "^0.0.52", "@typechain/ethers-v5": "^10.2.0", "ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084", diff --git a/packages/std-contracts/remappings.txt b/packages/std-contracts/remappings.txt index 353e9cbd78..2ae565ed88 100644 --- a/packages/std-contracts/remappings.txt +++ b/packages/std-contracts/remappings.txt @@ -4,3 +4,4 @@ forge-std/=node_modules/forge-std/src/ solmate/=node_modules/solmate/src solecs/=node_modules/@latticexyz/solecs/src/ @solidstate/=node_modules/@solidstate/ +@latticexyz/=node_modules/@latticexyz/ diff --git a/packages/std-contracts/src/test/MudV2Test.t.sol b/packages/std-contracts/src/test/MudV2Test.t.sol index 0bcc2e4c15..f29a514e56 100644 --- a/packages/std-contracts/src/test/MudV2Test.t.sol +++ b/packages/std-contracts/src/test/MudV2Test.t.sol @@ -2,11 +2,16 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; +import { IStoreConsumer } from "@latticexyz/store/src/StoreConsumer.sol"; -contract MudV2Test is Test { +contract MudV2Test is Test, IStoreConsumer { address worldAddress; function setUp() public virtual { worldAddress = vm.parseAddress(vm.readFile(".mudtest")); } + + function storeAddress(address) public view returns (address) { + return worldAddress; + } } From cfa0a609059e11587481117cea341b049569f5c3 Mon Sep 17 00:00:00 2001 From: dk1a Date: Wed, 21 Jun 2023 12:36:51 +0300 Subject: [PATCH 07/25] fix StoreSwitch --- packages/store/gas-report.json | 84 ++++++++++++------------ packages/store/src/StoreSwitch.sol | 92 +++++++++++++++------------ packages/store/test/StoreSwitch.t.sol | 6 +- packages/world/gas-report.json | 80 +++++++++++------------ packages/world/src/Utils.sol | 2 +- packages/world/test/World.t.sol | 4 +- pnpm-lock.yaml | 5 +- 7 files changed, 143 insertions(+), 130 deletions(-) diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index ca4bdecdbc..93907920c6 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -99,7 +99,7 @@ "file": "test/KeyEncoding.t.sol", "test": "testRegisterAndGetSchema", "name": "register KeyEncoding schema", - "gasUsed": 65082 + "gasUsed": 65069 }, { "file": "test/Mixed.t.sol", @@ -111,19 +111,19 @@ "file": "test/Mixed.t.sol", "test": "testRegisterAndGetSchema", "name": "register Mixed schema", - "gasUsed": 61537 + "gasUsed": 61524 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "set record in Mixed", - "gasUsed": 112805 + "gasUsed": 112767 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "get record from Mixed", - "gasUsed": 13775 + "gasUsed": 13750 }, { "file": "test/PackedCounter.t.sol", @@ -333,25 +333,25 @@ "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (cold, 1 slot, 1 uint32 item)", - "gasUsed": 29687 + "gasUsed": 29662 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (warm, 1 slot, 1 uint32 item)", - "gasUsed": 19743 + "gasUsed": 19718 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (cold, 2 slots, 10 uint32 items)", - "gasUsed": 31570 + "gasUsed": 31545 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (warm, 2 slots, 10 uint32 items)", - "gasUsed": 19626 + "gasUsed": 19601 }, { "file": "test/StoreCoreGas.t.sol", @@ -387,7 +387,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testDeleteData", "name": "delete record (complex data, 3 slots)", - "gasUsed": 11325 + "gasUsed": 11300 }, { "file": "test/StoreCoreGas.t.sol", @@ -405,61 +405,61 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "register subscriber", - "gasUsed": 66214 + "gasUsed": 66164 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 74919 + "gasUsed": 74911 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set static field on table with subscriber", - "gasUsed": 33006 + "gasUsed": 32999 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "delete record on table with subscriber", - "gasUsed": 25526 + "gasUsed": 25518 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "register subscriber", - "gasUsed": 66214 + "gasUsed": 66164 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 168356 + "gasUsed": 168348 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) field on table with subscriber", - "gasUsed": 36035 + "gasUsed": 36028 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "delete (dynamic) record on table with subscriber", - "gasUsed": 26998 + "gasUsed": 26990 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (1 slot, 1 uint32 item)", - "gasUsed": 17397 + "gasUsed": 17372 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (2 slots, 10 uint32 items)", - "gasUsed": 40114 + "gasUsed": 40089 }, { "file": "test/StoreCoreGas.t.sol", @@ -483,7 +483,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetDynamicData", "name": "set complex record with dynamic data (4 slots)", - "gasUsed": 108038 + "gasUsed": 108013 }, { "file": "test/StoreCoreGas.t.sol", @@ -525,7 +525,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (1 slot)", - "gasUsed": 38316 + "gasUsed": 38291 }, { "file": "test/StoreCoreGas.t.sol", @@ -537,7 +537,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (overlap 2 slot)", - "gasUsed": 35337 + "gasUsed": 35312 }, { "file": "test/StoreCoreGas.t.sol", @@ -549,7 +549,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, first dynamic field)", - "gasUsed": 57718 + "gasUsed": 57693 }, { "file": "test/StoreCoreGas.t.sol", @@ -561,7 +561,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, second dynamic field)", - "gasUsed": 35851 + "gasUsed": 35826 }, { "file": "test/StoreCoreGas.t.sol", @@ -573,7 +573,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "set static record (1 slot)", - "gasUsed": 37705 + "gasUsed": 37680 }, { "file": "test/StoreCoreGas.t.sol", @@ -585,7 +585,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticDataSpanningWords", "name": "set static record (2 slots)", - "gasUsed": 60272 + "gasUsed": 60247 }, { "file": "test/StoreCoreGas.t.sol", @@ -597,79 +597,79 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetMetadata", "name": "StoreCore: set table metadata", - "gasUsed": 252528 + "gasUsed": 252490 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "update in field (1 slot, 1 uint32 item)", - "gasUsed": 16938 + "gasUsed": 16913 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "push to field (2 slots, 6 uint64 items)", - "gasUsed": 18028 + "gasUsed": 18003 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 250962 + "gasUsed": 250924 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "get record from StoreMetadataTable", - "gasUsed": 12503 + "gasUsed": 12478 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsDelegatecall", "name": "check if delegatecall", - "gasUsed": 1018 + "gasUsed": 983 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsNoDelegatecall", "name": "check if delegatecall", - "gasUsed": 1014 + "gasUsed": 979 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "set field in Callbacks", - "gasUsed": 63952 + "gasUsed": 63902 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "get field from Callbacks (warm)", - "gasUsed": 6161 + "gasUsed": 6136 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "push field to Callbacks", - "gasUsed": 41642 + "gasUsed": 41593 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "set field in Hooks", - "gasUsed": 64109 + "gasUsed": 64059 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "get field from Hooks (warm)", - "gasUsed": 6310 + "gasUsed": 6285 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "push field to Hooks", - "gasUsed": 41632 + "gasUsed": 41583 }, { "file": "test/tightcoder/DecodeSlice.t.sol", @@ -729,18 +729,18 @@ "file": "test/Vector2.t.sol", "test": "testRegisterAndGetSchema", "name": "register Vector2 schema", - "gasUsed": 58403 + "gasUsed": 58390 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "set Vector2 record", - "gasUsed": 39477 + "gasUsed": 39439 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "get Vector2 record", - "gasUsed": 5499 + "gasUsed": 5474 } ] diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index b4bb61e8f8..a507251c56 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -11,13 +11,6 @@ import { Schema } from "./Schema.sol"; library StoreSwitch { error StoreSwitch_MissingOrInvalidStoreAddressFunction(bytes lowLevelData); - /** - * Detect whether the current call is a delegatecall or regular call. - */ - function isDelegateCall() internal view returns (bool) { - return storeAddress() == address(this); - } - function storeAddress() internal view returns (address) { // Detect calls from within a constructor uint256 codeSize; @@ -37,74 +30,83 @@ library StoreSwitch { } function registerStoreHook(bytes32 table, IStoreHook hook) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.registerStoreHook(table, hook); } else { - IStore(msg.sender).registerStoreHook(table, hook); + IStore(_storeAddress).registerStoreHook(table, hook); } } function getSchema(bytes32 table) internal view returns (Schema schema) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { schema = StoreCore.getSchema(table); } else { - schema = IStore(msg.sender).getSchema(table); + schema = IStore(_storeAddress).getSchema(table); } } function getKeySchema(bytes32 table) internal view returns (Schema keySchema) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { keySchema = StoreCore.getKeySchema(table); } else { - keySchema = IStore(msg.sender).getKeySchema(table); + keySchema = IStore(_storeAddress).getKeySchema(table); } } function setMetadata(bytes32 table, string memory tableName, string[] memory fieldNames) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.setMetadata(table, tableName, fieldNames); } else { - IStore(msg.sender).setMetadata(table, tableName, fieldNames); + IStore(_storeAddress).setMetadata(table, tableName, fieldNames); } } function registerSchema(bytes32 table, Schema schema, Schema keySchema) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.registerSchema(table, schema, keySchema); } else { - IStore(msg.sender).registerSchema(table, schema, keySchema); + IStore(_storeAddress).registerSchema(table, schema, keySchema); } } function setRecord(bytes32 table, bytes32[] memory key, bytes memory data) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.setRecord(table, key, data); } else { - IStore(msg.sender).setRecord(table, key, data); + IStore(_storeAddress).setRecord(table, key, data); } } function setField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, bytes memory data) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.setField(table, key, fieldIndex, data); } else { - IStore(msg.sender).setField(table, key, fieldIndex, data); + IStore(_storeAddress).setField(table, key, fieldIndex, data); } } function pushToField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, bytes memory dataToPush) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.pushToField(table, key, fieldIndex, dataToPush); } else { - IStore(msg.sender).pushToField(table, key, fieldIndex, dataToPush); + IStore(_storeAddress).pushToField(table, key, fieldIndex, dataToPush); } } function popFromField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, uint256 byteLengthToPop) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.popFromField(table, key, fieldIndex, byteLengthToPop); } else { - IStore(msg.sender).popFromField(table, key, fieldIndex, byteLengthToPop); + IStore(_storeAddress).popFromField(table, key, fieldIndex, byteLengthToPop); } } @@ -115,50 +117,56 @@ library StoreSwitch { uint256 startByteIndex, bytes memory dataToSet ) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.updateInField(table, key, fieldIndex, startByteIndex, dataToSet); } else { - IStore(msg.sender).updateInField(table, key, fieldIndex, startByteIndex, dataToSet); + IStore(_storeAddress).updateInField(table, key, fieldIndex, startByteIndex, dataToSet); } } function deleteRecord(bytes32 table, bytes32[] memory key) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.deleteRecord(table, key); } else { - IStore(msg.sender).deleteRecord(table, key); + IStore(_storeAddress).deleteRecord(table, key); } } function emitEphemeralRecord(bytes32 table, bytes32[] memory key, bytes memory data) internal { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { StoreCore.emitEphemeralRecord(table, key, data); } else { - IStore(msg.sender).emitEphemeralRecord(table, key, data); + IStore(_storeAddress).emitEphemeralRecord(table, key, data); } } function getRecord(bytes32 table, bytes32[] memory key) internal view returns (bytes memory) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { return StoreCore.getRecord(table, key); } else { - return IStore(msg.sender).getRecord(table, key); + return IStore(_storeAddress).getRecord(table, key); } } function getRecord(bytes32 table, bytes32[] memory key, Schema schema) internal view returns (bytes memory) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { return StoreCore.getRecord(table, key, schema); } else { - return IStore(msg.sender).getRecord(table, key, schema); + return IStore(_storeAddress).getRecord(table, key, schema); } } function getField(bytes32 table, bytes32[] memory key, uint8 fieldIndex) internal view returns (bytes memory) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { return StoreCore.getField(table, key, fieldIndex); } else { - return IStore(msg.sender).getField(table, key, fieldIndex); + return IStore(_storeAddress).getField(table, key, fieldIndex); } } @@ -168,10 +176,11 @@ library StoreSwitch { uint8 fieldIndex, Schema schema ) internal view returns (uint256) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { return StoreCore.getFieldLength(table, key, fieldIndex, schema); } else { - return IStore(msg.sender).getFieldLength(table, key, fieldIndex, schema); + return IStore(_storeAddress).getFieldLength(table, key, fieldIndex, schema); } } @@ -183,10 +192,11 @@ library StoreSwitch { uint256 start, uint256 end ) internal view returns (bytes memory) { - if (isDelegateCall()) { + address _storeAddress = storeAddress(); + if (_storeAddress == address(this)) { return StoreCore.getFieldSlice(table, key, fieldIndex, schema, start, end); } else { - return IStore(msg.sender).getFieldSlice(table, key, fieldIndex, schema, start, end); + return IStore(_storeAddress).getFieldSlice(table, key, fieldIndex, schema, start, end); } } } diff --git a/packages/store/test/StoreSwitch.t.sol b/packages/store/test/StoreSwitch.t.sol index cbfebeb780..665e07811f 100644 --- a/packages/store/test/StoreSwitch.t.sol +++ b/packages/store/test/StoreSwitch.t.sol @@ -20,16 +20,16 @@ contract StoreSwitchTestStore is StoreReadWithStubs { function callViaCall() public returns (bool isDelegate) { (bool success, bytes memory data) = address(mockConsumer).call(abi.encodeWithSignature("isDelegateCall()")); - if (!success) revert("delegatecall failed"); + if (!success) revert("call failed"); isDelegate = abi.decode(data, (bool)); } } -// Mock consumer to wrap StoreSwitch.isDelegateCall() +// Mock consumer to wrap StoreSwitch.storeAddress() comparison contract MockStoreConsumer is StoreConsumer, GasReporter { function isDelegateCall() public returns (bool isDelegate) { startGasReport("check if delegatecall"); - isDelegate = StoreSwitch.isDelegateCall(); + isDelegate = StoreSwitch.storeAddress() == address(this); endGasReport(); } } diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 4bd7d8b7ba..cccdc0d3d5 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,67 +3,67 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1303862 + "gasUsed": 1302800 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1303862 + "gasUsed": 1302800 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 197985 + "gasUsed": 197955 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1303862 + "gasUsed": 1302800 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1303862 + "gasUsed": 1302800 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 31107 + "gasUsed": 31099 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 305696 + "gasUsed": 305593 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1303862 + "gasUsed": 1302800 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 29722 + "gasUsed": 29714 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 160625 + "gasUsed": 160570 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValue", "name": "install keys with value module", - "gasUsed": 638683 + "gasUsed": 638100 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,49 +81,49 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 638683 + "gasUsed": 638100 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 169568 + "gasUsed": 169494 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 638683 + "gasUsed": 638100 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 139222 + "gasUsed": 139149 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 56746 + "gasUsed": 56705 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 638683 + "gasUsed": 638100 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 177644 + "gasUsed": 177570 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 142003 + "gasUsed": 141929 }, { "file": "test/query.t.sol", @@ -195,126 +195,126 @@ "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 45930 + "gasUsed": 45805 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 65221 + "gasUsed": 65060 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 842466 + "gasUsed": 841314 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 75985 + "gasUsed": 75824 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 810686 + "gasUsed": 809659 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 75985 + "gasUsed": 75824 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 16909 + "gasUsed": 16859 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 97267 + "gasUsed": 97217 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 90040 + "gasUsed": 89852 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 81246 + "gasUsed": 81058 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 110634 + "gasUsed": 110446 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 165455 + "gasUsed": 165205 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 97149 + "gasUsed": 96961 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 267695 + "gasUsed": 267345 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 45592 + "gasUsed": 45542 }, { "file": "test/World.t.sol", "test": "testSetMetadata", "name": "Set metadata", - "gasUsed": 285656 + "gasUsed": 285518 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 43447 + "gasUsed": 43397 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 38745 + "gasUsed": 38695 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 23542 + "gasUsed": 23492 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 41121 + "gasUsed": 41071 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 26323 + "gasUsed": 26273 } ] diff --git a/packages/world/src/Utils.sol b/packages/world/src/Utils.sol index 5446441c1b..2ccb1a7c8a 100644 --- a/packages/world/src/Utils.sol +++ b/packages/world/src/Utils.sol @@ -14,7 +14,7 @@ library Utils { * because they're delegatecalled and the name isn't passed in calldata */ function systemNamespace() internal view returns (bytes16) { - if (StoreSwitch.isDelegateCall()) { + if (StoreSwitch.storeAddress() == address(this)) { return ""; } else { bytes32 resourceSelector = SystemRegistry.get(address(this)); diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 868bd42f3c..f010721469 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -72,7 +72,7 @@ contract WorldTestSystem is System { function writeData(bytes16 namespace, bytes16 name, bool data) public { bytes32[] memory key = new bytes32[](0); - if (StoreSwitch.isDelegateCall()) { + if (StoreSwitch.storeAddress() == address(this)) { bytes32 tableId = ResourceSelector.from(namespace, name); StoreCore.setRecord(tableId, key, abi.encodePacked(data)); } else { @@ -81,7 +81,7 @@ contract WorldTestSystem is System { } function emitCallType() public { - if (StoreSwitch.isDelegateCall()) { + if (StoreSwitch.storeAddress() == address(this)) { emit WorldTestSystemLog("delegatecall"); } else { emit WorldTestSystemLog("call"); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 15b0a1b6a4..912aaaea56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -880,6 +880,9 @@ importers: '@latticexyz/solecs': specifier: workspace:* version: link:../solecs + '@latticexyz/store': + specifier: workspace:* + version: link:../store '@solidstate/contracts': specifier: ^0.0.52 version: 0.0.52 From 37bb3d7ac4ea9fb2865dadb6c404dac81757d224 Mon Sep 17 00:00:00 2001 From: dk1a Date: Wed, 21 Jun 2023 14:30:46 +0300 Subject: [PATCH 08/25] rebuild and simplify examples --- .../packages/contracts/test/CounterTest.t.sol | 8 +-- .../types/ethers-contracts/IWorld.ts | 49 +++++++++++++------ .../factories/IWorld__factory.ts | 26 +++++++--- 3 files changed, 58 insertions(+), 25 deletions(-) diff --git a/examples/minimal/packages/contracts/test/CounterTest.t.sol b/examples/minimal/packages/contracts/test/CounterTest.t.sol index 3c36c877ff..13da16031c 100644 --- a/examples/minimal/packages/contracts/test/CounterTest.t.sol +++ b/examples/minimal/packages/contracts/test/CounterTest.t.sol @@ -30,19 +30,19 @@ contract CounterTest is MudV2Test { function testCounter() public { // Expect the counter to be 1 because it was incremented in the PostDeploy script. bytes32 key = SingletonKey; - uint32 counter = CounterTable.get(world, key); + uint32 counter = CounterTable.get(key); assertEq(counter, 1); // Expect the counter to be 2 after calling increment. world.increment(); - counter = CounterTable.get(world, key); + counter = CounterTable.get(key); assertEq(counter, 2); } function testKeysWithValue() public { bytes32 key = SingletonKey; - uint32 counter = CounterTable.get(world, key); - bytes32[] memory keysWithValue = getKeysWithValue(world, CounterTableTableId, CounterTable.encode(counter)); + uint32 counter = CounterTable.get(key); + bytes32[] memory keysWithValue = getKeysWithValue(CounterTableTableId, CounterTable.encode(counter)); assertEq(keysWithValue.length, 1); } } diff --git a/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts b/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts index 386ad0b860..019e0ec3bf 100644 --- a/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts +++ b/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts @@ -56,7 +56,6 @@ export interface IWorldInterface extends utils.Interface { "increment()": FunctionFragment; "installModule(address,bytes)": FunctionFragment; "installRootModule(address,bytes)": FunctionFragment; - "isStore()": FunctionFragment; "pickUp(uint32,uint32)": FunctionFragment; "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)": FunctionFragment; "popFromField(bytes32,bytes32[],uint8,uint256)": FunctionFragment; @@ -82,6 +81,7 @@ export interface IWorldInterface extends utils.Interface { "setRecord(bytes32,bytes32[],bytes)": FunctionFragment; "staticArrayBytesStruct(tuple[1])": FunctionFragment; "staticArrayStringStruct(tuple[1])": FunctionFragment; + "storeAddress(address)": FunctionFragment; "updateInField(bytes32,bytes32[],uint8,uint256,bytes)": FunctionFragment; "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)": FunctionFragment; "willRevert()": FunctionFragment; @@ -107,7 +107,6 @@ export interface IWorldInterface extends utils.Interface { | "increment" | "installModule" | "installRootModule" - | "isStore" | "pickUp" | "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)" | "popFromField(bytes32,bytes32[],uint8,uint256)" @@ -133,6 +132,7 @@ export interface IWorldInterface extends utils.Interface { | "setRecord(bytes32,bytes32[],bytes)" | "staticArrayBytesStruct" | "staticArrayStringStruct" + | "storeAddress" | "updateInField(bytes32,bytes32[],uint8,uint256,bytes)" | "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)" | "willRevert" @@ -248,7 +248,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "installRootModule", values: [PromiseOrValue, PromiseOrValue] ): string; - encodeFunctionData(functionFragment: "isStore", values?: undefined): string; encodeFunctionData( functionFragment: "pickUp", values: [PromiseOrValue, PromiseOrValue] @@ -440,6 +439,10 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "staticArrayStringStruct", values: [[StringStructStruct]] ): string; + encodeFunctionData( + functionFragment: "storeAddress", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", values: [ @@ -526,7 +529,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "installRootModule", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "isStore", data: BytesLike): Result; decodeFunctionResult(functionFragment: "pickUp", data: BytesLike): Result; decodeFunctionResult( functionFragment: "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)", @@ -624,6 +626,10 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "staticArrayStringStruct", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "storeAddress", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", data: BytesLike @@ -847,8 +853,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise<[void]>; - pickUp( item: PromiseOrValue, itemVariant: PromiseOrValue, @@ -1029,6 +1033,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { storeAddress: string }>; + "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -1169,8 +1178,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pickUp( item: PromiseOrValue, itemVariant: PromiseOrValue, @@ -1351,6 +1358,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -1489,8 +1501,6 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; - isStore(overrides?: CallOverrides): Promise; - pickUp( item: PromiseOrValue, itemVariant: PromiseOrValue, @@ -1671,6 +1681,11 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -1856,8 +1871,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pickUp( item: PromiseOrValue, itemVariant: PromiseOrValue, @@ -2038,6 +2051,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -2179,8 +2197,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pickUp( item: PromiseOrValue, itemVariant: PromiseOrValue, @@ -2361,6 +2377,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], diff --git a/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts b/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts index 65d99da0a2..596cced1e1 100644 --- a/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts +++ b/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts @@ -732,13 +732,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [], - name: "isStore", - outputs: [], - stateMutability: "view", - type: "function", - }, { inputs: [ { @@ -1377,6 +1370,25 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + ], + name: "storeAddress", + outputs: [ + { + internalType: "address", + name: "storeAddress", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { From f8b06ba8f5e28d1bab9e5c00200c904eb7d88c87 Mon Sep 17 00:00:00 2001 From: dk1a Date: Wed, 21 Jun 2023 14:31:02 +0300 Subject: [PATCH 09/25] rebuild e2e --- .../types/ethers-contracts/IWorld.ts | 49 +++++++++++++------ .../factories/IWorld__factory.ts | 26 +++++++--- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/e2e/packages/contracts/types/ethers-contracts/IWorld.ts b/e2e/packages/contracts/types/ethers-contracts/IWorld.ts index 4bbea196ed..116eb48b6d 100644 --- a/e2e/packages/contracts/types/ethers-contracts/IWorld.ts +++ b/e2e/packages/contracts/types/ethers-contracts/IWorld.ts @@ -45,7 +45,6 @@ export interface IWorldInterface extends utils.Interface { "grantAccess(bytes16,bytes16,address)": FunctionFragment; "installModule(address,bytes)": FunctionFragment; "installRootModule(address,bytes)": FunctionFragment; - "isStore()": FunctionFragment; "pop()": FunctionFragment; "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)": FunctionFragment; "popFromField(bytes32,bytes32[],uint8,uint256)": FunctionFragment; @@ -71,6 +70,7 @@ export interface IWorldInterface extends utils.Interface { "setMetadata(bytes32,string,string[])": FunctionFragment; "setRecord(bytes16,bytes16,bytes32[],bytes)": FunctionFragment; "setRecord(bytes32,bytes32[],bytes)": FunctionFragment; + "storeAddress(address)": FunctionFragment; "stub(uint256)": FunctionFragment; "updateInField(bytes32,bytes32[],uint8,uint256,bytes)": FunctionFragment; "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)": FunctionFragment; @@ -93,7 +93,6 @@ export interface IWorldInterface extends utils.Interface { | "grantAccess" | "installModule" | "installRootModule" - | "isStore" | "pop" | "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)" | "popFromField(bytes32,bytes32[],uint8,uint256)" @@ -119,6 +118,7 @@ export interface IWorldInterface extends utils.Interface { | "setMetadata(bytes32,string,string[])" | "setRecord(bytes16,bytes16,bytes32[],bytes)" | "setRecord(bytes32,bytes32[],bytes)" + | "storeAddress" | "stub" | "updateInField(bytes32,bytes32[],uint8,uint256,bytes)" | "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)" @@ -225,7 +225,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "installRootModule", values: [PromiseOrValue, PromiseOrValue] ): string; - encodeFunctionData(functionFragment: "isStore", values?: undefined): string; encodeFunctionData(functionFragment: "pop", values?: undefined): string; encodeFunctionData( functionFragment: "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)", @@ -414,6 +413,10 @@ export interface IWorldInterface extends utils.Interface { PromiseOrValue ] ): string; + encodeFunctionData( + functionFragment: "storeAddress", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "stub", values: [PromiseOrValue] @@ -491,7 +494,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "installRootModule", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "isStore", data: BytesLike): Result; decodeFunctionResult(functionFragment: "pop", data: BytesLike): Result; decodeFunctionResult( functionFragment: "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)", @@ -580,6 +582,10 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "setRecord(bytes32,bytes32[],bytes)", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "storeAddress", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "stub", data: BytesLike): Result; decodeFunctionResult( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", @@ -789,8 +795,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise<[void]>; - pop( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -970,6 +974,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { storeAddress: string }>; + stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1097,8 +1106,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pop( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1278,6 +1285,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1405,8 +1417,6 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; - isStore(overrides?: CallOverrides): Promise; - pop(overrides?: CallOverrides): Promise; "popFromField(bytes16,bytes16,bytes32[],uint8,uint256)"( @@ -1584,6 +1594,11 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1758,8 +1773,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pop( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1939,6 +1952,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -2067,8 +2085,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - isStore(overrides?: CallOverrides): Promise; - pop( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -2248,6 +2264,11 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + storeAddress( + msgSender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + stub( arg: PromiseOrValue, overrides?: CallOverrides diff --git a/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts b/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts index 002247e9df..1aa6fb4239 100644 --- a/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts +++ b/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts @@ -717,13 +717,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [], - name: "isStore", - outputs: [], - stateMutability: "view", - type: "function", - }, { inputs: [], name: "pop", @@ -1342,6 +1335,25 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + ], + name: "storeAddress", + outputs: [ + { + internalType: "address", + name: "storeAddress", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { From f47079dba94fc1b553570d92565af6215980a6b8 Mon Sep 17 00:00:00 2001 From: dk1a Date: Wed, 21 Jun 2023 18:00:09 +0300 Subject: [PATCH 10/25] refactor MudV2Test to avoid circular dependencies --- docs/pages/world/world-101.mdx | 10 +- e2e/packages/contracts/package.json | 1 - e2e/packages/contracts/test/Worldgen.t.sol | 4 +- e2e/pnpm-lock.yaml | 3 - .../minimal/packages/contracts/package.json | 1 - .../contracts/test/ChatNamespaced.t.sol | 4 +- .../packages/contracts/test/CounterTest.t.sol | 4 +- .../packages/contracts/test/StructTest.t.sol | 4 +- examples/minimal/pnpm-lock.yaml | 5 +- packages/std-contracts/package.json | 1 - .../abi/Base.sol/CommonBase.abi.json} | 0 .../store/abi/Base.sol/ScriptBase.abi.json | 1 + packages/store/abi/Base.sol/TestBase.abi.json | 1 + .../abi/IMulticall3.sol/IMulticall3.abi.json | 440 +++ .../store/abi/MudTest.sol/MudTest.abi.json | 546 +++ .../StdAssertions.sol/StdAssertions.abi.json | 392 ++ .../abi/StdChains.sol/StdChains.abi.json | 1 + .../abi/StdCheats.sol/StdCheats.abi.json | 1 + .../abi/StdCheats.sol/StdCheatsSafe.abi.json | 1 + .../store/abi/StdError.sol/stdError.abi.json | 119 + .../StdInvariant.sol/StdInvariant.abi.json | 130 + .../store/abi/StdJson.sol/stdJson.abi.json | 1 + .../store/abi/StdMath.sol/stdMath.abi.json | 1 + .../abi/StdStorage.sol/stdStorage.abi.json | 1 + .../StdStorage.sol/stdStorageSafe.abi.json | 52 + .../store/abi/StdUtils.sol/StdUtils.abi.json | 1 + packages/store/abi/Test.sol/Test.abi.json | 520 +++ packages/store/abi/Vm.sol/Vm.abi.json | 3247 +++++++++++++++++ packages/store/abi/Vm.sol/VmSafe.abi.json | 2420 ++++++++++++ .../store/abi/console2.sol/console2.abi.json | 1 + packages/store/abi/test.sol/DSTest.abi.json | 296 ++ .../MudV2Test.t.sol => store/src/MudTest.sol} | 6 +- pnpm-lock.yaml | 3 - 33 files changed, 8189 insertions(+), 29 deletions(-) rename packages/{world/abi/WorldContext.sol/WorldContext.abi.json => store/abi/Base.sol/CommonBase.abi.json} (100%) create mode 100644 packages/store/abi/Base.sol/ScriptBase.abi.json create mode 100644 packages/store/abi/Base.sol/TestBase.abi.json create mode 100644 packages/store/abi/IMulticall3.sol/IMulticall3.abi.json create mode 100644 packages/store/abi/MudTest.sol/MudTest.abi.json create mode 100644 packages/store/abi/StdAssertions.sol/StdAssertions.abi.json create mode 100644 packages/store/abi/StdChains.sol/StdChains.abi.json create mode 100644 packages/store/abi/StdCheats.sol/StdCheats.abi.json create mode 100644 packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json create mode 100644 packages/store/abi/StdError.sol/stdError.abi.json create mode 100644 packages/store/abi/StdInvariant.sol/StdInvariant.abi.json create mode 100644 packages/store/abi/StdJson.sol/stdJson.abi.json create mode 100644 packages/store/abi/StdMath.sol/stdMath.abi.json create mode 100644 packages/store/abi/StdStorage.sol/stdStorage.abi.json create mode 100644 packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json create mode 100644 packages/store/abi/StdUtils.sol/StdUtils.abi.json create mode 100644 packages/store/abi/Test.sol/Test.abi.json create mode 100644 packages/store/abi/Vm.sol/Vm.abi.json create mode 100644 packages/store/abi/Vm.sol/VmSafe.abi.json create mode 100644 packages/store/abi/console2.sol/console2.abi.json create mode 100644 packages/store/abi/test.sol/DSTest.abi.json rename packages/{std-contracts/src/test/MudV2Test.t.sol => store/src/MudTest.sol} (65%) diff --git a/docs/pages/world/world-101.mdx b/docs/pages/world/world-101.mdx index 228d186b72..e958aa5891 100644 --- a/docs/pages/world/world-101.mdx +++ b/docs/pages/world/world-101.mdx @@ -256,11 +256,11 @@ Create a new file named `MySystemTest.t.sol` in the `test` folder. pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { Dog, DogId } from "../src/codegen/Tables.sol"; -contract MySystemTest is MudV2Test { +contract MySystemTest is MudTest { IWorld world; function setUp() public override { @@ -271,10 +271,10 @@ contract MySystemTest is MudV2Test { function testAddEntry() public { // Add a new entry to the Dog via the system // this will call the addEntry function on MySystem - bytes32 key = World.addEntry("bob", "blue"); + bytes32 key = world.addEntry("bob", "blue"); // Expect the value retrieved from the Dog at the corresponding key to match "bob" and "blue" - string memory name = Dog.getName(world, key); - string memory color = Dog.getColor(world, key); + string memory name = Dog.getName(key); + string memory color = Dog.getColor(key); assertEq(name, "bob"); assertEq(color, "blue"); } diff --git a/e2e/packages/contracts/package.json b/e2e/packages/contracts/package.json index f454a2bd9a..29a1b1bf8d 100644 --- a/e2e/packages/contracts/package.json +++ b/e2e/packages/contracts/package.json @@ -20,7 +20,6 @@ "@latticexyz/cli": "link:../../../packages/cli", "@latticexyz/config": "link:../../../packages/config", "@latticexyz/schema-type": "link:../../../packages/schema-type", - "@latticexyz/std-contracts": "link:../../../packages/std-contracts", "@latticexyz/store": "link:../../../packages/store", "@latticexyz/world": "link:../../../packages/world", "@typechain/ethers-v5": "^10.2.0", diff --git a/e2e/packages/contracts/test/Worldgen.t.sol b/e2e/packages/contracts/test/Worldgen.t.sol index 631e342644..2b2c88565e 100644 --- a/e2e/packages/contracts/test/Worldgen.t.sol +++ b/e2e/packages/contracts/test/Worldgen.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { ICustomErrorsSystem } from "../src/codegen/world/ICustomErrorsSystem.sol"; import { Position } from "../src/CustomTypes.sol"; -contract WorldgenTest is MudV2Test { +contract WorldgenTest is MudTest { function testError1WasGenerated() public { vm.expectRevert(); revert ICustomErrorsSystem.TestError1(); diff --git a/e2e/pnpm-lock.yaml b/e2e/pnpm-lock.yaml index 882378b586..d13663a39b 100644 --- a/e2e/pnpm-lock.yaml +++ b/e2e/pnpm-lock.yaml @@ -104,9 +104,6 @@ importers: '@latticexyz/schema-type': specifier: link:../../../packages/schema-type version: link:../../../packages/schema-type - '@latticexyz/std-contracts': - specifier: link:../../../packages/std-contracts - version: link:../../../packages/std-contracts '@latticexyz/store': specifier: link:../../../packages/store version: link:../../../packages/store diff --git a/examples/minimal/packages/contracts/package.json b/examples/minimal/packages/contracts/package.json index 5fcd510bc4..dbdc13c5b6 100644 --- a/examples/minimal/packages/contracts/package.json +++ b/examples/minimal/packages/contracts/package.json @@ -26,7 +26,6 @@ "@latticexyz/config": "link:../../../../packages/config", "@latticexyz/schema-type": "link:../../../../packages/schema-type", "@latticexyz/solecs": "link:../../../../packages/solecs", - "@latticexyz/std-contracts": "link:../../../../packages/std-contracts", "@latticexyz/store": "link:../../../../packages/store", "@latticexyz/world": "link:../../../../packages/world", "@solidstate/contracts": "^0.0.52", diff --git a/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol b/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol index c7dfa0ff9e..c98a25a337 100644 --- a/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol +++ b/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { StoreCore } from "@latticexyz/store/src/StoreCore.sol"; @@ -10,7 +10,7 @@ import { IWorld } from "../src/codegen/world/IWorld.sol"; import { MessageTable, MessageTableTableId } from "../src/codegen/Tables.sol"; import { IChatNamespacedSystem } from "../src/interfaces/IChatNamespacedSystem.sol"; -contract ChatNamespacedTest is MudV2Test { +contract ChatNamespacedTest is MudTest { function testEmitEphemeral() public { bytes32[] memory keyTuple; vm.expectEmit(true, true, true, true); diff --git a/examples/minimal/packages/contracts/test/CounterTest.t.sol b/examples/minimal/packages/contracts/test/CounterTest.t.sol index 13da16031c..a71bc1fc4e 100644 --- a/examples/minimal/packages/contracts/test/CounterTest.t.sol +++ b/examples/minimal/packages/contracts/test/CounterTest.t.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; @@ -10,7 +10,7 @@ import { CounterTable, CounterTableTableId } from "../src/codegen/Tables.sol"; import { SingletonKey } from "../src/systems/IncrementSystem.sol"; -contract CounterTest is MudV2Test { +contract CounterTest is MudTest { IWorld world; function setUp() public override { diff --git a/examples/minimal/packages/contracts/test/StructTest.t.sol b/examples/minimal/packages/contracts/test/StructTest.t.sol index 8b4f85a57d..d18f842a4f 100644 --- a/examples/minimal/packages/contracts/test/StructTest.t.sol +++ b/examples/minimal/packages/contracts/test/StructTest.t.sol @@ -2,14 +2,14 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { CounterTable, CounterTableTableId } from "../src/codegen/Tables.sol"; import { BytesStruct, StringStruct } from "../src/systems/structs.sol"; -contract StructTest is MudV2Test { +contract StructTest is MudTest { IWorld world; function setUp() public override { diff --git a/examples/minimal/pnpm-lock.yaml b/examples/minimal/pnpm-lock.yaml index 7c3f69dd4e..5ee3e1749c 100644 --- a/examples/minimal/pnpm-lock.yaml +++ b/examples/minimal/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -356,9 +356,6 @@ importers: '@latticexyz/solecs': specifier: link:../../../../packages/solecs version: link:../../../../packages/solecs - '@latticexyz/std-contracts': - specifier: link:../../../../packages/std-contracts - version: link:../../../../packages/std-contracts '@latticexyz/store': specifier: link:../../../../packages/store version: link:../../../../packages/store diff --git a/packages/std-contracts/package.json b/packages/std-contracts/package.json index 01018f6830..6c9235f24e 100644 --- a/packages/std-contracts/package.json +++ b/packages/std-contracts/package.json @@ -22,7 +22,6 @@ }, "devDependencies": { "@latticexyz/solecs": "workspace:*", - "@latticexyz/store": "workspace:*", "@solidstate/contracts": "^0.0.52", "@typechain/ethers-v5": "^10.2.0", "ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084", diff --git a/packages/world/abi/WorldContext.sol/WorldContext.abi.json b/packages/store/abi/Base.sol/CommonBase.abi.json similarity index 100% rename from packages/world/abi/WorldContext.sol/WorldContext.abi.json rename to packages/store/abi/Base.sol/CommonBase.abi.json diff --git a/packages/store/abi/Base.sol/ScriptBase.abi.json b/packages/store/abi/Base.sol/ScriptBase.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/Base.sol/ScriptBase.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/Base.sol/TestBase.abi.json b/packages/store/abi/Base.sol/TestBase.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/Base.sol/TestBase.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json b/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json new file mode 100644 index 0000000000..d73bebdc5a --- /dev/null +++ b/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json @@ -0,0 +1,440 @@ +[ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "returnData", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call3[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call3Value[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3Value", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "blockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "basefee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockCoinbase", + "outputs": [ + { + "internalType": "address", + "name": "coinbase", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockDifficulty", + "outputs": [ + { + "internalType": "uint256", + "name": "difficulty", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "gaslimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getEthBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryAggregate", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryBlockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct IMulticall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/MudTest.sol/MudTest.abi.json b/packages/store/abi/MudTest.sol/MudTest.abi.json new file mode 100644 index 0000000000..8bf6ff83e7 --- /dev/null +++ b/packages/store/abi/MudTest.sol/MudTest.abi.json @@ -0,0 +1,546 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "log_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "log_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "log_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "name": "log_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "val", + "type": "address" + } + ], + "name": "log_named_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "val", + "type": "bytes" + } + ], + "name": "log_named_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "val", + "type": "bytes32" + } + ], + "name": "log_named_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + } + ], + "name": "log_named_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "val", + "type": "string" + } + ], + "name": "log_named_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log_named_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "log_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "logs", + "type": "event" + }, + { + "inputs": [], + "name": "IS_TEST", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "excludedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "failed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "storeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifactSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedArtifactSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "targetedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json b/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json new file mode 100644 index 0000000000..40e4824345 --- /dev/null +++ b/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json @@ -0,0 +1,392 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "log_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "log_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "log_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "name": "log_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "val", + "type": "address" + } + ], + "name": "log_named_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "val", + "type": "bytes" + } + ], + "name": "log_named_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "val", + "type": "bytes32" + } + ], + "name": "log_named_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + } + ], + "name": "log_named_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "val", + "type": "string" + } + ], + "name": "log_named_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log_named_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "log_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "logs", + "type": "event" + }, + { + "inputs": [], + "name": "IS_TEST", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "failed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StdChains.sol/StdChains.abi.json b/packages/store/abi/StdChains.sol/StdChains.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdChains.sol/StdChains.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdCheats.sol/StdCheats.abi.json b/packages/store/abi/StdCheats.sol/StdCheats.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdCheats.sol/StdCheats.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json b/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdError.sol/stdError.abi.json b/packages/store/abi/StdError.sol/stdError.abi.json new file mode 100644 index 0000000000..4d90b15f05 --- /dev/null +++ b/packages/store/abi/StdError.sol/stdError.abi.json @@ -0,0 +1,119 @@ +[ + { + "inputs": [], + "name": "arithmeticError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "assertionError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "divisionError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "encodeStorageError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "enumConversionError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "indexOOBError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "memOverflowError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "popError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "zeroVarError", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json b/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json new file mode 100644 index 0000000000..d67ff63595 --- /dev/null +++ b/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json @@ -0,0 +1,130 @@ +[ + { + "inputs": [], + "name": "excludeArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "excludedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifactSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedArtifactSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "targetedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StdJson.sol/stdJson.abi.json b/packages/store/abi/StdJson.sol/stdJson.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdJson.sol/stdJson.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdMath.sol/stdMath.abi.json b/packages/store/abi/StdMath.sol/stdMath.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdMath.sol/stdMath.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdStorage.sol/stdStorage.abi.json b/packages/store/abi/StdStorage.sol/stdStorage.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdStorage.sol/stdStorage.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json b/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json new file mode 100644 index 0000000000..7c8aa664b5 --- /dev/null +++ b/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json @@ -0,0 +1,52 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "who", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes4", + "name": "fsig", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "keysHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "slot", + "type": "uint256" + } + ], + "name": "SlotFound", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "who", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "slot", + "type": "uint256" + } + ], + "name": "WARNING_UninitedSlot", + "type": "event" + } +] \ No newline at end of file diff --git a/packages/store/abi/StdUtils.sol/StdUtils.abi.json b/packages/store/abi/StdUtils.sol/StdUtils.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/StdUtils.sol/StdUtils.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/Test.sol/Test.abi.json b/packages/store/abi/Test.sol/Test.abi.json new file mode 100644 index 0000000000..2e54832e26 --- /dev/null +++ b/packages/store/abi/Test.sol/Test.abi.json @@ -0,0 +1,520 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "log_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "log_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "log_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "name": "log_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "val", + "type": "address" + } + ], + "name": "log_named_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "val", + "type": "uint256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "val", + "type": "int256[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "val", + "type": "address[]" + } + ], + "name": "log_named_array", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "val", + "type": "bytes" + } + ], + "name": "log_named_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "val", + "type": "bytes32" + } + ], + "name": "log_named_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + } + ], + "name": "log_named_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "val", + "type": "string" + } + ], + "name": "log_named_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log_named_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "log_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "logs", + "type": "event" + }, + { + "inputs": [], + "name": "IS_TEST", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "excludedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "excludeSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "excludedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "failed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifactSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedArtifactSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetArtifacts", + "outputs": [ + { + "internalType": "string[]", + "name": "targetedArtifacts_", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetContracts", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedContracts_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSelectors", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } + ], + "internalType": "struct StdInvariant.FuzzSelector[]", + "name": "targetedSelectors_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetSenders", + "outputs": [ + { + "internalType": "address[]", + "name": "targetedSenders_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/Vm.sol/Vm.abi.json b/packages/store/abi/Vm.sol/Vm.abi.json new file mode 100644 index 0000000000..b36288bc80 --- /dev/null +++ b/packages/store/abi/Vm.sol/Vm.abi.json @@ -0,0 +1,3247 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "accesses", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "readSlots", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "writeSlots", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "activeFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "address", + "name": "keyAddr", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowCheatcodes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "condition", + "type": "bool" + } + ], + "name": "assume", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newChainId", + "type": "uint256" + } + ], + "name": "chainId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearMockedCalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "closeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newCoinbase", + "type": "address" + } + ], + "name": "coinbase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + } + ], + "name": "createFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "createFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "createFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "createSelectFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "createSelectFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "urlOrAlias", + "type": "string" + } + ], + "name": "createSelectFork", + "outputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "deal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "mnemonic", + "type": "string" + }, + { + "internalType": "uint32", + "name": "index", + "type": "uint32" + } + ], + "name": "deriveKey", + "outputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "mnemonic", + "type": "string" + }, + { + "internalType": "string", + "name": "derivationPath", + "type": "string" + }, + { + "internalType": "uint32", + "name": "index", + "type": "uint32" + } + ], + "name": "deriveKey", + "outputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newDifficulty", + "type": "uint256" + } + ], + "name": "difficulty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envAddress", + "outputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envAddress", + "outputs": [ + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBool", + "outputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBool", + "outputs": [ + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBytes", + "outputs": [ + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBytes32", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envInt", + "outputs": [ + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envInt", + "outputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "defaultValue", + "type": "bytes32[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "defaultValue", + "type": "int256[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bool", + "name": "defaultValue", + "type": "bool" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "defaultValue", + "type": "address" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "defaultValue", + "type": "uint256" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "defaultValue", + "type": "bytes[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "defaultValue", + "type": "uint256[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "string[]", + "name": "defaultValue", + "type": "string[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes", + "name": "defaultValue", + "type": "bytes" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "defaultValue", + "type": "bytes32" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "int256", + "name": "defaultValue", + "type": "int256" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "address[]", + "name": "defaultValue", + "type": "address[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "defaultValue", + "type": "string" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "defaultValue", + "type": "bool[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envString", + "outputs": [ + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envString", + "outputs": [ + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envUint", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envUint", + "outputs": [ + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "newRuntimeBytecode", + "type": "bytes" + } + ], + "name": "etch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "callee", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "expectCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "callee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "expectCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "checkTopic1", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkTopic2", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkTopic3", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkData", + "type": "bool" + } + ], + "name": "expectEmit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "checkTopic1", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkTopic2", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkTopic3", + "type": "bool" + }, + { + "internalType": "bool", + "name": "checkData", + "type": "bool" + }, + { + "internalType": "address", + "name": "emitter", + "type": "address" + } + ], + "name": "expectEmit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "revertData", + "type": "bytes4" + } + ], + "name": "expectRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "revertData", + "type": "bytes" + } + ], + "name": "expectRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "expectRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newBasefee", + "type": "uint256" + } + ], + "name": "fee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "commandInput", + "type": "string[]" + } + ], + "name": "ffi", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "fileOrDir", + "type": "string" + } + ], + "name": "fsMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "isDir", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isSymlink", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "readOnly", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "modified", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accessed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "created", + "type": "uint256" + } + ], + "internalType": "struct VmSafe.FsMetadata", + "name": "metadata", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "artifactPath", + "type": "string" + } + ], + "name": "getCode", + "outputs": [ + { + "internalType": "bytes", + "name": "creationBytecode", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "artifactPath", + "type": "string" + } + ], + "name": "getDeployedCode", + "outputs": [ + { + "internalType": "bytes", + "name": "runtimeBytecode", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRecordedLogs", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32[]", + "name": "topics", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "emitter", + "type": "address" + } + ], + "internalType": "struct VmSafe.Log[]", + "name": "logs", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isPersistent", + "outputs": [ + { + "internalType": "bool", + "name": "persistent", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "label", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "load", + "outputs": [ + { + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + } + ], + "name": "makePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account0", + "type": "address" + }, + { + "internalType": "address", + "name": "account1", + "type": "address" + } + ], + "name": "makePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "makePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account0", + "type": "address" + }, + { + "internalType": "address", + "name": "account1", + "type": "address" + }, + { + "internalType": "address", + "name": "account2", + "type": "address" + } + ], + "name": "makePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "callee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "name": "mockCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "callee", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "name": "mockCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseAddress", + "outputs": [ + { + "internalType": "address", + "name": "parsedValue", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBool", + "outputs": [ + { + "internalType": "bool", + "name": "parsedValue", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "parsedValue", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "parsedValue", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseInt", + "outputs": [ + { + "internalType": "int256", + "name": "parsedValue", + "type": "int256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "name": "parseJson", + "outputs": [ + { + "internalType": "bytes", + "name": "abiEncodedData", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "parseJson", + "outputs": [ + { + "internalType": "bytes", + "name": "abiEncodedData", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonAddressArray", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBool", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBoolArray", + "outputs": [ + { + "internalType": "bool[]", + "name": "", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes32Array", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytesArray", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonIntArray", + "outputs": [ + { + "internalType": "int256[]", + "name": "", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonString", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonStringArray", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonUintArray", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseUint", + "outputs": [ + { + "internalType": "uint256", + "name": "parsedValue", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGasMetering", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + } + ], + "name": "prank", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "prank", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "projectRoot", + "outputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readFile", + "outputs": [ + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readFileBinary", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readLine", + "outputs": [ + { + "internalType": "string", + "name": "line", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "record", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "recordLogs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "rememberKey", + "outputs": [ + { + "internalType": "address", + "name": "keyAddr", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "removeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeGasMetering", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "revertTo", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + } + ], + "name": "revokePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokePersistent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newHeight", + "type": "uint256" + } + ], + "name": "roll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "rollFork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "rollFork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "rollFork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "rollFork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "rpcAlias", + "type": "string" + } + ], + "name": "rpcUrl", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rpcUrlStructs", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + } + ], + "internalType": "struct VmSafe.Rpc[]", + "name": "urls", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rpcUrls", + "outputs": [ + { + "internalType": "string[2][]", + "name": "urls", + "type": "string[2][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + } + ], + "name": "selectFork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "address[]", + "name": "values", + "type": "address[]" + } + ], + "name": "serializeAddress", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "serializeAddress", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "values", + "type": "bool[]" + } + ], + "name": "serializeBool", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "serializeBool", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "values", + "type": "bytes[]" + } + ], + "name": "serializeBytes", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "serializeBytes", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "values", + "type": "bytes32[]" + } + ], + "name": "serializeBytes32", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "serializeBytes32", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "serializeInt", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "values", + "type": "int256[]" + } + ], + "name": "serializeInt", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "string[]", + "name": "values", + "type": "string[]" + } + ], + "name": "serializeString", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "serializeString", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "serializeUint", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "serializeUint", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setEnv", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint64", + "name": "newNonce", + "type": "uint64" + } + ], + "name": "setNonce", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "sign", + "outputs": [ + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "startPrank", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + } + ], + "name": "startPrank", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopPrank", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "store", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "forkId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "transact", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + } + ], + "name": "transact", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newTimestamp", + "type": "uint256" + } + ], + "name": "warp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "writeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "writeFileBinary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + } + ], + "name": "writeJson", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "writeJson", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "writeLine", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/Vm.sol/VmSafe.abi.json b/packages/store/abi/Vm.sol/VmSafe.abi.json new file mode 100644 index 0000000000..72e4256f4a --- /dev/null +++ b/packages/store/abi/Vm.sol/VmSafe.abi.json @@ -0,0 +1,2420 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "accesses", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "readSlots", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[]", + "name": "writeSlots", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "address", + "name": "keyAddr", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "condition", + "type": "bool" + } + ], + "name": "assume", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "broadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "closeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "mnemonic", + "type": "string" + }, + { + "internalType": "uint32", + "name": "index", + "type": "uint32" + } + ], + "name": "deriveKey", + "outputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "mnemonic", + "type": "string" + }, + { + "internalType": "string", + "name": "derivationPath", + "type": "string" + }, + { + "internalType": "uint32", + "name": "index", + "type": "uint32" + } + ], + "name": "deriveKey", + "outputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envAddress", + "outputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envAddress", + "outputs": [ + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBool", + "outputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBool", + "outputs": [ + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBytes", + "outputs": [ + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envBytes32", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envInt", + "outputs": [ + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envInt", + "outputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "defaultValue", + "type": "bytes32[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "value", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "defaultValue", + "type": "int256[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "int256[]", + "name": "value", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bool", + "name": "defaultValue", + "type": "bool" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "defaultValue", + "type": "address" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "defaultValue", + "type": "uint256" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "defaultValue", + "type": "bytes[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes[]", + "name": "value", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "defaultValue", + "type": "uint256[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "string[]", + "name": "defaultValue", + "type": "string[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes", + "name": "defaultValue", + "type": "bytes" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "defaultValue", + "type": "bytes32" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "int256", + "name": "defaultValue", + "type": "int256" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "address[]", + "name": "defaultValue", + "type": "address[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "address[]", + "name": "value", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "defaultValue", + "type": "string" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "defaultValue", + "type": "bool[]" + } + ], + "name": "envOr", + "outputs": [ + { + "internalType": "bool[]", + "name": "value", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envString", + "outputs": [ + { + "internalType": "string[]", + "name": "value", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envString", + "outputs": [ + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "envUint", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "delim", + "type": "string" + } + ], + "name": "envUint", + "outputs": [ + { + "internalType": "uint256[]", + "name": "value", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "commandInput", + "type": "string[]" + } + ], + "name": "ffi", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "fileOrDir", + "type": "string" + } + ], + "name": "fsMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "isDir", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isSymlink", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "readOnly", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "modified", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accessed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "created", + "type": "uint256" + } + ], + "internalType": "struct VmSafe.FsMetadata", + "name": "metadata", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "artifactPath", + "type": "string" + } + ], + "name": "getCode", + "outputs": [ + { + "internalType": "bytes", + "name": "creationBytecode", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "artifactPath", + "type": "string" + } + ], + "name": "getDeployedCode", + "outputs": [ + { + "internalType": "bytes", + "name": "runtimeBytecode", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRecordedLogs", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32[]", + "name": "topics", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "emitter", + "type": "address" + } + ], + "internalType": "struct VmSafe.Log[]", + "name": "logs", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "label", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "load", + "outputs": [ + { + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseAddress", + "outputs": [ + { + "internalType": "address", + "name": "parsedValue", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBool", + "outputs": [ + { + "internalType": "bool", + "name": "parsedValue", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "parsedValue", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "parsedValue", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseInt", + "outputs": [ + { + "internalType": "int256", + "name": "parsedValue", + "type": "int256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "name": "parseJson", + "outputs": [ + { + "internalType": "bytes", + "name": "abiEncodedData", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "parseJson", + "outputs": [ + { + "internalType": "bytes", + "name": "abiEncodedData", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonAddressArray", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBool", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBoolArray", + "outputs": [ + { + "internalType": "bool[]", + "name": "", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes32", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytes32Array", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonBytesArray", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonInt", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonIntArray", + "outputs": [ + { + "internalType": "int256[]", + "name": "", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonString", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonStringArray", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "parseJsonUintArray", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "name": "parseUint", + "outputs": [ + { + "internalType": "uint256", + "name": "parsedValue", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGasMetering", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "projectRoot", + "outputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readFile", + "outputs": [ + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readFileBinary", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "readLine", + "outputs": [ + { + "internalType": "string", + "name": "line", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "record", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "recordLogs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "rememberKey", + "outputs": [ + { + "internalType": "address", + "name": "keyAddr", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "removeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeGasMetering", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "rpcAlias", + "type": "string" + } + ], + "name": "rpcUrl", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rpcUrlStructs", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + } + ], + "internalType": "struct VmSafe.Rpc[]", + "name": "urls", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rpcUrls", + "outputs": [ + { + "internalType": "string[2][]", + "name": "urls", + "type": "string[2][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "address[]", + "name": "values", + "type": "address[]" + } + ], + "name": "serializeAddress", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "serializeAddress", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bool[]", + "name": "values", + "type": "bool[]" + } + ], + "name": "serializeBool", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "serializeBool", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "values", + "type": "bytes[]" + } + ], + "name": "serializeBytes", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "serializeBytes", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes32[]", + "name": "values", + "type": "bytes32[]" + } + ], + "name": "serializeBytes32", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "serializeBytes32", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "serializeInt", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "int256[]", + "name": "values", + "type": "int256[]" + } + ], + "name": "serializeInt", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "string[]", + "name": "values", + "type": "string[]" + } + ], + "name": "serializeString", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "serializeString", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "serializeUint", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "objectKey", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "serializeUint", + "outputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setEnv", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "sign", + "outputs": [ + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "privateKey", + "type": "uint256" + } + ], + "name": "startBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopBroadcast", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "value", + "type": "address" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "value", + "type": "int256" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "toString", + "outputs": [ + { + "internalType": "string", + "name": "stringifiedValue", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "writeFile", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "writeFileBinary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "valueKey", + "type": "string" + } + ], + "name": "writeJson", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "json", + "type": "string" + }, + { + "internalType": "string", + "name": "path", + "type": "string" + } + ], + "name": "writeJson", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "path", + "type": "string" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "writeLine", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/console2.sol/console2.abi.json b/packages/store/abi/console2.sol/console2.abi.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/store/abi/console2.sol/console2.abi.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/store/abi/test.sol/DSTest.abi.json b/packages/store/abi/test.sol/DSTest.abi.json new file mode 100644 index 0000000000..272d1f160c --- /dev/null +++ b/packages/store/abi/test.sol/DSTest.abi.json @@ -0,0 +1,296 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "log_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "log_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "log_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "name": "log_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "val", + "type": "address" + } + ], + "name": "log_named_address", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "val", + "type": "bytes" + } + ], + "name": "log_named_bytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "val", + "type": "bytes32" + } + ], + "name": "log_named_bytes32", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "log_named_decimal_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "int256", + "name": "val", + "type": "int256" + } + ], + "name": "log_named_int", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "val", + "type": "string" + } + ], + "name": "log_named_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log_named_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "log_string", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "log_uint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "logs", + "type": "event" + }, + { + "inputs": [], + "name": "IS_TEST", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "failed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/std-contracts/src/test/MudV2Test.t.sol b/packages/store/src/MudTest.sol similarity index 65% rename from packages/std-contracts/src/test/MudV2Test.t.sol rename to packages/store/src/MudTest.sol index f29a514e56..9ca7df7a3e 100644 --- a/packages/std-contracts/src/test/MudV2Test.t.sol +++ b/packages/store/src/MudTest.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import "forge-std/Test.sol"; -import { IStoreConsumer } from "@latticexyz/store/src/StoreConsumer.sol"; +import { Test } from "forge-std/Test.sol"; +import { IStoreConsumer } from "./StoreConsumer.sol"; -contract MudV2Test is Test, IStoreConsumer { +contract MudTest is Test, IStoreConsumer { address worldAddress; function setUp() public virtual { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 912aaaea56..a4b8268ae1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -880,9 +880,6 @@ importers: '@latticexyz/solecs': specifier: workspace:* version: link:../solecs - '@latticexyz/store': - specifier: workspace:* - version: link:../store '@solidstate/contracts': specifier: ^0.0.52 version: 0.0.52 From be3c3acc564968ea1be75425703f020a9ad7a624 Mon Sep 17 00:00:00 2001 From: dk1a Date: Wed, 21 Jun 2023 18:57:49 +0300 Subject: [PATCH 11/25] update templates --- templates/phaser/packages/contracts/package.json | 1 - templates/phaser/packages/contracts/test/CounterTest.t.sol | 4 ++-- templates/react/packages/contracts/package.json | 1 - templates/react/packages/contracts/test/CounterTest.t.sol | 4 ++-- templates/threejs/packages/contracts/package.json | 1 - templates/vanilla/packages/contracts/package.json | 1 - templates/vanilla/packages/contracts/test/CounterTest.t.sol | 4 ++-- 7 files changed, 6 insertions(+), 10 deletions(-) diff --git a/templates/phaser/packages/contracts/package.json b/templates/phaser/packages/contracts/package.json index f172c06e2e..ff2d36d0d1 100644 --- a/templates/phaser/packages/contracts/package.json +++ b/templates/phaser/packages/contracts/package.json @@ -22,7 +22,6 @@ "@ethersproject/providers": "^5.7.2", "@latticexyz/cli": "link:../../../../packages/cli", "@latticexyz/schema-type": "link:../../../../packages/schema-type", - "@latticexyz/std-contracts": "link:../../../../packages/std-contracts", "@latticexyz/store": "link:../../../../packages/store", "@latticexyz/world": "link:../../../../packages/world", "ethers": "^5.7.2" diff --git a/templates/phaser/packages/contracts/test/CounterTest.t.sol b/templates/phaser/packages/contracts/test/CounterTest.t.sol index ce4858a5c1..94c71dc8b4 100644 --- a/templates/phaser/packages/contracts/test/CounterTest.t.sol +++ b/templates/phaser/packages/contracts/test/CounterTest.t.sol @@ -2,13 +2,13 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { Counter, CounterTableId } from "../src/codegen/Tables.sol"; -contract CounterTest is MudV2Test { +contract CounterTest is MudTest { IWorld public world; function setUp() public override { diff --git a/templates/react/packages/contracts/package.json b/templates/react/packages/contracts/package.json index f172c06e2e..ff2d36d0d1 100644 --- a/templates/react/packages/contracts/package.json +++ b/templates/react/packages/contracts/package.json @@ -22,7 +22,6 @@ "@ethersproject/providers": "^5.7.2", "@latticexyz/cli": "link:../../../../packages/cli", "@latticexyz/schema-type": "link:../../../../packages/schema-type", - "@latticexyz/std-contracts": "link:../../../../packages/std-contracts", "@latticexyz/store": "link:../../../../packages/store", "@latticexyz/world": "link:../../../../packages/world", "ethers": "^5.7.2" diff --git a/templates/react/packages/contracts/test/CounterTest.t.sol b/templates/react/packages/contracts/test/CounterTest.t.sol index ce4858a5c1..94c71dc8b4 100644 --- a/templates/react/packages/contracts/test/CounterTest.t.sol +++ b/templates/react/packages/contracts/test/CounterTest.t.sol @@ -2,13 +2,13 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { Counter, CounterTableId } from "../src/codegen/Tables.sol"; -contract CounterTest is MudV2Test { +contract CounterTest is MudTest { IWorld public world; function setUp() public override { diff --git a/templates/threejs/packages/contracts/package.json b/templates/threejs/packages/contracts/package.json index f172c06e2e..ff2d36d0d1 100644 --- a/templates/threejs/packages/contracts/package.json +++ b/templates/threejs/packages/contracts/package.json @@ -22,7 +22,6 @@ "@ethersproject/providers": "^5.7.2", "@latticexyz/cli": "link:../../../../packages/cli", "@latticexyz/schema-type": "link:../../../../packages/schema-type", - "@latticexyz/std-contracts": "link:../../../../packages/std-contracts", "@latticexyz/store": "link:../../../../packages/store", "@latticexyz/world": "link:../../../../packages/world", "ethers": "^5.7.2" diff --git a/templates/vanilla/packages/contracts/package.json b/templates/vanilla/packages/contracts/package.json index f172c06e2e..ff2d36d0d1 100644 --- a/templates/vanilla/packages/contracts/package.json +++ b/templates/vanilla/packages/contracts/package.json @@ -22,7 +22,6 @@ "@ethersproject/providers": "^5.7.2", "@latticexyz/cli": "link:../../../../packages/cli", "@latticexyz/schema-type": "link:../../../../packages/schema-type", - "@latticexyz/std-contracts": "link:../../../../packages/std-contracts", "@latticexyz/store": "link:../../../../packages/store", "@latticexyz/world": "link:../../../../packages/world", "ethers": "^5.7.2" diff --git a/templates/vanilla/packages/contracts/test/CounterTest.t.sol b/templates/vanilla/packages/contracts/test/CounterTest.t.sol index ce4858a5c1..94c71dc8b4 100644 --- a/templates/vanilla/packages/contracts/test/CounterTest.t.sol +++ b/templates/vanilla/packages/contracts/test/CounterTest.t.sol @@ -2,13 +2,13 @@ pragma solidity >=0.8.0; import "forge-std/Test.sol"; -import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { Counter, CounterTableId } from "../src/codegen/Tables.sol"; -contract CounterTest is MudV2Test { +contract CounterTest is MudTest { IWorld public world; function setUp() public override { From 6e5be5611adfb51ff60228aaf6c4b919d572b6b9 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 27 Jun 2023 20:42:52 +0300 Subject: [PATCH 12/25] move comment about systems from StoreConsumer to WorldConsumer --- packages/store/src/StoreConsumer.sol | 1 - packages/world/src/WorldConsumer.sol | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/store/src/StoreConsumer.sol b/packages/store/src/StoreConsumer.sol index bb3a14adb8..51bd8470b6 100644 --- a/packages/store/src/StoreConsumer.sol +++ b/packages/store/src/StoreConsumer.sol @@ -7,7 +7,6 @@ import { IStoreConsumer } from "./IStore.sol"; * Default Store consumers consider their caller to be the Store, thus delegating access control to the Store. * The Store contract considers itself to be the Store (so StoreRead has a different storeAddress definition). * Tests/scripts may override this value for convenience. - * WARNING: World Systems rely on storeAddress being msg.sender for access control! */ contract StoreConsumer is IStoreConsumer { function storeAddress(address msgSender) public pure returns (address) { diff --git a/packages/world/src/WorldConsumer.sol b/packages/world/src/WorldConsumer.sol index cf93043017..d6c2a3dc0a 100644 --- a/packages/world/src/WorldConsumer.sol +++ b/packages/world/src/WorldConsumer.sol @@ -6,6 +6,7 @@ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; // Similar to https://eips.ethereum.org/EIPS/eip-2771, but any contract can be the trusted forwarder. // This should only be used for contracts without own storage, like Systems. +// Systems also rely on `StoreConsumer.storeAddress` being msg.sender (the non-forwarded one) for access control. abstract contract WorldConsumer is StoreConsumer { // Extract the trusted msg.sender value appended to the calldata function _msgSender() internal view returns (address sender) { From b752ca1ceefaaff0b092dfa5113d0aa85e053376 Mon Sep 17 00:00:00 2001 From: dk1a Date: Thu, 29 Jun 2023 16:26:33 +0300 Subject: [PATCH 13/25] use storeAddress in KeysWithValueHook for consistency --- .../src/modules/keyswithvalue/KeysWithValueHook.sol | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol index 649e13191c..3b8c39bed3 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol @@ -24,11 +24,15 @@ contract KeysWithValueHook is StoreHook { using ArrayLib for bytes32[]; using ResourceSelector for bytes32; + function _world() internal view returns (IBaseWorld) { + return IBaseWorld(storeAddress(msg.sender)); + } + function onSetRecord(bytes32 sourceTableId, bytes32[] memory key, bytes memory data) public { bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); // Get the previous value - bytes32 previousValue = keccak256(IBaseWorld(msg.sender).getRecord(sourceTableId, key)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key)); // Return if the value hasn't changed if (previousValue == keccak256(data)) return; @@ -42,21 +46,21 @@ contract KeysWithValueHook is StoreHook { function onBeforeSetField(bytes32 sourceTableId, bytes32[] memory key, uint8, bytes memory) public { // Remove the key from the list of keys with the previous value - bytes32 previousValue = keccak256(IBaseWorld(msg.sender).getRecord(sourceTableId, key)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); _removeKeyFromList(targetTableId, key[0], previousValue); } function onAfterSetField(bytes32 sourceTableId, bytes32[] memory key, uint8, bytes memory) public { // Add the key to the list of keys with the new value - bytes32 newValue = keccak256(IBaseWorld(msg.sender).getRecord(sourceTableId, key)); + bytes32 newValue = keccak256(_world().getRecord(sourceTableId, key)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); KeysWithValue.push(targetTableId, newValue, key[0]); } function onDeleteRecord(bytes32 sourceTableId, bytes32[] memory key) public { // Remove the key from the list of keys with the previous value - bytes32 previousValue = keccak256(IBaseWorld(msg.sender).getRecord(sourceTableId, key)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); _removeKeyFromList(targetTableId, key[0], previousValue); } From c304eb7792cdb0e2360233a67685433071a7fdaf Mon Sep 17 00:00:00 2001 From: dk1a Date: Fri, 14 Jul 2023 14:41:45 +0300 Subject: [PATCH 14/25] some gas optimizations --- packages/store/abi/IStore.sol/IStore.abi.json | 8 +- .../abi/IStore.sol/IStoreConsumer.abi.json | 8 +- .../store/abi/IStore.sol/IStoreData.abi.json | 8 +- .../store/abi/IStore.sol/IStoreHook.abi.json | 19 ---- .../store/abi/IStore.sol/IStoreRead.abi.json | 8 +- .../MirrorSubscriber.abi.json | 19 ---- .../store/abi/MudTest.sol/MudTest.abi.json | 8 +- .../abi/StoreHook.sol/StoreHook.abi.json | 19 ---- .../abi/StoreMock.sol/StoreMock.abi.json | 8 +- .../abi/StoreRead.sol/StoreRead.abi.json | 8 +- .../StoreReadWithStubs.abi.json | 8 +- packages/store/gas-report.json | 84 +++++++------- packages/store/src/IStore.sol | 4 +- packages/store/src/MudTest.sol | 4 +- packages/store/src/StoreConsumer.sol | 15 --- packages/store/src/StoreHook.sol | 3 +- packages/store/src/StoreRead.sol | 2 +- packages/store/src/StoreSwitch.sol | 7 +- packages/store/test/StoreSwitch.t.sol | 3 +- .../AccessManagementSystem.abi.json | 30 ----- .../abi/CoreModule.sol/CoreModule.abi.json | 30 ----- .../abi/CoreSystem.sol/CoreSystem.abi.json | 30 ----- .../EphemeralRecordSystem.abi.json | 30 ----- .../abi/IBaseWorld.sol/IBaseWorld.abi.json | 8 +- packages/world/abi/IStore.sol/IStore.abi.json | 8 +- .../abi/IStore.sol/IStoreConsumer.abi.json | 8 +- .../world/abi/IStore.sol/IStoreData.abi.json | 8 +- .../world/abi/IStore.sol/IStoreHook.abi.json | 19 ---- .../world/abi/IStore.sol/IStoreRead.abi.json | 8 +- .../KeysInTableHook.abi.json | 30 ----- .../KeysInTableModule.abi.json | 30 ----- .../KeysWithValueHook.abi.json | 30 ----- .../KeysWithValueModule.abi.json | 30 ----- .../ModuleInstallationSystem.abi.json | 30 ----- .../SnapSyncModule.abi.json | 30 ----- .../SnapSyncSystem.abi.json | 30 ----- .../abi/StoreHook.sol/StoreHook.abi.json | 19 ---- .../abi/StoreRead.sol/StoreRead.abi.json | 19 +--- .../StoreRegistrationSystem.abi.json | 30 ----- packages/world/abi/System.sol/System.abi.json | 22 +--- .../UniqueEntityModule.abi.json | 30 ----- .../UniqueEntitySystem.abi.json | 30 ----- packages/world/abi/World.sol/World.abi.json | 19 +--- .../WorldConsumer.sol/WorldConsumer.abi.json | 22 +--- .../WorldRegistrationSystem.abi.json | 30 ----- .../world/abi/src/IStore.sol/IStore.abi.json | 8 +- .../src/IStore.sol/IStoreConsumer.abi.json | 8 +- .../abi/src/IStore.sol/IStoreData.abi.json | 8 +- .../abi/src/IStore.sol/IStoreHook.abi.json | 19 ---- .../abi/src/IStore.sol/IStoreRead.abi.json | 8 +- packages/world/gas-report.json | 104 +++++++++--------- packages/world/src/WorldConsumer.sol | 3 +- .../keyswithvalue/KeysWithValueHook.sol | 3 +- packages/world/test/World.t.sol | 2 +- 54 files changed, 129 insertions(+), 887 deletions(-) delete mode 100644 packages/store/src/StoreConsumer.sol diff --git a/packages/store/abi/IStore.sol/IStore.abi.json b/packages/store/abi/IStore.sol/IStore.abi.json index 5767c6757d..bb0df2bf1b 100644 --- a/packages/store/abi/IStore.sol/IStore.abi.json +++ b/packages/store/abi/IStore.sol/IStore.abi.json @@ -600,13 +600,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreConsumer.abi.json b/packages/store/abi/IStore.sol/IStoreConsumer.abi.json index 24ce1a4cb2..97c1c97de1 100644 --- a/packages/store/abi/IStore.sol/IStoreConsumer.abi.json +++ b/packages/store/abi/IStore.sol/IStoreConsumer.abi.json @@ -1,12 +1,6 @@ [ { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreData.abi.json b/packages/store/abi/IStore.sol/IStoreData.abi.json index 80b613f33e..9bc7fb9335 100644 --- a/packages/store/abi/IStore.sol/IStoreData.abi.json +++ b/packages/store/abi/IStore.sol/IStoreData.abi.json @@ -398,13 +398,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreHook.abi.json b/packages/store/abi/IStore.sol/IStoreHook.abi.json index b1a5ec5fd9..f192f8efc5 100644 --- a/packages/store/abi/IStore.sol/IStoreHook.abi.json +++ b/packages/store/abi/IStore.sol/IStoreHook.abi.json @@ -95,24 +95,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreRead.abi.json b/packages/store/abi/IStore.sol/IStoreRead.abi.json index 171c382553..6c76ffeed7 100644 --- a/packages/store/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/store/abi/IStore.sol/IStoreRead.abi.json @@ -198,13 +198,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json index 53d8d5785b..056dbaceb6 100644 --- a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json +++ b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json @@ -180,24 +180,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/MudTest.sol/MudTest.abi.json b/packages/store/abi/MudTest.sol/MudTest.abi.json index 8bf6ff83e7..5eb1ac28cf 100644 --- a/packages/store/abi/MudTest.sol/MudTest.abi.json +++ b/packages/store/abi/MudTest.sol/MudTest.abi.json @@ -436,13 +436,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/StoreHook.sol/StoreHook.abi.json b/packages/store/abi/StoreHook.sol/StoreHook.abi.json index 086ec0e67d..f192f8efc5 100644 --- a/packages/store/abi/StoreHook.sol/StoreHook.abi.json +++ b/packages/store/abi/StoreHook.sol/StoreHook.abi.json @@ -95,24 +95,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json b/packages/store/abi/StoreMock.sol/StoreMock.abi.json index dcd5374951..6cd77b1b41 100644 --- a/packages/store/abi/StoreMock.sol/StoreMock.abi.json +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json @@ -648,13 +648,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json b/packages/store/abi/StoreRead.sol/StoreRead.abi.json index b6752912dc..df757624af 100644 --- a/packages/store/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json @@ -320,13 +320,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json index a718e994e6..411d047ca3 100644 --- a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json +++ b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json @@ -653,13 +653,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index f52ebd8745..8ed9495ad2 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -99,7 +99,7 @@ "file": "test/KeyEncoding.t.sol", "test": "testRegisterAndGetSchema", "name": "register KeyEncoding schema", - "gasUsed": 63575 + "gasUsed": 63346 }, { "file": "test/Mixed.t.sol", @@ -111,19 +111,19 @@ "file": "test/Mixed.t.sol", "test": "testRegisterAndGetSchema", "name": "register Mixed schema", - "gasUsed": 60516 + "gasUsed": 60354 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "set record in Mixed", - "gasUsed": 112767 + "gasUsed": 112443 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "get record from Mixed", - "gasUsed": 13430 + "gasUsed": 13268 }, { "file": "test/PackedCounter.t.sol", @@ -339,25 +339,25 @@ "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (cold, 1 slot, 1 uint32 item)", - "gasUsed": 29665 + "gasUsed": 29459 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (warm, 1 slot, 1 uint32 item)", - "gasUsed": 19721 + "gasUsed": 19515 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (cold, 2 slots, 10 uint32 items)", - "gasUsed": 31548 + "gasUsed": 31342 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (warm, 2 slots, 10 uint32 items)", - "gasUsed": 19604 + "gasUsed": 19398 }, { "file": "test/StoreCoreGas.t.sol", @@ -393,7 +393,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testDeleteData", "name": "delete record (complex data, 3 slots)", - "gasUsed": 11300 + "gasUsed": 11160 }, { "file": "test/StoreCoreGas.t.sol", @@ -411,61 +411,61 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "register subscriber", - "gasUsed": 66164 + "gasUsed": 65884 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 74911 + "gasUsed": 74223 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set static field on table with subscriber", - "gasUsed": 32891 + "gasUsed": 32211 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "delete record on table with subscriber", - "gasUsed": 25518 + "gasUsed": 24852 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "register subscriber", - "gasUsed": 66164 + "gasUsed": 65884 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 168348 + "gasUsed": 167660 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) field on table with subscriber", - "gasUsed": 36041 + "gasUsed": 35349 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "delete (dynamic) record on table with subscriber", - "gasUsed": 26990 + "gasUsed": 26324 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (1 slot, 1 uint32 item)", - "gasUsed": 17372 + "gasUsed": 17232 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (2 slots, 10 uint32 items)", - "gasUsed": 40089 + "gasUsed": 39949 }, { "file": "test/StoreCoreGas.t.sol", @@ -489,7 +489,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetDynamicData", "name": "set complex record with dynamic data (4 slots)", - "gasUsed": 108013 + "gasUsed": 107873 }, { "file": "test/StoreCoreGas.t.sol", @@ -531,7 +531,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (1 slot)", - "gasUsed": 38231 + "gasUsed": 38091 }, { "file": "test/StoreCoreGas.t.sol", @@ -543,7 +543,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (overlap 2 slot)", - "gasUsed": 35192 + "gasUsed": 35052 }, { "file": "test/StoreCoreGas.t.sol", @@ -555,7 +555,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, first dynamic field)", - "gasUsed": 57693 + "gasUsed": 57553 }, { "file": "test/StoreCoreGas.t.sol", @@ -567,7 +567,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, second dynamic field)", - "gasUsed": 35826 + "gasUsed": 35686 }, { "file": "test/StoreCoreGas.t.sol", @@ -579,7 +579,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "set static record (1 slot)", - "gasUsed": 37680 + "gasUsed": 37540 }, { "file": "test/StoreCoreGas.t.sol", @@ -591,7 +591,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticDataSpanningWords", "name": "set static record (2 slots)", - "gasUsed": 60247 + "gasUsed": 60107 }, { "file": "test/StoreCoreGas.t.sol", @@ -603,79 +603,79 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetMetadata", "name": "StoreCore: set table metadata", - "gasUsed": 252490 + "gasUsed": 252210 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "update in field (1 slot, 1 uint32 item)", - "gasUsed": 16919 + "gasUsed": 16779 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "push to field (2 slots, 6 uint64 items)", - "gasUsed": 18009 + "gasUsed": 17869 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 250924 + "gasUsed": 250600 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "get record from StoreMetadataTable", - "gasUsed": 12848 + "gasUsed": 12686 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsDelegatecall", "name": "check if delegatecall", - "gasUsed": 983 + "gasUsed": 804 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsNoDelegatecall", "name": "check if delegatecall", - "gasUsed": 979 + "gasUsed": 584 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "set field in Callbacks", - "gasUsed": 63902 + "gasUsed": 63578 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "get field from Callbacks (warm)", - "gasUsed": 6136 + "gasUsed": 5974 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "push field to Callbacks", - "gasUsed": 41593 + "gasUsed": 41269 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "set field in Hooks", - "gasUsed": 64059 + "gasUsed": 63735 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "get field from Hooks (warm)", - "gasUsed": 6285 + "gasUsed": 6123 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "push field to Hooks", - "gasUsed": 41583 + "gasUsed": 41259 }, { "file": "test/tightcoder/DecodeSlice.t.sol", @@ -735,18 +735,18 @@ "file": "test/Vector2.t.sol", "test": "testRegisterAndGetSchema", "name": "register Vector2 schema", - "gasUsed": 57786 + "gasUsed": 57557 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "set Vector2 record", - "gasUsed": 39439 + "gasUsed": 38981 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "get Vector2 record", - "gasUsed": 5354 + "gasUsed": 5125 } ] diff --git a/packages/store/src/IStore.sol b/packages/store/src/IStore.sol index 677f64a316..afc83a071b 100644 --- a/packages/store/src/IStore.sol +++ b/packages/store/src/IStore.sol @@ -11,7 +11,7 @@ interface IStoreConsumer { * Returns the Store address used by this consumer (like Hooks, Store itself, World Systems, or tests/scripts) * for StoreSwitch to determine how to interact with the Store. */ - function storeAddress(address msgSender) external view returns (address storeAddress); + function storeAddress() external view returns (address storeAddress); } interface IStoreRead is IStoreConsumer { @@ -109,7 +109,7 @@ interface IStoreRegistration { interface IStore is IStoreData, IStoreRegistration, IStoreEphemeral, IStoreErrors {} -interface IStoreHook is IStoreConsumer { +interface IStoreHook { function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) external; // Split onSetField into pre and post to simplify the implementation of hooks diff --git a/packages/store/src/MudTest.sol b/packages/store/src/MudTest.sol index 9ca7df7a3e..4bbedc1db2 100644 --- a/packages/store/src/MudTest.sol +++ b/packages/store/src/MudTest.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.0; import { Test } from "forge-std/Test.sol"; -import { IStoreConsumer } from "./StoreConsumer.sol"; +import { IStoreConsumer } from "./IStore.sol"; contract MudTest is Test, IStoreConsumer { address worldAddress; @@ -11,7 +11,7 @@ contract MudTest is Test, IStoreConsumer { worldAddress = vm.parseAddress(vm.readFile(".mudtest")); } - function storeAddress(address) public view returns (address) { + function storeAddress() public view returns (address) { return worldAddress; } } diff --git a/packages/store/src/StoreConsumer.sol b/packages/store/src/StoreConsumer.sol deleted file mode 100644 index 51bd8470b6..0000000000 --- a/packages/store/src/StoreConsumer.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -import { IStoreConsumer } from "./IStore.sol"; - -/** - * Default Store consumers consider their caller to be the Store, thus delegating access control to the Store. - * The Store contract considers itself to be the Store (so StoreRead has a different storeAddress definition). - * Tests/scripts may override this value for convenience. - */ -contract StoreConsumer is IStoreConsumer { - function storeAddress(address msgSender) public pure returns (address) { - return msgSender; - } -} diff --git a/packages/store/src/StoreHook.sol b/packages/store/src/StoreHook.sol index 8157c937f7..fa8dbd13f5 100644 --- a/packages/store/src/StoreHook.sol +++ b/packages/store/src/StoreHook.sol @@ -2,12 +2,11 @@ pragma solidity >=0.8.0; import { IStoreHook } from "./IStore.sol"; -import { StoreConsumer } from "./StoreConsumer.sol"; /** * When making a hook, prefer inheriting StoreHook over IStoreHook for convenience * (hooks should use the default StoreConsumer). */ -abstract contract StoreHook is IStoreHook, StoreConsumer { +abstract contract StoreHook is IStoreHook { } diff --git a/packages/store/src/StoreRead.sol b/packages/store/src/StoreRead.sol index cb954841b3..4c3f603b2f 100644 --- a/packages/store/src/StoreRead.sol +++ b/packages/store/src/StoreRead.sol @@ -61,7 +61,7 @@ contract StoreRead is IStoreRead { return StoreCore.getFieldSlice(tableId, key, schemaIndex, schema, start, end); } - function storeAddress(address) public view returns (address) { + function storeAddress() public view returns (address) { return address(this); } } diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index a507251c56..fefc86fd8c 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -21,11 +21,10 @@ library StoreSwitch { // If the call is from within a constructor, use StoreCore to write to own storage if (codeSize == 0) return address(this); - try IStoreConsumer(address(this)).storeAddress(msg.sender) returns (address _storeAddress) { + try IStoreConsumer(address(this)).storeAddress() returns (address _storeAddress) { return _storeAddress; - } catch (bytes memory lowLevelData) { - // catch and rename the error, otherwise it's usually "EvmError: Revert" which is very unhelpful - revert StoreSwitch_MissingOrInvalidStoreAddressFunction(lowLevelData); + } catch { + return msg.sender; } } diff --git a/packages/store/test/StoreSwitch.t.sol b/packages/store/test/StoreSwitch.t.sol index 3d771d33a6..87186a0e3d 100644 --- a/packages/store/test/StoreSwitch.t.sol +++ b/packages/store/test/StoreSwitch.t.sol @@ -4,7 +4,6 @@ pragma solidity >=0.8.0; import { Test } from "forge-std/Test.sol"; import { GasReporter } from "@latticexyz/gas-report/src/GasReporter.sol"; import { StoreCore } from "../src/StoreCore.sol"; -import { StoreConsumer } from "../src/StoreConsumer.sol"; import { StoreReadWithStubs } from "../src/StoreReadWithStubs.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; @@ -26,7 +25,7 @@ contract StoreSwitchTestStore is StoreReadWithStubs { } // Mock consumer to wrap StoreSwitch.storeAddress() comparison -contract MockStoreConsumer is StoreConsumer, GasReporter { +contract MockStoreConsumer is GasReporter { function isDelegateCall() public returns (bool isDelegate) { startGasReport("check if delegatecall"); isDelegate = StoreSwitch.storeAddress() == address(this); diff --git a/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json b/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json index 01f2c560ac..7801e6816e 100644 --- a/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json +++ b/packages/world/abi/AccessManagementSystem.sol/AccessManagementSystem.abi.json @@ -68,17 +68,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -124,24 +113,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/CoreModule.sol/CoreModule.abi.json b/packages/world/abi/CoreModule.sol/CoreModule.abi.json index 2d69e9380f..1bb5e1625b 100644 --- a/packages/world/abi/CoreModule.sol/CoreModule.abi.json +++ b/packages/world/abi/CoreModule.sol/CoreModule.abi.json @@ -111,17 +111,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getName", @@ -147,24 +136,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json index 0d17d7cade..8c58fee71b 100644 --- a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json +++ b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json @@ -187,17 +187,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -658,24 +647,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json index 77adf33608..3e51350f67 100644 --- a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json +++ b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json @@ -68,17 +68,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "anonymous": false, "inputs": [ @@ -154,24 +143,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json index 8fc5708187..797fcdcd72 100644 --- a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json +++ b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json @@ -1234,13 +1234,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/IStore.sol/IStore.abi.json b/packages/world/abi/IStore.sol/IStore.abi.json index 5767c6757d..bb0df2bf1b 100644 --- a/packages/world/abi/IStore.sol/IStore.abi.json +++ b/packages/world/abi/IStore.sol/IStore.abi.json @@ -600,13 +600,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/IStore.sol/IStoreConsumer.abi.json index 24ce1a4cb2..97c1c97de1 100644 --- a/packages/world/abi/IStore.sol/IStoreConsumer.abi.json +++ b/packages/world/abi/IStore.sol/IStoreConsumer.abi.json @@ -1,12 +1,6 @@ [ { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreData.abi.json b/packages/world/abi/IStore.sol/IStoreData.abi.json index 80b613f33e..9bc7fb9335 100644 --- a/packages/world/abi/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/IStore.sol/IStoreData.abi.json @@ -398,13 +398,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreHook.abi.json b/packages/world/abi/IStore.sol/IStoreHook.abi.json index b1a5ec5fd9..f192f8efc5 100644 --- a/packages/world/abi/IStore.sol/IStoreHook.abi.json +++ b/packages/world/abi/IStore.sol/IStoreHook.abi.json @@ -95,24 +95,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreRead.abi.json b/packages/world/abi/IStore.sol/IStoreRead.abi.json index 171c382553..6c76ffeed7 100644 --- a/packages/world/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/IStore.sol/IStoreRead.abi.json @@ -198,13 +198,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json index 83fc0e84ee..aff14f41e8 100644 --- a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json +++ b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json @@ -89,17 +89,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -196,24 +185,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json b/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json index b1d923eede..b281783ba3 100644 --- a/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json +++ b/packages/world/abi/KeysInTableModule.sol/KeysInTableModule.abi.json @@ -42,17 +42,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getName", @@ -78,24 +67,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json index 0b31b76570..d26dcd0e71 100644 --- a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json +++ b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json @@ -57,17 +57,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -164,24 +153,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json b/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json index 2986b8f883..d616cf972b 100644 --- a/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json +++ b/packages/world/abi/KeysWithValueModule.sol/KeysWithValueModule.abi.json @@ -68,17 +68,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getName", @@ -104,24 +93,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json b/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json index 5d64f1908c..ac5d10ea5d 100644 --- a/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json +++ b/packages/world/abi/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json @@ -52,17 +52,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -80,24 +69,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json b/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json index 41bce1785c..32a46a1787 100644 --- a/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json +++ b/packages/world/abi/SnapSyncModule.sol/SnapSyncModule.abi.json @@ -10,17 +10,6 @@ "name": "RequiredModuleNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getName", @@ -46,24 +35,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json b/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json index bf173d53b6..fe0862a126 100644 --- a/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json +++ b/packages/world/abi/SnapSyncSystem.sol/SnapSyncSystem.abi.json @@ -36,17 +36,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -111,24 +100,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/StoreHook.sol/StoreHook.abi.json b/packages/world/abi/StoreHook.sol/StoreHook.abi.json index 086ec0e67d..f192f8efc5 100644 --- a/packages/world/abi/StoreHook.sol/StoreHook.abi.json +++ b/packages/world/abi/StoreHook.sol/StoreHook.abi.json @@ -95,24 +95,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/StoreRead.sol/StoreRead.abi.json b/packages/world/abi/StoreRead.sol/StoreRead.abi.json index b6752912dc..aeb543231c 100644 --- a/packages/world/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/world/abi/StoreRead.sol/StoreRead.abi.json @@ -110,17 +110,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -320,13 +309,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json b/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json index 3507844036..7815ac594a 100644 --- a/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json +++ b/packages/world/abi/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json @@ -15,17 +15,6 @@ "name": "SchemaLib_StaticTypeAfterDynamicType", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -89,24 +78,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/System.sol/System.abi.json b/packages/world/abi/System.sol/System.abi.json index 927b8ed2da..0637a088a0 100644 --- a/packages/world/abi/System.sol/System.abi.json +++ b/packages/world/abi/System.sol/System.abi.json @@ -1,21 +1 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json b/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json index beba2c0feb..646de1964b 100644 --- a/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json +++ b/packages/world/abi/UniqueEntityModule.sol/UniqueEntityModule.abi.json @@ -26,17 +26,6 @@ "name": "SchemaLib_StaticTypeAfterDynamicType", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getName", @@ -62,24 +51,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json b/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json index 0e857a53be..51b519610a 100644 --- a/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json +++ b/packages/world/abi/UniqueEntitySystem.sol/UniqueEntitySystem.abi.json @@ -52,17 +52,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [], "name": "getUniqueEntity", @@ -75,24 +64,5 @@ ], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/World.sol/World.abi.json b/packages/world/abi/World.sol/World.abi.json index 14029575f7..4f2d3b8189 100644 --- a/packages/world/abi/World.sol/World.abi.json +++ b/packages/world/abi/World.sol/World.abi.json @@ -208,17 +208,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -836,13 +825,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json b/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json index 927b8ed2da..0637a088a0 100644 --- a/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json +++ b/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json @@ -1,21 +1 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json b/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json index 4c4dc23b11..c0f14dc135 100644 --- a/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json +++ b/packages/world/abi/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json @@ -187,17 +187,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { @@ -454,24 +443,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStore.abi.json b/packages/world/abi/src/IStore.sol/IStore.abi.json index 5767c6757d..bb0df2bf1b 100644 --- a/packages/world/abi/src/IStore.sol/IStore.abi.json +++ b/packages/world/abi/src/IStore.sol/IStore.abi.json @@ -600,13 +600,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json index 24ce1a4cb2..97c1c97de1 100644 --- a/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json @@ -1,12 +1,6 @@ [ { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreData.abi.json b/packages/world/abi/src/IStore.sol/IStoreData.abi.json index 80b613f33e..9bc7fb9335 100644 --- a/packages/world/abi/src/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreData.abi.json @@ -398,13 +398,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreHook.abi.json b/packages/world/abi/src/IStore.sol/IStoreHook.abi.json index b1a5ec5fd9..f192f8efc5 100644 --- a/packages/world/abi/src/IStore.sol/IStoreHook.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreHook.abi.json @@ -95,24 +95,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json index 171c382553..6c76ffeed7 100644 --- a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json @@ -198,13 +198,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], + "inputs": [], "name": "storeAddress", "outputs": [ { diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 80bc6017ff..cb87ff28f1 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,73 +3,73 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1294299 + "gasUsed": 1286887 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1294299 + "gasUsed": 1286887 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 196886 + "gasUsed": 194081 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1294299 + "gasUsed": 1286887 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1294299 + "gasUsed": 1286887 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 30911 + "gasUsed": 30177 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 302186 + "gasUsed": 292725 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1294299 + "gasUsed": 1286887 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 29526 + "gasUsed": 28792 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 158579 + "gasUsed": 153528 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 634909 + "gasUsed": 629339 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "Get list of keys with a given value", - "gasUsed": 7716 + "gasUsed": 7694 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,240 +81,240 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 634909 + "gasUsed": 629339 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 168950 + "gasUsed": 167113 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 634909 + "gasUsed": 629339 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 138605 + "gasUsed": 136767 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 56423 + "gasUsed": 55442 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 634909 + "gasUsed": 629339 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 177040 + "gasUsed": 175788 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 141399 + "gasUsed": 140146 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueNotQuery", "name": "CombinedHasHasValueNotQuery", - "gasUsed": 163160 + "gasUsed": 163100 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueQuery", "name": "CombinedHasHasValueQuery", - "gasUsed": 77029 + "gasUsed": 76965 }, { "file": "test/query.t.sol", "test": "testCombinedHasNotQuery", "name": "CombinedHasNotQuery", - "gasUsed": 222474 + "gasUsed": 222462 }, { "file": "test/query.t.sol", "test": "testCombinedHasQuery", "name": "CombinedHasQuery", - "gasUsed": 139829 + "gasUsed": 139903 }, { "file": "test/query.t.sol", "test": "testCombinedHasValueNotQuery", "name": "CombinedHasValueNotQuery", - "gasUsed": 139055 + "gasUsed": 139039 }, { "file": "test/query.t.sol", "test": "testCombinedHasValueQuery", "name": "CombinedHasValueQuery", - "gasUsed": 19621 + "gasUsed": 19577 }, { "file": "test/query.t.sol", "test": "testHasQuery", "name": "HasQuery", - "gasUsed": 31559 + "gasUsed": 31583 }, { "file": "test/query.t.sol", "test": "testHasQuery1000Keys", "name": "HasQuery with 1000 keys", - "gasUsed": 10806607 + "gasUsed": 10784675 }, { "file": "test/query.t.sol", "test": "testHasQuery100Keys", "name": "HasQuery with 100 keys", - "gasUsed": 1009010 + "gasUsed": 1006878 }, { "file": "test/query.t.sol", "test": "testHasValueQuery", "name": "HasValueQuery", - "gasUsed": 9522 + "gasUsed": 9500 }, { "file": "test/query.t.sol", "test": "testNotValueQuery", "name": "NotValueQuery", - "gasUsed": 70209 + "gasUsed": 70145 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 44559 + "gasUsed": 42959 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 63309 + "gasUsed": 60961 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 835507 + "gasUsed": 827225 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 74869 + "gasUsed": 73150 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 804795 + "gasUsed": 797542 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 74869 + "gasUsed": 73150 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 16765 + "gasUsed": 16417 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 97123 + "gasUsed": 96797 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 88464 + "gasUsed": 87160 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 79670 + "gasUsed": 78343 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 109058 + "gasUsed": 107754 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 164149 + "gasUsed": 162519 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 95573 + "gasUsed": 94246 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 265672 + "gasUsed": 263390 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 45354 + "gasUsed": 45006 }, { "file": "test/World.t.sol", "test": "testSetMetadata", "name": "Set metadata", - "gasUsed": 284676 + "gasUsed": 283698 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 43209 + "gasUsed": 42883 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 38611 + "gasUsed": 38330 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 23401 + "gasUsed": 23120 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 40990 + "gasUsed": 40642 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 26192 + "gasUsed": 25844 } ] diff --git a/packages/world/src/WorldConsumer.sol b/packages/world/src/WorldConsumer.sol index d6c2a3dc0a..4bf7f39f90 100644 --- a/packages/world/src/WorldConsumer.sol +++ b/packages/world/src/WorldConsumer.sol @@ -1,13 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { StoreConsumer } from "@latticexyz/store/src/StoreConsumer.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; // Similar to https://eips.ethereum.org/EIPS/eip-2771, but any contract can be the trusted forwarder. // This should only be used for contracts without own storage, like Systems. // Systems also rely on `StoreConsumer.storeAddress` being msg.sender (the non-forwarded one) for access control. -abstract contract WorldConsumer is StoreConsumer { +abstract contract WorldConsumer { // Extract the trusted msg.sender value appended to the calldata function _msgSender() internal view returns (address sender) { assembly { diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol index 85952826ea..0e0bce21d0 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol @@ -3,6 +3,7 @@ pragma solidity >=0.8.0; import { StoreHook } from "@latticexyz/store/src/StoreHook.sol"; import { Bytes } from "@latticexyz/store/src/Bytes.sol"; +import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { ResourceSelector } from "../../ResourceSelector.sol"; @@ -25,7 +26,7 @@ contract KeysWithValueHook is StoreHook { using ResourceSelector for bytes32; function _world() internal view returns (IBaseWorld) { - return IBaseWorld(storeAddress(msg.sender)); + return IBaseWorld(StoreSwitch.storeAddress()); } function onSetRecord(bytes32 sourceTableId, bytes32[] memory key, bytes memory data) public { diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 815c2b13f0..9e131fb02d 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -192,7 +192,7 @@ contract WorldTest is Test, GasReporter { } function testStoreAddress() public { - assertEq(world.storeAddress(msg.sender), address(world)); + assertEq(world.storeAddress(), address(world)); } function testRegisterNamespace() public { From 9db1e347cdcedcd519369d80ef13b8f4947b59db Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 11:48:06 +0300 Subject: [PATCH 15/25] more optimizations --- .../MirrorSubscriber.abi.json | 11 --- .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ----- .../abi/StoreMock.sol/StoreMock.abi.json | 11 --- .../abi/StoreRead.sol/StoreRead.abi.json | 11 --- .../StoreReadWithStubs.abi.json | 11 --- packages/store/gas-report.json | 90 +++++++++---------- packages/store/src/StoreSwitch.sol | 19 ++-- .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ----- .../StoreConsumer.sol/StoreConsumer.abi.json | 21 ----- packages/world/gas-report.json | 80 ++++++++--------- 10 files changed, 99 insertions(+), 197 deletions(-) delete mode 100644 packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json delete mode 100644 packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json delete mode 100644 packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json diff --git a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json index 056dbaceb6..0017c899a7 100644 --- a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json +++ b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json @@ -73,17 +73,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { diff --git a/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json b/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json deleted file mode 100644 index 927b8ed2da..0000000000 --- a/packages/store/abi/StoreConsumer.sol/StoreConsumer.abi.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json b/packages/store/abi/StoreMock.sol/StoreMock.abi.json index 6cd77b1b41..ab8aedf4c8 100644 --- a/packages/store/abi/StoreMock.sol/StoreMock.abi.json +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json @@ -126,17 +126,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "anonymous": false, "inputs": [ diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json b/packages/store/abi/StoreRead.sol/StoreRead.abi.json index df757624af..aeb543231c 100644 --- a/packages/store/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json @@ -110,17 +110,6 @@ "name": "StoreCore_TableNotFound", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "inputs": [ { diff --git a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json index 411d047ca3..06b71d5c6c 100644 --- a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json +++ b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json @@ -131,17 +131,6 @@ "name": "StoreReadWithStubs_NotImplemented", "type": "error" }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - }, { "anonymous": false, "inputs": [ diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index 8ed9495ad2..398776582c 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -99,7 +99,7 @@ "file": "test/KeyEncoding.t.sol", "test": "testRegisterAndGetSchema", "name": "register KeyEncoding schema", - "gasUsed": 63346 + "gasUsed": 63104 }, { "file": "test/Mixed.t.sol", @@ -111,19 +111,19 @@ "file": "test/Mixed.t.sol", "test": "testRegisterAndGetSchema", "name": "register Mixed schema", - "gasUsed": 60354 + "gasUsed": 60112 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "set record in Mixed", - "gasUsed": 112443 + "gasUsed": 111958 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "get record from Mixed", - "gasUsed": 13268 + "gasUsed": 13025 }, { "file": "test/PackedCounter.t.sol", @@ -339,25 +339,25 @@ "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (cold, 1 slot, 1 uint32 item)", - "gasUsed": 29459 + "gasUsed": 29217 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (warm, 1 slot, 1 uint32 item)", - "gasUsed": 19515 + "gasUsed": 19272 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (cold, 2 slots, 10 uint32 items)", - "gasUsed": 31342 + "gasUsed": 31100 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (warm, 2 slots, 10 uint32 items)", - "gasUsed": 19398 + "gasUsed": 19155 }, { "file": "test/StoreCoreGas.t.sol", @@ -393,7 +393,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testDeleteData", "name": "delete record (complex data, 3 slots)", - "gasUsed": 11160 + "gasUsed": 10917 }, { "file": "test/StoreCoreGas.t.sol", @@ -411,61 +411,61 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "register subscriber", - "gasUsed": 65884 + "gasUsed": 65406 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 74223 + "gasUsed": 73674 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set static field on table with subscriber", - "gasUsed": 32211 + "gasUsed": 31633 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "delete record on table with subscriber", - "gasUsed": 24852 + "gasUsed": 24298 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "register subscriber", - "gasUsed": 65884 + "gasUsed": 65406 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 167660 + "gasUsed": 167111 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) field on table with subscriber", - "gasUsed": 35349 + "gasUsed": 34783 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "delete (dynamic) record on table with subscriber", - "gasUsed": 26324 + "gasUsed": 25770 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (1 slot, 1 uint32 item)", - "gasUsed": 17232 + "gasUsed": 16988 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (2 slots, 10 uint32 items)", - "gasUsed": 39949 + "gasUsed": 39704 }, { "file": "test/StoreCoreGas.t.sol", @@ -489,7 +489,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetDynamicData", "name": "set complex record with dynamic data (4 slots)", - "gasUsed": 107873 + "gasUsed": 107630 }, { "file": "test/StoreCoreGas.t.sol", @@ -531,19 +531,19 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (1 slot)", - "gasUsed": 38091 + "gasUsed": 37848 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "get static field (1 slot)", - "gasUsed": 2916 + "gasUsed": 2915 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (overlap 2 slot)", - "gasUsed": 35052 + "gasUsed": 34810 }, { "file": "test/StoreCoreGas.t.sol", @@ -555,7 +555,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, first dynamic field)", - "gasUsed": 57553 + "gasUsed": 57309 }, { "file": "test/StoreCoreGas.t.sol", @@ -567,31 +567,31 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, second dynamic field)", - "gasUsed": 35686 + "gasUsed": 35441 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "get dynamic field (1 slot, second dynamic field)", - "gasUsed": 3827 + "gasUsed": 3826 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "set static record (1 slot)", - "gasUsed": 37540 + "gasUsed": 37297 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "get static record (1 slot)", - "gasUsed": 1321 + "gasUsed": 1320 }, { "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticDataSpanningWords", "name": "set static record (2 slots)", - "gasUsed": 60107 + "gasUsed": 59865 }, { "file": "test/StoreCoreGas.t.sol", @@ -603,79 +603,79 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetMetadata", "name": "StoreCore: set table metadata", - "gasUsed": 252210 + "gasUsed": 251724 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "update in field (1 slot, 1 uint32 item)", - "gasUsed": 16779 + "gasUsed": 16534 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "push to field (2 slots, 6 uint64 items)", - "gasUsed": 17869 + "gasUsed": 17625 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 250600 + "gasUsed": 250115 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "get record from StoreMetadataTable", - "gasUsed": 12686 + "gasUsed": 12443 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsDelegatecall", "name": "check if delegatecall", - "gasUsed": 804 + "gasUsed": 618 }, { "file": "test/StoreSwitch.t.sol", "test": "testIsNoDelegatecall", "name": "check if delegatecall", - "gasUsed": 584 + "gasUsed": 552 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "set field in Callbacks", - "gasUsed": 63578 + "gasUsed": 63093 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "get field from Callbacks (warm)", - "gasUsed": 5974 + "gasUsed": 5730 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "push field to Callbacks", - "gasUsed": 41269 + "gasUsed": 40781 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "set field in Hooks", - "gasUsed": 63735 + "gasUsed": 63250 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "get field from Hooks (warm)", - "gasUsed": 6123 + "gasUsed": 5880 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "push field to Hooks", - "gasUsed": 41259 + "gasUsed": 40772 }, { "file": "test/tightcoder/DecodeSlice.t.sol", @@ -735,18 +735,18 @@ "file": "test/Vector2.t.sol", "test": "testRegisterAndGetSchema", "name": "register Vector2 schema", - "gasUsed": 57557 + "gasUsed": 57315 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "set Vector2 record", - "gasUsed": 38981 + "gasUsed": 38496 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "get Vector2 record", - "gasUsed": 5125 + "gasUsed": 4882 } ] diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index fefc86fd8c..c50addf4d1 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -21,11 +21,20 @@ library StoreSwitch { // If the call is from within a constructor, use StoreCore to write to own storage if (codeSize == 0) return address(this); - try IStoreConsumer(address(this)).storeAddress() returns (address _storeAddress) { - return _storeAddress; - } catch { - return msg.sender; - } + bytes4 storeAddressSelector = IStoreConsumer.storeAddress.selector; + address result; + assembly { + mstore(0x00, storeAddressSelector) + let success := staticcall(gas(), address(), 0x00, 4, 0x00, 0x20) + switch success + case 0 { + result := caller() + } + case 1 { + result := mload(0x00) + } + } + return result; } function registerStoreHook(bytes32 table, IStoreHook hook) internal { diff --git a/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json b/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json deleted file mode 100644 index 927b8ed2da..0000000000 --- a/packages/world/abi/StoreConsumer.sol/StoreConsumer.abi.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json b/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json deleted file mode 100644 index 927b8ed2da..0000000000 --- a/packages/world/abi/src/StoreConsumer.sol/StoreConsumer.abi.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index cb87ff28f1..9b4b5c9d29 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,67 +3,67 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1286887 + "gasUsed": 1276057 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1286887 + "gasUsed": 1276057 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 194081 + "gasUsed": 191964 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1286887 + "gasUsed": 1276057 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1286887 + "gasUsed": 1276057 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 30177 + "gasUsed": 29649 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 292725 + "gasUsed": 285850 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1286887 + "gasUsed": 1276057 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 28792 + "gasUsed": 28263 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 153528 + "gasUsed": 149826 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 629339 + "gasUsed": 621393 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,49 +81,49 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 629339 + "gasUsed": 621393 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 167113 + "gasUsed": 164997 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 629339 + "gasUsed": 621393 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 136767 + "gasUsed": 134651 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 55442 + "gasUsed": 54099 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 629339 + "gasUsed": 621393 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 175788 + "gasUsed": 173629 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 140146 + "gasUsed": 137987 }, { "file": "test/query.t.sol", @@ -195,126 +195,126 @@ "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 42959 + "gasUsed": 42136 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 60961 + "gasUsed": 60074 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 827225 + "gasUsed": 815540 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 73150 + "gasUsed": 71874 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 797542 + "gasUsed": 786883 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 73150 + "gasUsed": 71874 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 16417 + "gasUsed": 15932 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 96797 + "gasUsed": 96313 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 87160 + "gasUsed": 85220 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 78343 + "gasUsed": 76404 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 107754 + "gasUsed": 105815 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 162519 + "gasUsed": 160093 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 94246 + "gasUsed": 92307 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 263390 + "gasUsed": 259987 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 45006 + "gasUsed": 44521 }, { "file": "test/World.t.sol", "test": "testSetMetadata", "name": "Set metadata", - "gasUsed": 283698 + "gasUsed": 282242 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 42883 + "gasUsed": 42398 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 38330 + "gasUsed": 37845 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 23120 + "gasUsed": 22635 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 40642 + "gasUsed": 40157 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 25844 + "gasUsed": 25359 } ] From c59d0ece4cbdca893cb27222be5899ebc38a1523 Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 16:25:29 +0300 Subject: [PATCH 16/25] refactor StoreSwitch to use storage for storeAddress, exclude MudTest from abi --- packages/cli/src/utils/deploy.ts | 24 +- .../store/abi/Base.sol/ScriptBase.abi.json | 1 - packages/store/abi/Base.sol/TestBase.abi.json | 1 - .../abi/IMulticall3.sol/IMulticall3.abi.json | 440 --- packages/store/abi/IStore.sol/IStore.abi.json | 13 - .../abi/IStore.sol/IStoreConsumer.abi.json | 15 - .../store/abi/IStore.sol/IStoreData.abi.json | 13 - .../store/abi/IStore.sol/IStoreRead.abi.json | 13 - .../store/abi/MudTest.sol/MudTest.abi.json | 540 --- .../StdAssertions.sol/StdAssertions.abi.json | 392 -- .../abi/StdChains.sol/StdChains.abi.json | 1 - .../abi/StdCheats.sol/StdCheats.abi.json | 1 - .../abi/StdCheats.sol/StdCheatsSafe.abi.json | 1 - .../store/abi/StdError.sol/stdError.abi.json | 119 - .../StdInvariant.sol/StdInvariant.abi.json | 130 - .../store/abi/StdJson.sol/stdJson.abi.json | 1 - .../store/abi/StdMath.sol/stdMath.abi.json | 1 - .../abi/StdStorage.sol/stdStorage.abi.json | 1 - .../StdStorage.sol/stdStorageSafe.abi.json | 52 - .../store/abi/StdUtils.sol/StdUtils.abi.json | 1 - .../abi/StoreHook.sol/StoreHook.abi.json | 99 - .../abi/StoreSwitch.sol/StoreSwitch.abi.json | 14 +- packages/store/abi/Test.sol/Test.abi.json | 520 --- packages/store/abi/Vm.sol/Vm.abi.json | 3247 ----------------- packages/store/abi/Vm.sol/VmSafe.abi.json | 2420 ------------ .../store/abi/console.sol/console.abi.json | 1 - .../store/abi/console2.sol/console2.abi.json | 1 - packages/store/abi/test.sol/DSTest.abi.json | 296 -- packages/store/gas-report.json | 92 +- packages/store/package.json | 2 +- packages/store/src/IStore.sol | 12 +- packages/store/src/MudTest.sol | 5 +- packages/store/src/StoreCore.sol | 5 + packages/store/src/StoreHook.sol | 12 - packages/store/src/StoreSwitch.sol | 86 +- packages/store/test/MirrorSubscriber.sol | 5 +- packages/store/test/StoreSwitch.t.sol | 38 +- .../abi/IBaseWorld.sol/IBaseWorld.abi.json | 13 - packages/world/abi/IStore.sol/IStore.abi.json | 13 - .../abi/IStore.sol/IStoreConsumer.abi.json | 15 - .../world/abi/IStore.sol/IStoreData.abi.json | 13 - .../world/abi/IStore.sol/IStoreRead.abi.json | 13 - .../abi/StoreHook.sol/StoreHook.abi.json | 99 - .../abi/StoreSwitch.sol/StoreSwitch.abi.json | 14 +- .../WorldConsumer.sol/WorldConsumer.abi.json | 1 - .../WorldContext.sol/WorldContext.abi.json} | 0 .../world/abi/src/IStore.sol/IStore.abi.json | 13 - .../src/IStore.sol/IStoreConsumer.abi.json | 15 - .../abi/src/IStore.sol/IStoreData.abi.json | 13 - .../abi/src/IStore.sol/IStoreRead.abi.json | 13 - .../src/StoreSwitch.sol/StoreSwitch.abi.json | 14 +- packages/world/gas-report.json | 80 +- packages/world/src/System.sol | 6 +- packages/world/src/Utils.sol | 2 +- .../{WorldConsumer.sol => WorldContext.sol} | 5 +- .../world/src/modules/core/CoreModule.sol | 4 +- .../modules/keysintable/KeysInTableHook.sol | 4 +- .../modules/keysintable/KeysInTableModule.sol | 4 +- .../keyswithvalue/KeysWithValueHook.sol | 6 +- .../keyswithvalue/KeysWithValueModule.sol | 4 +- .../src/modules/snapsync/SnapSyncModule.sol | 4 +- .../uniqueentity/UniqueEntityModule.sol | 4 +- .../modules/uniqueentity/getUniqueEntity.sol | 2 +- packages/world/test/World.t.sol | 23 +- 64 files changed, 217 insertions(+), 8795 deletions(-) delete mode 100644 packages/store/abi/Base.sol/ScriptBase.abi.json delete mode 100644 packages/store/abi/Base.sol/TestBase.abi.json delete mode 100644 packages/store/abi/IMulticall3.sol/IMulticall3.abi.json delete mode 100644 packages/store/abi/IStore.sol/IStoreConsumer.abi.json delete mode 100644 packages/store/abi/MudTest.sol/MudTest.abi.json delete mode 100644 packages/store/abi/StdAssertions.sol/StdAssertions.abi.json delete mode 100644 packages/store/abi/StdChains.sol/StdChains.abi.json delete mode 100644 packages/store/abi/StdCheats.sol/StdCheats.abi.json delete mode 100644 packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json delete mode 100644 packages/store/abi/StdError.sol/stdError.abi.json delete mode 100644 packages/store/abi/StdInvariant.sol/StdInvariant.abi.json delete mode 100644 packages/store/abi/StdJson.sol/stdJson.abi.json delete mode 100644 packages/store/abi/StdMath.sol/stdMath.abi.json delete mode 100644 packages/store/abi/StdStorage.sol/stdStorage.abi.json delete mode 100644 packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json delete mode 100644 packages/store/abi/StdUtils.sol/StdUtils.abi.json delete mode 100644 packages/store/abi/StoreHook.sol/StoreHook.abi.json delete mode 100644 packages/store/abi/Test.sol/Test.abi.json delete mode 100644 packages/store/abi/Vm.sol/Vm.abi.json delete mode 100644 packages/store/abi/Vm.sol/VmSafe.abi.json delete mode 100644 packages/store/abi/console.sol/console.abi.json delete mode 100644 packages/store/abi/console2.sol/console2.abi.json delete mode 100644 packages/store/abi/test.sol/DSTest.abi.json delete mode 100644 packages/store/src/StoreHook.sol delete mode 100644 packages/world/abi/IStore.sol/IStoreConsumer.abi.json delete mode 100644 packages/world/abi/StoreHook.sol/StoreHook.abi.json delete mode 100644 packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json rename packages/{store/abi/Base.sol/CommonBase.abi.json => world/abi/WorldContext.sol/WorldContext.abi.json} (100%) delete mode 100644 packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json rename packages/world/src/{WorldConsumer.sol => WorldContext.sol} (78%) diff --git a/packages/cli/src/utils/deploy.ts b/packages/cli/src/utils/deploy.ts index 249a49637e..765cdf42ac 100644 --- a/packages/cli/src/utils/deploy.ts +++ b/packages/cli/src/utils/deploy.ts @@ -453,20 +453,16 @@ export async function deploy( async function loadFunctionSignatures(contractName: string): Promise { const { abi } = await getContractData(contractName); - return ( - abi - .filter((item) => ["fallback", "function"].includes(item.type)) - // storeAddress is a special StoreConsumer function inherited by Systems, and shouldn't be registered - .filter((item) => !["storeAddress"].includes(item.name)) - .map((item) => { - if (item.type === "fallback") return { functionName: "", functionArgs: "" }; - - return { - functionName: item.name, - functionArgs: parseComponents(item.inputs), - }; - }) - ); + return abi + .filter((item) => ["fallback", "function"].includes(item.type)) + .map((item) => { + if (item.type === "fallback") return { functionName: "", functionArgs: "" }; + + return { + functionName: item.name, + functionArgs: parseComponents(item.inputs), + }; + }); } /** diff --git a/packages/store/abi/Base.sol/ScriptBase.abi.json b/packages/store/abi/Base.sol/ScriptBase.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/Base.sol/ScriptBase.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/Base.sol/TestBase.abi.json b/packages/store/abi/Base.sol/TestBase.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/Base.sol/TestBase.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json b/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json deleted file mode 100644 index d73bebdc5a..0000000000 --- a/packages/store/abi/IMulticall3.sol/IMulticall3.abi.json +++ /dev/null @@ -1,440 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes[]", - "name": "returnData", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call3[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowFailure", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call3Value[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "aggregate3Value", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "blockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getBasefee", - "outputs": [ - { - "internalType": "uint256", - "name": "basefee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "getBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "chainid", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockCoinbase", - "outputs": [ - { - "internalType": "address", - "name": "coinbase", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockDifficulty", - "outputs": [ - { - "internalType": "uint256", - "name": "difficulty", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockGasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "gaslimit", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentBlockTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "getEthBalance", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getLastBlockHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryAggregate", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "requireSuccess", - "type": "bool" - }, - { - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Call[]", - "name": "calls", - "type": "tuple[]" - } - ], - "name": "tryBlockAndAggregate", - "outputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "internalType": "struct IMulticall3.Result[]", - "name": "returnData", - "type": "tuple[]" - } - ], - "stateMutability": "payable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStore.abi.json b/packages/store/abi/IStore.sol/IStore.abi.json index bb0df2bf1b..9af8379342 100644 --- a/packages/store/abi/IStore.sol/IStore.abi.json +++ b/packages/store/abi/IStore.sol/IStore.abi.json @@ -599,19 +599,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreConsumer.abi.json b/packages/store/abi/IStore.sol/IStoreConsumer.abi.json deleted file mode 100644 index 97c1c97de1..0000000000 --- a/packages/store/abi/IStore.sol/IStoreConsumer.abi.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreData.abi.json b/packages/store/abi/IStore.sol/IStoreData.abi.json index 9bc7fb9335..3d3e52c5c6 100644 --- a/packages/store/abi/IStore.sol/IStoreData.abi.json +++ b/packages/store/abi/IStore.sol/IStoreData.abi.json @@ -397,19 +397,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/store/abi/IStore.sol/IStoreRead.abi.json b/packages/store/abi/IStore.sol/IStoreRead.abi.json index 6c76ffeed7..e6955707bb 100644 --- a/packages/store/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/store/abi/IStore.sol/IStoreRead.abi.json @@ -196,18 +196,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/MudTest.sol/MudTest.abi.json b/packages/store/abi/MudTest.sol/MudTest.abi.json deleted file mode 100644 index 5eb1ac28cf..0000000000 --- a/packages/store/abi/MudTest.sol/MudTest.abi.json +++ /dev/null @@ -1,540 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "log_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "log_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "log_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "name": "log_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "val", - "type": "address" - } - ], - "name": "log_named_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "val", - "type": "bytes" - } - ], - "name": "log_named_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "val", - "type": "bytes32" - } - ], - "name": "log_named_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - } - ], - "name": "log_named_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "val", - "type": "string" - } - ], - "name": "log_named_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - } - ], - "name": "log_named_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "log_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "logs", - "type": "event" - }, - { - "inputs": [], - "name": "IS_TEST", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "excludedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "failed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "setUp", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifactSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedArtifactSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "targetedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json b/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json deleted file mode 100644 index 40e4824345..0000000000 --- a/packages/store/abi/StdAssertions.sol/StdAssertions.abi.json +++ /dev/null @@ -1,392 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "log_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "log_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "log_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "name": "log_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "val", - "type": "address" - } - ], - "name": "log_named_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "val", - "type": "bytes" - } - ], - "name": "log_named_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "val", - "type": "bytes32" - } - ], - "name": "log_named_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - } - ], - "name": "log_named_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "val", - "type": "string" - } - ], - "name": "log_named_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - } - ], - "name": "log_named_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "log_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "logs", - "type": "event" - }, - { - "inputs": [], - "name": "IS_TEST", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "failed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StdChains.sol/StdChains.abi.json b/packages/store/abi/StdChains.sol/StdChains.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdChains.sol/StdChains.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdCheats.sol/StdCheats.abi.json b/packages/store/abi/StdCheats.sol/StdCheats.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdCheats.sol/StdCheats.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json b/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdCheats.sol/StdCheatsSafe.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdError.sol/stdError.abi.json b/packages/store/abi/StdError.sol/stdError.abi.json deleted file mode 100644 index 4d90b15f05..0000000000 --- a/packages/store/abi/StdError.sol/stdError.abi.json +++ /dev/null @@ -1,119 +0,0 @@ -[ - { - "inputs": [], - "name": "arithmeticError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "assertionError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "divisionError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "encodeStorageError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "enumConversionError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "indexOOBError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "memOverflowError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "popError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "zeroVarError", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json b/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json deleted file mode 100644 index d67ff63595..0000000000 --- a/packages/store/abi/StdInvariant.sol/StdInvariant.abi.json +++ /dev/null @@ -1,130 +0,0 @@ -[ - { - "inputs": [], - "name": "excludeArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "excludedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifactSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedArtifactSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "targetedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StdJson.sol/stdJson.abi.json b/packages/store/abi/StdJson.sol/stdJson.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdJson.sol/stdJson.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdMath.sol/stdMath.abi.json b/packages/store/abi/StdMath.sol/stdMath.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdMath.sol/stdMath.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdStorage.sol/stdStorage.abi.json b/packages/store/abi/StdStorage.sol/stdStorage.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdStorage.sol/stdStorage.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json b/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json deleted file mode 100644 index 7c8aa664b5..0000000000 --- a/packages/store/abi/StdStorage.sol/stdStorageSafe.abi.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "who", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "fsig", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "keysHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slot", - "type": "uint256" - } - ], - "name": "SlotFound", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "who", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slot", - "type": "uint256" - } - ], - "name": "WARNING_UninitedSlot", - "type": "event" - } -] \ No newline at end of file diff --git a/packages/store/abi/StdUtils.sol/StdUtils.abi.json b/packages/store/abi/StdUtils.sol/StdUtils.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/StdUtils.sol/StdUtils.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/StoreHook.sol/StoreHook.abi.json b/packages/store/abi/StoreHook.sol/StoreHook.abi.json deleted file mode 100644 index f192f8efc5..0000000000 --- a/packages/store/abi/StoreHook.sol/StoreHook.abi.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "uint8", - "name": "schemaIndex", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onAfterSetField", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "uint8", - "name": "schemaIndex", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onBeforeSetField", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - } - ], - "name": "onDeleteRecord", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onSetRecord", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json b/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json index 554b526e5b..0637a088a0 100644 --- a/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/store/abi/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,13 +1 @@ -[ - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/packages/store/abi/Test.sol/Test.abi.json b/packages/store/abi/Test.sol/Test.abi.json deleted file mode 100644 index 2e54832e26..0000000000 --- a/packages/store/abi/Test.sol/Test.abi.json +++ /dev/null @@ -1,520 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "log_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "log_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "log_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "name": "log_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "val", - "type": "address" - } - ], - "name": "log_named_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "val", - "type": "uint256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256[]", - "name": "val", - "type": "int256[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "val", - "type": "address[]" - } - ], - "name": "log_named_array", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "val", - "type": "bytes" - } - ], - "name": "log_named_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "val", - "type": "bytes32" - } - ], - "name": "log_named_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - } - ], - "name": "log_named_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "val", - "type": "string" - } - ], - "name": "log_named_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - } - ], - "name": "log_named_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "log_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "logs", - "type": "event" - }, - { - "inputs": [], - "name": "IS_TEST", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "excludedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "excludeSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "excludedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "failed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifactSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedArtifactSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetArtifacts", - "outputs": [ - { - "internalType": "string[]", - "name": "targetedArtifacts_", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetContracts", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedContracts_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSelectors", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct StdInvariant.FuzzSelector[]", - "name": "targetedSelectors_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "targetSenders", - "outputs": [ - { - "internalType": "address[]", - "name": "targetedSenders_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/Vm.sol/Vm.abi.json b/packages/store/abi/Vm.sol/Vm.abi.json deleted file mode 100644 index b36288bc80..0000000000 --- a/packages/store/abi/Vm.sol/Vm.abi.json +++ /dev/null @@ -1,3247 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "accesses", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "readSlots", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "writeSlots", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "activeFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "addr", - "outputs": [ - { - "internalType": "address", - "name": "keyAddr", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "allowCheatcodes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "condition", - "type": "bool" - } - ], - "name": "assume", - "outputs": [], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newChainId", - "type": "uint256" - } - ], - "name": "chainId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "clearMockedCalls", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "closeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newCoinbase", - "type": "address" - } - ], - "name": "coinbase", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - } - ], - "name": "createFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - }, - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "createFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "createFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - }, - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "createSelectFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "createSelectFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "urlOrAlias", - "type": "string" - } - ], - "name": "createSelectFork", - "outputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" - } - ], - "name": "deal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "mnemonic", - "type": "string" - }, - { - "internalType": "uint32", - "name": "index", - "type": "uint32" - } - ], - "name": "deriveKey", - "outputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "mnemonic", - "type": "string" - }, - { - "internalType": "string", - "name": "derivationPath", - "type": "string" - }, - { - "internalType": "uint32", - "name": "index", - "type": "uint32" - } - ], - "name": "deriveKey", - "outputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newDifficulty", - "type": "uint256" - } - ], - "name": "difficulty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envAddress", - "outputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envAddress", - "outputs": [ - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBool", - "outputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBool", - "outputs": [ - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBytes", - "outputs": [ - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBytes32", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envInt", - "outputs": [ - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envInt", - "outputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "defaultValue", - "type": "bytes32[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "defaultValue", - "type": "int256[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bool", - "name": "defaultValue", - "type": "bool" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "defaultValue", - "type": "address" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "uint256", - "name": "defaultValue", - "type": "uint256" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "defaultValue", - "type": "bytes[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "defaultValue", - "type": "uint256[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "string[]", - "name": "defaultValue", - "type": "string[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bytes", - "name": "defaultValue", - "type": "bytes" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "defaultValue", - "type": "bytes32" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "int256", - "name": "defaultValue", - "type": "int256" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "address[]", - "name": "defaultValue", - "type": "address[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "defaultValue", - "type": "string" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "defaultValue", - "type": "bool[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envString", - "outputs": [ - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envString", - "outputs": [ - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envUint", - "outputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envUint", - "outputs": [ - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes", - "name": "newRuntimeBytecode", - "type": "bytes" - } - ], - "name": "etch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "callee", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "expectCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "callee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "msgValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "expectCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "checkTopic1", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkTopic2", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkTopic3", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkData", - "type": "bool" - } - ], - "name": "expectEmit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "checkTopic1", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkTopic2", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkTopic3", - "type": "bool" - }, - { - "internalType": "bool", - "name": "checkData", - "type": "bool" - }, - { - "internalType": "address", - "name": "emitter", - "type": "address" - } - ], - "name": "expectEmit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "revertData", - "type": "bytes4" - } - ], - "name": "expectRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "revertData", - "type": "bytes" - } - ], - "name": "expectRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "expectRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newBasefee", - "type": "uint256" - } - ], - "name": "fee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string[]", - "name": "commandInput", - "type": "string[]" - } - ], - "name": "ffi", - "outputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fileOrDir", - "type": "string" - } - ], - "name": "fsMetadata", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isDir", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isSymlink", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "readOnly", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "modified", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accessed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "created", - "type": "uint256" - } - ], - "internalType": "struct VmSafe.FsMetadata", - "name": "metadata", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "artifactPath", - "type": "string" - } - ], - "name": "getCode", - "outputs": [ - { - "internalType": "bytes", - "name": "creationBytecode", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "artifactPath", - "type": "string" - } - ], - "name": "getDeployedCode", - "outputs": [ - { - "internalType": "bytes", - "name": "runtimeBytecode", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getNonce", - "outputs": [ - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRecordedLogs", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32[]", - "name": "topics", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "address", - "name": "emitter", - "type": "address" - } - ], - "internalType": "struct VmSafe.Log[]", - "name": "logs", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isPersistent", - "outputs": [ - { - "internalType": "bool", - "name": "persistent", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "string", - "name": "newLabel", - "type": "string" - } - ], - "name": "label", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "load", - "outputs": [ - { - "internalType": "bytes32", - "name": "data", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - } - ], - "name": "makePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account0", - "type": "address" - }, - { - "internalType": "address", - "name": "account1", - "type": "address" - } - ], - "name": "makePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "makePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account0", - "type": "address" - }, - { - "internalType": "address", - "name": "account1", - "type": "address" - }, - { - "internalType": "address", - "name": "account2", - "type": "address" - } - ], - "name": "makePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "callee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "msgValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "name": "mockCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "callee", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "name": "mockCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseAddress", - "outputs": [ - { - "internalType": "address", - "name": "parsedValue", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBool", - "outputs": [ - { - "internalType": "bool", - "name": "parsedValue", - "type": "bool" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "parsedValue", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "parsedValue", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseInt", - "outputs": [ - { - "internalType": "int256", - "name": "parsedValue", - "type": "int256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "name": "parseJson", - "outputs": [ - { - "internalType": "bytes", - "name": "abiEncodedData", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "key", - "type": "string" - } - ], - "name": "parseJson", - "outputs": [ - { - "internalType": "bytes", - "name": "abiEncodedData", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonAddressArray", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBool", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBoolArray", - "outputs": [ - { - "internalType": "bool[]", - "name": "", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes32Array", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytesArray", - "outputs": [ - { - "internalType": "bytes[]", - "name": "", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonIntArray", - "outputs": [ - { - "internalType": "int256[]", - "name": "", - "type": "int256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonString", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonStringArray", - "outputs": [ - { - "internalType": "string[]", - "name": "", - "type": "string[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonUintArray", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseUint", - "outputs": [ - { - "internalType": "uint256", - "name": "parsedValue", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "pauseGasMetering", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "address", - "name": "txOrigin", - "type": "address" - } - ], - "name": "prank", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "prank", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "projectRoot", - "outputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readFile", - "outputs": [ - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readFileBinary", - "outputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readLine", - "outputs": [ - { - "internalType": "string", - "name": "line", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "record", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "recordLogs", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "rememberKey", - "outputs": [ - { - "internalType": "address", - "name": "keyAddr", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "removeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resumeGasMetering", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "snapshotId", - "type": "uint256" - } - ], - "name": "revertTo", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - } - ], - "name": "revokePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokePersistent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newHeight", - "type": "uint256" - } - ], - "name": "roll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "rollFork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "rollFork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "rollFork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "rollFork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "rpcAlias", - "type": "string" - } - ], - "name": "rpcUrl", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rpcUrlStructs", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - } - ], - "internalType": "struct VmSafe.Rpc[]", - "name": "urls", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rpcUrls", - "outputs": [ - { - "internalType": "string[2][]", - "name": "urls", - "type": "string[2][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - } - ], - "name": "selectFork", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "address[]", - "name": "values", - "type": "address[]" - } - ], - "name": "serializeAddress", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "serializeAddress", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "values", - "type": "bool[]" - } - ], - "name": "serializeBool", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "name": "serializeBool", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "values", - "type": "bytes[]" - } - ], - "name": "serializeBytes", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "name": "serializeBytes", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "values", - "type": "bytes32[]" - } - ], - "name": "serializeBytes32", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "serializeBytes32", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "serializeInt", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "values", - "type": "int256[]" - } - ], - "name": "serializeInt", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "string[]", - "name": "values", - "type": "string[]" - } - ], - "name": "serializeString", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "name": "serializeString", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "serializeUint", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "serializeUint", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "name": "setEnv", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint64", - "name": "newNonce", - "type": "uint64" - } - ], - "name": "setNonce", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "sign", - "outputs": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "snapshot", - "outputs": [ - { - "internalType": "uint256", - "name": "snapshotId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "startPrank", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "address", - "name": "txOrigin", - "type": "address" - } - ], - "name": "startPrank", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stopBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stopPrank", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "store", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "forkId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "transact", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "name": "transact", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newTimestamp", - "type": "uint256" - } - ], - "name": "warp", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "name": "writeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "writeFileBinary", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - } - ], - "name": "writeJson", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "writeJson", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "name": "writeLine", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/Vm.sol/VmSafe.abi.json b/packages/store/abi/Vm.sol/VmSafe.abi.json deleted file mode 100644 index 72e4256f4a..0000000000 --- a/packages/store/abi/Vm.sol/VmSafe.abi.json +++ /dev/null @@ -1,2420 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "accesses", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "readSlots", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "writeSlots", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "addr", - "outputs": [ - { - "internalType": "address", - "name": "keyAddr", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "condition", - "type": "bool" - } - ], - "name": "assume", - "outputs": [], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "broadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "closeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "mnemonic", - "type": "string" - }, - { - "internalType": "uint32", - "name": "index", - "type": "uint32" - } - ], - "name": "deriveKey", - "outputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "mnemonic", - "type": "string" - }, - { - "internalType": "string", - "name": "derivationPath", - "type": "string" - }, - { - "internalType": "uint32", - "name": "index", - "type": "uint32" - } - ], - "name": "deriveKey", - "outputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envAddress", - "outputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envAddress", - "outputs": [ - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBool", - "outputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBool", - "outputs": [ - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBytes", - "outputs": [ - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envBytes32", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envInt", - "outputs": [ - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envInt", - "outputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "defaultValue", - "type": "bytes32[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "value", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "defaultValue", - "type": "int256[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "int256[]", - "name": "value", - "type": "int256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bool", - "name": "defaultValue", - "type": "bool" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "defaultValue", - "type": "address" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "uint256", - "name": "defaultValue", - "type": "uint256" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "defaultValue", - "type": "bytes[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes[]", - "name": "value", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "defaultValue", - "type": "uint256[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "string[]", - "name": "defaultValue", - "type": "string[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bytes", - "name": "defaultValue", - "type": "bytes" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "defaultValue", - "type": "bytes32" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "int256", - "name": "defaultValue", - "type": "int256" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "address[]", - "name": "defaultValue", - "type": "address[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "address[]", - "name": "value", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "defaultValue", - "type": "string" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "defaultValue", - "type": "bool[]" - } - ], - "name": "envOr", - "outputs": [ - { - "internalType": "bool[]", - "name": "value", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envString", - "outputs": [ - { - "internalType": "string[]", - "name": "value", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envString", - "outputs": [ - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "envUint", - "outputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "delim", - "type": "string" - } - ], - "name": "envUint", - "outputs": [ - { - "internalType": "uint256[]", - "name": "value", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string[]", - "name": "commandInput", - "type": "string[]" - } - ], - "name": "ffi", - "outputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fileOrDir", - "type": "string" - } - ], - "name": "fsMetadata", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isDir", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isSymlink", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "readOnly", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "modified", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accessed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "created", - "type": "uint256" - } - ], - "internalType": "struct VmSafe.FsMetadata", - "name": "metadata", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "artifactPath", - "type": "string" - } - ], - "name": "getCode", - "outputs": [ - { - "internalType": "bytes", - "name": "creationBytecode", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "artifactPath", - "type": "string" - } - ], - "name": "getDeployedCode", - "outputs": [ - { - "internalType": "bytes", - "name": "runtimeBytecode", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getNonce", - "outputs": [ - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRecordedLogs", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32[]", - "name": "topics", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "address", - "name": "emitter", - "type": "address" - } - ], - "internalType": "struct VmSafe.Log[]", - "name": "logs", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "string", - "name": "newLabel", - "type": "string" - } - ], - "name": "label", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "load", - "outputs": [ - { - "internalType": "bytes32", - "name": "data", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseAddress", - "outputs": [ - { - "internalType": "address", - "name": "parsedValue", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBool", - "outputs": [ - { - "internalType": "bool", - "name": "parsedValue", - "type": "bool" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "parsedValue", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "parsedValue", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseInt", - "outputs": [ - { - "internalType": "int256", - "name": "parsedValue", - "type": "int256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "name": "parseJson", - "outputs": [ - { - "internalType": "bytes", - "name": "abiEncodedData", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "key", - "type": "string" - } - ], - "name": "parseJson", - "outputs": [ - { - "internalType": "bytes", - "name": "abiEncodedData", - "type": "bytes" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonAddressArray", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBool", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBoolArray", - "outputs": [ - { - "internalType": "bool[]", - "name": "", - "type": "bool[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes32", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytes32Array", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonBytesArray", - "outputs": [ - { - "internalType": "bytes[]", - "name": "", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonInt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonIntArray", - "outputs": [ - { - "internalType": "int256[]", - "name": "", - "type": "int256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonString", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonStringArray", - "outputs": [ - { - "internalType": "string[]", - "name": "", - "type": "string[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonUint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "parseJsonUintArray", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "name": "parseUint", - "outputs": [ - { - "internalType": "uint256", - "name": "parsedValue", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "pauseGasMetering", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "projectRoot", - "outputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readFile", - "outputs": [ - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readFileBinary", - "outputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "readLine", - "outputs": [ - { - "internalType": "string", - "name": "line", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "record", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "recordLogs", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "rememberKey", - "outputs": [ - { - "internalType": "address", - "name": "keyAddr", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "removeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resumeGasMetering", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "rpcAlias", - "type": "string" - } - ], - "name": "rpcUrl", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rpcUrlStructs", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - } - ], - "internalType": "struct VmSafe.Rpc[]", - "name": "urls", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rpcUrls", - "outputs": [ - { - "internalType": "string[2][]", - "name": "urls", - "type": "string[2][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "address[]", - "name": "values", - "type": "address[]" - } - ], - "name": "serializeAddress", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "serializeAddress", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bool[]", - "name": "values", - "type": "bool[]" - } - ], - "name": "serializeBool", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "name": "serializeBool", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes[]", - "name": "values", - "type": "bytes[]" - } - ], - "name": "serializeBytes", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "name": "serializeBytes", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes32[]", - "name": "values", - "type": "bytes32[]" - } - ], - "name": "serializeBytes32", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "serializeBytes32", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "serializeInt", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "int256[]", - "name": "values", - "type": "int256[]" - } - ], - "name": "serializeInt", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "string[]", - "name": "values", - "type": "string[]" - } - ], - "name": "serializeString", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "name": "serializeString", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "serializeUint", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "objectKey", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "serializeUint", - "outputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "value", - "type": "string" - } - ], - "name": "setEnv", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "sign", - "outputs": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - } - ], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "privateKey", - "type": "uint256" - } - ], - "name": "startBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stopBroadcast", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "value", - "type": "address" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "value", - "type": "bool" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "toString", - "outputs": [ - { - "internalType": "string", - "name": "stringifiedValue", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "name": "writeFile", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "writeFileBinary", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "valueKey", - "type": "string" - } - ], - "name": "writeJson", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "json", - "type": "string" - }, - { - "internalType": "string", - "name": "path", - "type": "string" - } - ], - "name": "writeJson", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "path", - "type": "string" - }, - { - "internalType": "string", - "name": "data", - "type": "string" - } - ], - "name": "writeLine", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/abi/console.sol/console.abi.json b/packages/store/abi/console.sol/console.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/console.sol/console.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/console2.sol/console2.abi.json b/packages/store/abi/console2.sol/console2.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/store/abi/console2.sol/console2.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/test.sol/DSTest.abi.json b/packages/store/abi/test.sol/DSTest.abi.json deleted file mode 100644 index 272d1f160c..0000000000 --- a/packages/store/abi/test.sol/DSTest.abi.json +++ /dev/null @@ -1,296 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "log_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "log_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "log_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "name": "log_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "val", - "type": "address" - } - ], - "name": "log_named_address", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "val", - "type": "bytes" - } - ], - "name": "log_named_bytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "val", - "type": "bytes32" - } - ], - "name": "log_named_bytes32", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "decimals", - "type": "uint256" - } - ], - "name": "log_named_decimal_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "int256", - "name": "val", - "type": "int256" - } - ], - "name": "log_named_int", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "val", - "type": "string" - } - ], - "name": "log_named_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "key", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "val", - "type": "uint256" - } - ], - "name": "log_named_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "", - "type": "string" - } - ], - "name": "log_string", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "log_uint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "logs", - "type": "event" - }, - { - "inputs": [], - "name": "IS_TEST", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "failed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index 398776582c..bb9f555237 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -99,7 +99,7 @@ "file": "test/KeyEncoding.t.sol", "test": "testRegisterAndGetSchema", "name": "register KeyEncoding schema", - "gasUsed": 63104 + "gasUsed": 64679 }, { "file": "test/Mixed.t.sol", @@ -111,19 +111,19 @@ "file": "test/Mixed.t.sol", "test": "testRegisterAndGetSchema", "name": "register Mixed schema", - "gasUsed": 60112 + "gasUsed": 61687 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "set record in Mixed", - "gasUsed": 111958 + "gasUsed": 111108 }, { "file": "test/Mixed.t.sol", "test": "testSetAndGet", "name": "get record from Mixed", - "gasUsed": 13025 + "gasUsed": 12600 }, { "file": "test/PackedCounter.t.sol", @@ -339,25 +339,25 @@ "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (cold, 1 slot, 1 uint32 item)", - "gasUsed": 29217 + "gasUsed": 30792 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromSecondField", "name": "pop from field (warm, 1 slot, 1 uint32 item)", - "gasUsed": 19272 + "gasUsed": 18847 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (cold, 2 slots, 10 uint32 items)", - "gasUsed": 31100 + "gasUsed": 32675 }, { "file": "test/StoreCoreDynamic.t.sol", "test": "testPopFromThirdField", "name": "pop from field (warm, 2 slots, 10 uint32 items)", - "gasUsed": 19155 + "gasUsed": 18730 }, { "file": "test/StoreCoreGas.t.sol", @@ -393,7 +393,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testDeleteData", "name": "delete record (complex data, 3 slots)", - "gasUsed": 10917 + "gasUsed": 10447 }, { "file": "test/StoreCoreGas.t.sol", @@ -411,61 +411,61 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "register subscriber", - "gasUsed": 65406 + "gasUsed": 66466 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 73674 + "gasUsed": 74387 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set static field on table with subscriber", - "gasUsed": 31633 + "gasUsed": 30350 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "delete record on table with subscriber", - "gasUsed": 24298 + "gasUsed": 23011 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "register subscriber", - "gasUsed": 65406 + "gasUsed": 66466 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 167111 + "gasUsed": 167824 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) field on table with subscriber", - "gasUsed": 34783 + "gasUsed": 33500 }, { "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "delete (dynamic) record on table with subscriber", - "gasUsed": 25770 + "gasUsed": 24483 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (1 slot, 1 uint32 item)", - "gasUsed": 16988 + "gasUsed": 16518 }, { "file": "test/StoreCoreGas.t.sol", "test": "testPushToField", "name": "push to field (2 slots, 10 uint32 items)", - "gasUsed": 39704 + "gasUsed": 39234 }, { "file": "test/StoreCoreGas.t.sol", @@ -489,7 +489,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetDynamicData", "name": "set complex record with dynamic data (4 slots)", - "gasUsed": 107630 + "gasUsed": 109160 }, { "file": "test/StoreCoreGas.t.sol", @@ -531,7 +531,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (1 slot)", - "gasUsed": 37848 + "gasUsed": 39378 }, { "file": "test/StoreCoreGas.t.sol", @@ -543,7 +543,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set static field (overlap 2 slot)", - "gasUsed": 34810 + "gasUsed": 34340 }, { "file": "test/StoreCoreGas.t.sol", @@ -555,7 +555,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, first dynamic field)", - "gasUsed": 57309 + "gasUsed": 56839 }, { "file": "test/StoreCoreGas.t.sol", @@ -567,7 +567,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetField", "name": "set dynamic field (1 slot, second dynamic field)", - "gasUsed": 35441 + "gasUsed": 34971 }, { "file": "test/StoreCoreGas.t.sol", @@ -579,7 +579,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticData", "name": "set static record (1 slot)", - "gasUsed": 37297 + "gasUsed": 38827 }, { "file": "test/StoreCoreGas.t.sol", @@ -591,7 +591,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetAndGetStaticDataSpanningWords", "name": "set static record (2 slots)", - "gasUsed": 59865 + "gasUsed": 61395 }, { "file": "test/StoreCoreGas.t.sol", @@ -603,79 +603,79 @@ "file": "test/StoreCoreGas.t.sol", "test": "testSetMetadata", "name": "StoreCore: set table metadata", - "gasUsed": 251724 + "gasUsed": 252784 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "update in field (1 slot, 1 uint32 item)", - "gasUsed": 16534 + "gasUsed": 16064 }, { "file": "test/StoreCoreGas.t.sol", "test": "testUpdateInField", "name": "push to field (2 slots, 6 uint64 items)", - "gasUsed": 17625 + "gasUsed": 17155 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 250115 + "gasUsed": 251265 }, { "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "get record from StoreMetadataTable", - "gasUsed": 12443 + "gasUsed": 12018 }, { "file": "test/StoreSwitch.t.sol", - "test": "testIsDelegatecall", - "name": "check if delegatecall", - "gasUsed": 618 + "test": "testDelegatecall", + "name": "get Store address", + "gasUsed": 2170 }, { "file": "test/StoreSwitch.t.sol", - "test": "testIsNoDelegatecall", - "name": "check if delegatecall", - "gasUsed": 552 + "test": "testNoDelegatecall", + "name": "get Store address", + "gasUsed": 2173 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "set field in Callbacks", - "gasUsed": 63093 + "gasUsed": 62243 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "get field from Callbacks (warm)", - "gasUsed": 5730 + "gasUsed": 5305 }, { "file": "test/tables/Callbacks.t.sol", "test": "testSetAndGet", "name": "push field to Callbacks", - "gasUsed": 40781 + "gasUsed": 39931 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "set field in Hooks", - "gasUsed": 63250 + "gasUsed": 64400 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "get field from Hooks (warm)", - "gasUsed": 5880 + "gasUsed": 5455 }, { "file": "test/tables/Hooks.t.sol", "test": "testSetAndGet", "name": "push field to Hooks", - "gasUsed": 40772 + "gasUsed": 39922 }, { "file": "test/tightcoder/DecodeSlice.t.sol", @@ -735,18 +735,18 @@ "file": "test/Vector2.t.sol", "test": "testRegisterAndGetSchema", "name": "register Vector2 schema", - "gasUsed": 57315 + "gasUsed": 58890 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "set Vector2 record", - "gasUsed": 38496 + "gasUsed": 37646 }, { "file": "test/Vector2.t.sol", "test": "testSetAndGet", "name": "get Vector2 record", - "gasUsed": 4882 + "gasUsed": 4457 } ] diff --git a/packages/store/package.json b/packages/store/package.json index 59a821c7de..6373328ad6 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -35,7 +35,7 @@ }, "scripts": { "build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:typechain && pnpm run build:js", - "build:abi": "forge build --extra-output-files abi --out abi --skip test script", + "build:abi": "forge build --extra-output-files abi --out abi --skip test script MudTest.sol", "build:js": "tsup", "build:mud": "tsx ./ts/scripts/tablegen.ts", "build:typechain": "typechain --target ethers-v5 'abi/**/*.sol/!(*.abi).json'", diff --git a/packages/store/src/IStore.sol b/packages/store/src/IStore.sol index afc83a071b..9bec85453c 100644 --- a/packages/store/src/IStore.sol +++ b/packages/store/src/IStore.sol @@ -4,17 +4,7 @@ pragma solidity >=0.8.0; import { IStoreErrors } from "./IStoreErrors.sol"; import { Schema } from "./Schema.sol"; -interface IStoreConsumer { - // TODO: benchmark this vs. using a known storage slot to determine the Store address - // (see https://github.com/latticexyz/mud/issues/444) - /** - * Returns the Store address used by this consumer (like Hooks, Store itself, World Systems, or tests/scripts) - * for StoreSwitch to determine how to interact with the Store. - */ - function storeAddress() external view returns (address storeAddress); -} - -interface IStoreRead is IStoreConsumer { +interface IStoreRead { function getSchema(bytes32 table) external view returns (Schema schema); function getKeySchema(bytes32 table) external view returns (Schema schema); diff --git a/packages/store/src/MudTest.sol b/packages/store/src/MudTest.sol index 4bbedc1db2..384f281df8 100644 --- a/packages/store/src/MudTest.sol +++ b/packages/store/src/MudTest.sol @@ -2,13 +2,14 @@ pragma solidity >=0.8.0; import { Test } from "forge-std/Test.sol"; -import { IStoreConsumer } from "./IStore.sol"; +import { StoreSwitch } from "../src/StoreSwitch.sol"; -contract MudTest is Test, IStoreConsumer { +contract MudTest is Test { address worldAddress; function setUp() public virtual { worldAddress = vm.parseAddress(vm.readFile(".mudtest")); + StoreSwitch.setStoreAddress(worldAddress); } function storeAddress() public view returns (address) { diff --git a/packages/store/src/StoreCore.sol b/packages/store/src/StoreCore.sol index bf5e7afbcc..7be810483b 100644 --- a/packages/store/src/StoreCore.sol +++ b/packages/store/src/StoreCore.sol @@ -12,6 +12,7 @@ import { StoreMetadata, Hooks, HooksTableId } from "./codegen/Tables.sol"; import { IStoreErrors } from "./IStoreErrors.sol"; import { IStoreHook } from "./IStore.sol"; import { TableId } from "./TableId.sol"; +import { StoreSwitch } from "./StoreSwitch.sol"; library StoreCore { using TableId for bytes32; @@ -29,6 +30,10 @@ library StoreCore { * (see https://github.com/latticexyz/mud/issues/444) */ function initialize() internal { + // Use address(this) instead of msg.sender (the default) when using StoreSwitch + // from within the Store contract itself (e.g. during delegatecall) + StoreSwitch.setStoreAddress(address(this)); + // Register internal schema table registerSchema( StoreCoreInternal.SCHEMA_TABLE, diff --git a/packages/store/src/StoreHook.sol b/packages/store/src/StoreHook.sol deleted file mode 100644 index fa8dbd13f5..0000000000 --- a/packages/store/src/StoreHook.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0; - -import { IStoreHook } from "./IStore.sol"; - -/** - * When making a hook, prefer inheriting StoreHook over IStoreHook for convenience - * (hooks should use the default StoreConsumer). - */ -abstract contract StoreHook is IStoreHook { - -} diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index c50addf4d1..af8e08aa5d 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStore, IStoreHook, IStoreConsumer } from "./IStore.sol"; +import { IStore, IStoreHook } from "./IStore.sol"; import { StoreCore } from "./StoreCore.sol"; import { Schema } from "./Schema.sol"; @@ -9,36 +9,44 @@ import { Schema } from "./Schema.sol"; * Call IStore functions on self or msg.sender, depending on whether the call is a delegatecall or regular call. */ library StoreSwitch { - error StoreSwitch_MissingOrInvalidStoreAddressFunction(bytes lowLevelData); + bytes32 private constant STORAGE_SLOT = keccak256("mud.store.storage.StoreSwitch"); - function storeAddress() internal view returns (address) { - // Detect calls from within a constructor - uint256 codeSize; + struct StorageSlotLayout { + address storeAddress; + } + + function _layout() private pure returns (StorageSlotLayout storage layout) { + bytes32 slot = STORAGE_SLOT; assembly { - codeSize := extcodesize(address()) + layout.slot := slot } + } - // If the call is from within a constructor, use StoreCore to write to own storage - if (codeSize == 0) return address(this); - - bytes4 storeAddressSelector = IStoreConsumer.storeAddress.selector; - address result; - assembly { - mstore(0x00, storeAddressSelector) - let success := staticcall(gas(), address(), 0x00, 4, 0x00, 0x20) - switch success - case 0 { - result := caller() - } - case 1 { - result := mload(0x00) - } + /** + * Get the Store address for use by other StoreSwitch functions. + * 0x00 is a magic number for msg.sender + * (which means that uninitialized storeAddress is msg.sender by default) + */ + function getStoreAddress() internal view returns (address) { + address _storeAddress = _layout().storeAddress; + if (_storeAddress == address(0)) { + return msg.sender; + } else { + return _storeAddress; } - return result; + } + + /** + * Set the Store address for use by other StoreSwitch functions. + * 0x00 is a magic number for msg.sender + * (which means that uninitialized storeAddress is msg.sender by default) + */ + function setStoreAddress(address _storeAddress) internal { + _layout().storeAddress = _storeAddress; } function registerStoreHook(bytes32 table, IStoreHook hook) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.registerStoreHook(table, hook); } else { @@ -47,7 +55,7 @@ library StoreSwitch { } function getSchema(bytes32 table) internal view returns (Schema schema) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { schema = StoreCore.getSchema(table); } else { @@ -56,7 +64,7 @@ library StoreSwitch { } function getKeySchema(bytes32 table) internal view returns (Schema keySchema) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { keySchema = StoreCore.getKeySchema(table); } else { @@ -65,7 +73,7 @@ library StoreSwitch { } function setMetadata(bytes32 table, string memory tableName, string[] memory fieldNames) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.setMetadata(table, tableName, fieldNames); } else { @@ -74,7 +82,7 @@ library StoreSwitch { } function registerSchema(bytes32 table, Schema schema, Schema keySchema) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.registerSchema(table, schema, keySchema); } else { @@ -83,7 +91,7 @@ library StoreSwitch { } function setRecord(bytes32 table, bytes32[] memory key, bytes memory data) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.setRecord(table, key, data); } else { @@ -92,7 +100,7 @@ library StoreSwitch { } function setField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, bytes memory data) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.setField(table, key, fieldIndex, data); } else { @@ -101,7 +109,7 @@ library StoreSwitch { } function pushToField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, bytes memory dataToPush) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.pushToField(table, key, fieldIndex, dataToPush); } else { @@ -110,7 +118,7 @@ library StoreSwitch { } function popFromField(bytes32 table, bytes32[] memory key, uint8 fieldIndex, uint256 byteLengthToPop) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.popFromField(table, key, fieldIndex, byteLengthToPop); } else { @@ -125,7 +133,7 @@ library StoreSwitch { uint256 startByteIndex, bytes memory dataToSet ) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.updateInField(table, key, fieldIndex, startByteIndex, dataToSet); } else { @@ -134,7 +142,7 @@ library StoreSwitch { } function deleteRecord(bytes32 table, bytes32[] memory key) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.deleteRecord(table, key); } else { @@ -143,7 +151,7 @@ library StoreSwitch { } function emitEphemeralRecord(bytes32 table, bytes32[] memory key, bytes memory data) internal { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { StoreCore.emitEphemeralRecord(table, key, data); } else { @@ -152,7 +160,7 @@ library StoreSwitch { } function getRecord(bytes32 table, bytes32[] memory key) internal view returns (bytes memory) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { return StoreCore.getRecord(table, key); } else { @@ -161,7 +169,7 @@ library StoreSwitch { } function getRecord(bytes32 table, bytes32[] memory key, Schema schema) internal view returns (bytes memory) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { return StoreCore.getRecord(table, key, schema); } else { @@ -170,7 +178,7 @@ library StoreSwitch { } function getField(bytes32 table, bytes32[] memory key, uint8 fieldIndex) internal view returns (bytes memory) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { return StoreCore.getField(table, key, fieldIndex); } else { @@ -184,7 +192,7 @@ library StoreSwitch { uint8 fieldIndex, Schema schema ) internal view returns (uint256) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { return StoreCore.getFieldLength(table, key, fieldIndex, schema); } else { @@ -200,7 +208,7 @@ library StoreSwitch { uint256 start, uint256 end ) internal view returns (bytes memory) { - address _storeAddress = storeAddress(); + address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { return StoreCore.getFieldSlice(table, key, fieldIndex, schema, start, end); } else { diff --git a/packages/store/test/MirrorSubscriber.sol b/packages/store/test/MirrorSubscriber.sol index a6fc7da438..66ee093272 100644 --- a/packages/store/test/MirrorSubscriber.sol +++ b/packages/store/test/MirrorSubscriber.sol @@ -1,14 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { IStore } from "../src/IStore.sol"; +import { IStore, IStoreHook } from "../src/IStore.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; -import { StoreHook } from "../src/StoreHook.sol"; import { Schema } from "../src/Schema.sol"; bytes32 constant indexerTableId = keccak256("indexer.table"); -contract MirrorSubscriber is StoreHook { +contract MirrorSubscriber is IStoreHook { bytes32 _table; constructor(bytes32 table, Schema schema, Schema keySchema) { diff --git a/packages/store/test/StoreSwitch.t.sol b/packages/store/test/StoreSwitch.t.sol index 87186a0e3d..4aebeba45d 100644 --- a/packages/store/test/StoreSwitch.t.sol +++ b/packages/store/test/StoreSwitch.t.sol @@ -9,26 +9,26 @@ import { StoreSwitch } from "../src/StoreSwitch.sol"; // Mock Store and its consumer contract StoreSwitchTestStore is StoreReadWithStubs { - MockStoreConsumer mockConsumer = new MockStoreConsumer(); + MockSystem mockSystem = new MockSystem(); - function callViaDelegateCall() public returns (bool isDelegate) { - (bool success, bytes memory data) = address(mockConsumer).delegatecall(abi.encodeWithSignature("isDelegateCall()")); + function callViaDelegateCall() public returns (address storeAddress) { + (bool success, bytes memory data) = address(mockSystem).delegatecall(abi.encodeWithSignature("getStoreAddress()")); if (!success) revert("delegatecall failed"); - isDelegate = abi.decode(data, (bool)); + storeAddress = abi.decode(data, (address)); } - function callViaCall() public returns (bool isDelegate) { - (bool success, bytes memory data) = address(mockConsumer).call(abi.encodeWithSignature("isDelegateCall()")); - if (!success) revert("call failed"); - isDelegate = abi.decode(data, (bool)); + function callViaCall() public returns (address storeAddress) { + (bool success, bytes memory data) = address(mockSystem).call(abi.encodeWithSignature("getStoreAddress()")); + if (!success) revert("delegatecall failed"); + storeAddress = abi.decode(data, (address)); } } -// Mock consumer to wrap StoreSwitch.storeAddress() comparison -contract MockStoreConsumer is GasReporter { - function isDelegateCall() public returns (bool isDelegate) { - startGasReport("check if delegatecall"); - isDelegate = StoreSwitch.storeAddress() == address(this); +// Mock system to wrap StoreSwitch.getStoreAddress() +contract MockSystem is GasReporter { + function getStoreAddress() public returns (address storeAddress) { + startGasReport("get Store address"); + storeAddress = StoreSwitch.getStoreAddress(); endGasReport(); } } @@ -40,14 +40,14 @@ contract StoreSwitchTest is Test, GasReporter { store = new StoreSwitchTestStore(); } - function testIsDelegatecall() public { - bool isDelegate = store.callViaDelegateCall(); - assertTrue(isDelegate); + function testDelegatecall() public { + address storeAddress = store.callViaDelegateCall(); + assertEq(storeAddress, address(store)); } - function testIsNoDelegatecall() public { - bool isDelegate = store.callViaCall(); - assertFalse(isDelegate); + function testNoDelegatecall() public { + address storeAddress = store.callViaCall(); + assertEq(storeAddress, address(store)); } // TODO: tests for setting data on self vs msg.sender diff --git a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json index 797fcdcd72..64e76c27d5 100644 --- a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json +++ b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json @@ -1233,19 +1233,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStore.abi.json b/packages/world/abi/IStore.sol/IStore.abi.json index bb0df2bf1b..9af8379342 100644 --- a/packages/world/abi/IStore.sol/IStore.abi.json +++ b/packages/world/abi/IStore.sol/IStore.abi.json @@ -599,19 +599,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/IStore.sol/IStoreConsumer.abi.json deleted file mode 100644 index 97c1c97de1..0000000000 --- a/packages/world/abi/IStore.sol/IStoreConsumer.abi.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreData.abi.json b/packages/world/abi/IStore.sol/IStoreData.abi.json index 9bc7fb9335..3d3e52c5c6 100644 --- a/packages/world/abi/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/IStore.sol/IStoreData.abi.json @@ -397,19 +397,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/abi/IStore.sol/IStoreRead.abi.json b/packages/world/abi/IStore.sol/IStoreRead.abi.json index 6c76ffeed7..e6955707bb 100644 --- a/packages/world/abi/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/IStore.sol/IStoreRead.abi.json @@ -196,18 +196,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/StoreHook.sol/StoreHook.abi.json b/packages/world/abi/StoreHook.sol/StoreHook.abi.json deleted file mode 100644 index f192f8efc5..0000000000 --- a/packages/world/abi/StoreHook.sol/StoreHook.abi.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "uint8", - "name": "schemaIndex", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onAfterSetField", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "uint8", - "name": "schemaIndex", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onBeforeSetField", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - } - ], - "name": "onDeleteRecord", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "table", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "key", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "onSetRecord", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json b/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json index 554b526e5b..0637a088a0 100644 --- a/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/world/abi/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,13 +1 @@ -[ - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json b/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/packages/world/abi/WorldConsumer.sol/WorldConsumer.abi.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/store/abi/Base.sol/CommonBase.abi.json b/packages/world/abi/WorldContext.sol/WorldContext.abi.json similarity index 100% rename from packages/store/abi/Base.sol/CommonBase.abi.json rename to packages/world/abi/WorldContext.sol/WorldContext.abi.json diff --git a/packages/world/abi/src/IStore.sol/IStore.abi.json b/packages/world/abi/src/IStore.sol/IStore.abi.json index bb0df2bf1b..9af8379342 100644 --- a/packages/world/abi/src/IStore.sol/IStore.abi.json +++ b/packages/world/abi/src/IStore.sol/IStore.abi.json @@ -599,19 +599,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json b/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json deleted file mode 100644 index 97c1c97de1..0000000000 --- a/packages/world/abi/src/IStore.sol/IStoreConsumer.abi.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreData.abi.json b/packages/world/abi/src/IStore.sol/IStoreData.abi.json index 9bc7fb9335..3d3e52c5c6 100644 --- a/packages/world/abi/src/IStore.sol/IStoreData.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreData.abi.json @@ -397,19 +397,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json index 6c76ffeed7..e6955707bb 100644 --- a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json +++ b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json @@ -196,18 +196,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "storeAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json b/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json index 554b526e5b..0637a088a0 100644 --- a/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json +++ b/packages/world/abi/src/StoreSwitch.sol/StoreSwitch.abi.json @@ -1,13 +1 @@ -[ - { - "inputs": [ - { - "internalType": "bytes", - "name": "lowLevelData", - "type": "bytes" - } - ], - "name": "StoreSwitch_MissingOrInvalidStoreAddressFunction", - "type": "error" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index 9b4b5c9d29..c224b22bb4 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,67 +3,67 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1276057 + "gasUsed": 1255918 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1276057 + "gasUsed": 1255918 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 191964 + "gasUsed": 189048 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1276057 + "gasUsed": 1255918 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1276057 + "gasUsed": 1255918 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 29649 + "gasUsed": 28420 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 285850 + "gasUsed": 269873 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1276057 + "gasUsed": 1255918 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 28263 + "gasUsed": 27034 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 149826 + "gasUsed": 141223 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 621393 + "gasUsed": 606570 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,49 +81,49 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 621393 + "gasUsed": 606570 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 164997 + "gasUsed": 162081 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 621393 + "gasUsed": 606570 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 134651 + "gasUsed": 129735 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "delete a record on a table with KeysWithValueModule installed", - "gasUsed": 54099 + "gasUsed": 50859 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 621393 + "gasUsed": 606570 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 173629 + "gasUsed": 170378 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 137987 + "gasUsed": 132736 }, { "file": "test/query.t.sol", @@ -195,126 +195,126 @@ "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 42136 + "gasUsed": 39886 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 60074 + "gasUsed": 57218 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 815540 + "gasUsed": 797781 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 71874 + "gasUsed": 71077 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 786883 + "gasUsed": 769203 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 71874 + "gasUsed": 71077 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 15932 + "gasUsed": 15038 }, { "file": "test/World.t.sol", "test": "testPushToField", "name": "Push data to the table", - "gasUsed": 96313 + "gasUsed": 95419 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a fallback system", - "gasUsed": 85220 + "gasUsed": 81644 }, { "file": "test/World.t.sol", "test": "testRegisterFallbackSystem", "name": "Register a root fallback system", - "gasUsed": 76404 + "gasUsed": 72828 }, { "file": "test/World.t.sol", "test": "testRegisterFunctionSelector", "name": "Register a function selector", - "gasUsed": 105815 + "gasUsed": 102239 }, { "file": "test/World.t.sol", "test": "testRegisterNamespace", "name": "Register a new namespace", - "gasUsed": 160093 + "gasUsed": 157623 }, { "file": "test/World.t.sol", "test": "testRegisterRootFunctionSelector", "name": "Register a root function selector", - "gasUsed": 92307 + "gasUsed": 88731 }, { "file": "test/World.t.sol", "test": "testRegisterTable", "name": "Register a new table in the namespace", - "gasUsed": 259987 + "gasUsed": 255729 }, { "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 44521 + "gasUsed": 43627 }, { "file": "test/World.t.sol", "test": "testSetMetadata", "name": "Set metadata", - "gasUsed": 282242 + "gasUsed": 279560 }, { "file": "test/World.t.sol", "test": "testSetRecord", "name": "Write data to the table", - "gasUsed": 42398 + "gasUsed": 41504 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 37845 + "gasUsed": 38951 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 22635 + "gasUsed": 21741 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 40157 + "gasUsed": 41263 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 25359 + "gasUsed": 24465 } ] diff --git a/packages/world/src/System.sol b/packages/world/src/System.sol index c0ed5ecc23..aa1bfd0ebf 100644 --- a/packages/world/src/System.sol +++ b/packages/world/src/System.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { WorldConsumer } from "./WorldConsumer.sol"; +import { WorldContext } from "./WorldContext.sol"; -// For now System is just an alias for `WorldConsumer`, +// For now System is just an alias for `WorldContext`, // but we might add more default functionality in the future. -contract System is WorldConsumer { +contract System is WorldContext { } diff --git a/packages/world/src/Utils.sol b/packages/world/src/Utils.sol index 2ccb1a7c8a..dd5a4138dc 100644 --- a/packages/world/src/Utils.sol +++ b/packages/world/src/Utils.sol @@ -14,7 +14,7 @@ library Utils { * because they're delegatecalled and the name isn't passed in calldata */ function systemNamespace() internal view returns (bytes16) { - if (StoreSwitch.storeAddress() == address(this)) { + if (StoreSwitch.getStoreAddress() == address(this)) { return ""; } else { bytes32 resourceSelector = SystemRegistry.get(address(this)); diff --git a/packages/world/src/WorldConsumer.sol b/packages/world/src/WorldContext.sol similarity index 78% rename from packages/world/src/WorldConsumer.sol rename to packages/world/src/WorldContext.sol index 4bf7f39f90..1d5f6c00ab 100644 --- a/packages/world/src/WorldConsumer.sol +++ b/packages/world/src/WorldContext.sol @@ -5,8 +5,7 @@ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; // Similar to https://eips.ethereum.org/EIPS/eip-2771, but any contract can be the trusted forwarder. // This should only be used for contracts without own storage, like Systems. -// Systems also rely on `StoreConsumer.storeAddress` being msg.sender (the non-forwarded one) for access control. -abstract contract WorldConsumer { +abstract contract WorldContext { // Extract the trusted msg.sender value appended to the calldata function _msgSender() internal view returns (address sender) { assembly { @@ -17,6 +16,6 @@ abstract contract WorldConsumer { } function _world() internal view returns (address) { - return StoreSwitch.storeAddress(); + return StoreSwitch.getStoreAddress(); } } diff --git a/packages/world/src/modules/core/CoreModule.sol b/packages/world/src/modules/core/CoreModule.sol index ad24f52ffc..3f9ceca643 100644 --- a/packages/world/src/modules/core/CoreModule.sol +++ b/packages/world/src/modules/core/CoreModule.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0; import { Call } from "../../Call.sol"; import { ROOT_NAMESPACE } from "../../constants.sol"; -import { WorldConsumer } from "../../WorldConsumer.sol"; +import { WorldContext } from "../../WorldContext.sol"; import { Resource } from "../../Types.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; @@ -38,7 +38,7 @@ import { EphemeralRecordSystem } from "./implementations/EphemeralRecordSystem.s * This module is required to be delegatecalled (via `World.registerRootSystem`), * because it needs to install root tables, systems and function selectors. */ -contract CoreModule is IModule, WorldConsumer { +contract CoreModule is IModule, WorldContext { // Since the CoreSystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. address immutable coreSystem = address(new CoreSystem()); diff --git a/packages/world/src/modules/keysintable/KeysInTableHook.sol b/packages/world/src/modules/keysintable/KeysInTableHook.sol index eb0ab99f23..747b5a709b 100644 --- a/packages/world/src/modules/keysintable/KeysInTableHook.sol +++ b/packages/world/src/modules/keysintable/KeysInTableHook.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { StoreHook } from "@latticexyz/store/src/StoreHook.sol"; +import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; import { KeysInTable } from "./tables/KeysInTable.sol"; import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; @@ -9,7 +9,7 @@ import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; /** * Note: if a table with composite keys is used, only the first key is indexed */ -contract KeysInTableHook is StoreHook { +contract KeysInTableHook is IStoreHook { function handleSet(bytes32 tableId, bytes32[] memory key) internal { bytes32 keysHash = keccak256(abi.encode(key)); diff --git a/packages/world/src/modules/keysintable/KeysInTableModule.sol b/packages/world/src/modules/keysintable/KeysInTableModule.sol index b78498aaaa..e908d01a55 100644 --- a/packages/world/src/modules/keysintable/KeysInTableModule.sol +++ b/packages/world/src/modules/keysintable/KeysInTableModule.sol @@ -7,7 +7,7 @@ import { Resource } from "../../Types.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldConsumer } from "../../WorldConsumer.sol"; +import { WorldContext } from "../../WorldContext.sol"; import { ResourceSelector } from "../../ResourceSelector.sol"; import { KeysInTableHook } from "./KeysInTableHook.sol"; @@ -24,7 +24,7 @@ import { UsedKeysIndex, UsedKeysIndexTableId } from "./tables/UsedKeysIndex.sol" * Note: this module currently expects to be `delegatecalled` via World.installRootModule. * Support for installing it via `World.installModule` depends on `World.callFrom` being implemented. */ -contract KeysInTableModule is IModule, WorldConsumer { +contract KeysInTableModule is IModule, WorldContext { using ResourceSelector for bytes32; // The KeysInTableHook is deployed once and infers the target table id diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol index 0e0bce21d0..82d931d6ce 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; -import { StoreHook } from "@latticexyz/store/src/StoreHook.sol"; +import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; import { Bytes } from "@latticexyz/store/src/Bytes.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; @@ -21,12 +21,12 @@ import { getTargetTableSelector } from "../utils/getTargetTableSelector.sol"; * * Note: if a table with composite keys is used, only the first key is indexed */ -contract KeysWithValueHook is StoreHook { +contract KeysWithValueHook is IStoreHook { using ArrayLib for bytes32[]; using ResourceSelector for bytes32; function _world() internal view returns (IBaseWorld) { - return IBaseWorld(StoreSwitch.storeAddress()); + return IBaseWorld(StoreSwitch.getStoreAddress()); } function onSetRecord(bytes32 sourceTableId, bytes32[] memory key, bytes memory data) public { diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol index c236ab49ea..f6af846bd5 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueModule.sol @@ -6,7 +6,7 @@ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldConsumer } from "../../WorldConsumer.sol"; +import { WorldContext } from "../../WorldContext.sol"; import { ResourceSelector } from "../../ResourceSelector.sol"; import { MODULE_NAMESPACE } from "./constants.sol"; @@ -25,7 +25,7 @@ import { getTargetTableSelector } from "../utils/getTargetTableSelector.sol"; * Note: this module currently expects to be `delegatecalled` via World.installRootModule. * Support for installing it via `World.installModule` depends on `World.callFrom` being implemented. */ -contract KeysWithValueModule is IModule, WorldConsumer { +contract KeysWithValueModule is IModule, WorldContext { using ResourceSelector for bytes32; // The KeysWithValueHook is deployed once and infers the target table id diff --git a/packages/world/src/modules/snapsync/SnapSyncModule.sol b/packages/world/src/modules/snapsync/SnapSyncModule.sol index 1970e64229..b35ef982c8 100644 --- a/packages/world/src/modules/snapsync/SnapSyncModule.sol +++ b/packages/world/src/modules/snapsync/SnapSyncModule.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.0; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldConsumer } from "../../WorldConsumer.sol"; +import { WorldContext } from "../../WorldContext.sol"; import { SnapSyncSystem } from "./SnapSyncSystem.sol"; @@ -15,7 +15,7 @@ import { NAMESPACE, MODULE_NAME, SYSTEM_NAME, TABLE_NAME } from "./constants.sol * This module registers a system that allows clients to load a snapshot of the World state * by using view functions. */ -contract SnapSyncModule is IModule, WorldConsumer { +contract SnapSyncModule is IModule, WorldContext { // Since the SnapSyncSystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. SnapSyncSystem private immutable snapSyncSystem = new SnapSyncSystem(); diff --git a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol index 00810d03d9..d86a040b6e 100644 --- a/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol +++ b/packages/world/src/modules/uniqueentity/UniqueEntityModule.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.0; import { IBaseWorld } from "../../interfaces/IBaseWorld.sol"; import { IModule } from "../../interfaces/IModule.sol"; -import { WorldConsumer } from "../../WorldConsumer.sol"; +import { WorldContext } from "../../WorldContext.sol"; import { UniqueEntity } from "./tables/UniqueEntity.sol"; import { UniqueEntitySystem } from "./UniqueEntitySystem.sol"; @@ -15,7 +15,7 @@ import { NAMESPACE, MODULE_NAME, SYSTEM_NAME, TABLE_NAME } from "./constants.sol * This module creates a table that stores a nonce, and * a public system that returns an incremented nonce each time. */ -contract UniqueEntityModule is IModule, WorldConsumer { +contract UniqueEntityModule is IModule, WorldContext { // Since the UniqueEntitySystem only exists once per World and writes to // known tables, we can deploy it once and register it in multiple Worlds. UniqueEntitySystem immutable uniqueEntitySystem = new UniqueEntitySystem(); diff --git a/packages/world/src/modules/uniqueentity/getUniqueEntity.sol b/packages/world/src/modules/uniqueentity/getUniqueEntity.sol index bf377d5998..6142514a97 100644 --- a/packages/world/src/modules/uniqueentity/getUniqueEntity.sol +++ b/packages/world/src/modules/uniqueentity/getUniqueEntity.sol @@ -13,7 +13,7 @@ import { IUniqueEntitySystem } from "../../interfaces/IUniqueEntitySystem.sol"; * For usage outside of a World, use the overload that takes an explicit store argument. */ function getUniqueEntity() returns (bytes32 uniqueEntity) { - address world = StoreSwitch.storeAddress(); + address world = StoreSwitch.getStoreAddress(); return IUniqueEntitySystem(world).uniqueEntity_system_getUniqueEntity(); } diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 9e131fb02d..d50f332e0a 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -6,7 +6,7 @@ import { GasReporter } from "@latticexyz/gas-report/src/GasReporter.sol"; import { SchemaType } from "@latticexyz/schema-type/src/solidity/SchemaType.sol"; -import { IStoreHook, StoreHook } from "@latticexyz/store/src/StoreHook.sol"; +import { IStoreHook } from "@latticexyz/store/src/IStore.sol"; import { StoreCore, StoreCoreInternal } from "@latticexyz/store/src/StoreCore.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol"; @@ -44,6 +44,10 @@ contract WorldTestSystem is System { error WorldTestSystemError(string err); event WorldTestSystemLog(string log); + function getStoreAddress() public view returns (address) { + return StoreSwitch.getStoreAddress(); + } + function msgSender() public view returns (address) { return _msgSender(); } @@ -72,7 +76,7 @@ contract WorldTestSystem is System { function writeData(bytes16 namespace, bytes16 name, bool data) public { bytes32[] memory key = new bytes32[](0); - if (StoreSwitch.storeAddress() == address(this)) { + if (StoreSwitch.getStoreAddress() == address(this)) { bytes32 tableId = ResourceSelector.from(namespace, name); StoreCore.setRecord(tableId, key, abi.encodePacked(data)); } else { @@ -81,7 +85,7 @@ contract WorldTestSystem is System { } function emitCallType() public { - if (StoreSwitch.storeAddress() == address(this)) { + if (StoreSwitch.getStoreAddress() == address(this)) { emit WorldTestSystemLog("delegatecall"); } else { emit WorldTestSystemLog("call"); @@ -99,7 +103,7 @@ contract PayableFallbackSystem is System { fallback() external payable {} } -contract WorldTestTableHook is StoreHook { +contract WorldTestTableHook is IStoreHook { event HookCalled(bytes data); function onSetRecord(bytes32 table, bytes32[] memory key, bytes memory data) public { @@ -192,7 +196,16 @@ contract WorldTest is Test, GasReporter { } function testStoreAddress() public { - assertEq(world.storeAddress(), address(world)); + // Register a system and use it to get storeAddress + WorldTestSystem system = new WorldTestSystem(); + world.registerSystem("namespace", "testSystem", system, false); + bytes memory result = world.call( + "namespace", + "testSystem", + abi.encodeWithSelector(WorldTestSystem.getStoreAddress.selector) + ); + + assertEq(abi.decode(result, (address)), address(world)); } function testRegisterNamespace() public { From ac6c2d8db87da31c6bd58fb32cec89596680de3d Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 16:34:46 +0300 Subject: [PATCH 17/25] rebuild --- .../types/ethers-contracts/IWorld.ts | 35 ------------------- .../factories/IWorld__factory.ts | 19 ---------- .../types/ethers-contracts/IWorld.ts | 35 ------------------- .../factories/IWorld__factory.ts | 19 ---------- 4 files changed, 108 deletions(-) diff --git a/e2e/packages/contracts/types/ethers-contracts/IWorld.ts b/e2e/packages/contracts/types/ethers-contracts/IWorld.ts index 116eb48b6d..1304448c02 100644 --- a/e2e/packages/contracts/types/ethers-contracts/IWorld.ts +++ b/e2e/packages/contracts/types/ethers-contracts/IWorld.ts @@ -70,7 +70,6 @@ export interface IWorldInterface extends utils.Interface { "setMetadata(bytes32,string,string[])": FunctionFragment; "setRecord(bytes16,bytes16,bytes32[],bytes)": FunctionFragment; "setRecord(bytes32,bytes32[],bytes)": FunctionFragment; - "storeAddress(address)": FunctionFragment; "stub(uint256)": FunctionFragment; "updateInField(bytes32,bytes32[],uint8,uint256,bytes)": FunctionFragment; "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)": FunctionFragment; @@ -118,7 +117,6 @@ export interface IWorldInterface extends utils.Interface { | "setMetadata(bytes32,string,string[])" | "setRecord(bytes16,bytes16,bytes32[],bytes)" | "setRecord(bytes32,bytes32[],bytes)" - | "storeAddress" | "stub" | "updateInField(bytes32,bytes32[],uint8,uint256,bytes)" | "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)" @@ -413,10 +411,6 @@ export interface IWorldInterface extends utils.Interface { PromiseOrValue ] ): string; - encodeFunctionData( - functionFragment: "storeAddress", - values: [PromiseOrValue] - ): string; encodeFunctionData( functionFragment: "stub", values: [PromiseOrValue] @@ -582,10 +576,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "setRecord(bytes32,bytes32[],bytes)", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "storeAddress", - data: BytesLike - ): Result; decodeFunctionResult(functionFragment: "stub", data: BytesLike): Result; decodeFunctionResult( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", @@ -974,11 +964,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string] & { storeAddress: string }>; - stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1285,11 +1270,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1594,11 +1574,6 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -1952,11 +1927,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - stub( arg: PromiseOrValue, overrides?: CallOverrides @@ -2264,11 +2234,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - stub( arg: PromiseOrValue, overrides?: CallOverrides diff --git a/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts b/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts index 1aa6fb4239..5caa2d7df6 100644 --- a/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts +++ b/e2e/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts @@ -1335,25 +1335,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - ], - name: "storeAddress", - outputs: [ - { - internalType: "address", - name: "storeAddress", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { diff --git a/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts b/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts index 019e0ec3bf..a78373b57d 100644 --- a/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts +++ b/examples/minimal/packages/contracts/types/ethers-contracts/IWorld.ts @@ -81,7 +81,6 @@ export interface IWorldInterface extends utils.Interface { "setRecord(bytes32,bytes32[],bytes)": FunctionFragment; "staticArrayBytesStruct(tuple[1])": FunctionFragment; "staticArrayStringStruct(tuple[1])": FunctionFragment; - "storeAddress(address)": FunctionFragment; "updateInField(bytes32,bytes32[],uint8,uint256,bytes)": FunctionFragment; "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)": FunctionFragment; "willRevert()": FunctionFragment; @@ -132,7 +131,6 @@ export interface IWorldInterface extends utils.Interface { | "setRecord(bytes32,bytes32[],bytes)" | "staticArrayBytesStruct" | "staticArrayStringStruct" - | "storeAddress" | "updateInField(bytes32,bytes32[],uint8,uint256,bytes)" | "updateInField(bytes16,bytes16,bytes32[],uint8,uint256,bytes)" | "willRevert" @@ -439,10 +437,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "staticArrayStringStruct", values: [[StringStructStruct]] ): string; - encodeFunctionData( - functionFragment: "storeAddress", - values: [PromiseOrValue] - ): string; encodeFunctionData( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", values: [ @@ -626,10 +620,6 @@ export interface IWorldInterface extends utils.Interface { functionFragment: "staticArrayStringStruct", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "storeAddress", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "updateInField(bytes32,bytes32[],uint8,uint256,bytes)", data: BytesLike @@ -1033,11 +1023,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string] & { storeAddress: string }>; - "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -1358,11 +1343,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -1681,11 +1661,6 @@ export interface IWorld extends BaseContract { overrides?: CallOverrides ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -2051,11 +2026,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], @@ -2377,11 +2347,6 @@ export interface IWorld extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - storeAddress( - msgSender: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - "updateInField(bytes32,bytes32[],uint8,uint256,bytes)"( table: PromiseOrValue, key: PromiseOrValue[], diff --git a/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts b/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts index 596cced1e1..4edb824fcf 100644 --- a/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts +++ b/examples/minimal/packages/contracts/types/ethers-contracts/factories/IWorld__factory.ts @@ -1370,25 +1370,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - ], - name: "storeAddress", - outputs: [ - { - internalType: "address", - name: "storeAddress", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { From 58e5e98ef41c93307e826cee0fac71a4be25a84b Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 16:48:07 +0300 Subject: [PATCH 18/25] cleanup --- packages/std-contracts/remappings.txt | 1 - packages/store/src/MudTest.sol | 4 ---- packages/store/src/StoreRead.sol | 4 ---- packages/store/test/StoreSwitch.t.sol | 2 +- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/std-contracts/remappings.txt b/packages/std-contracts/remappings.txt index 2ae565ed88..353e9cbd78 100644 --- a/packages/std-contracts/remappings.txt +++ b/packages/std-contracts/remappings.txt @@ -4,4 +4,3 @@ forge-std/=node_modules/forge-std/src/ solmate/=node_modules/solmate/src solecs/=node_modules/@latticexyz/solecs/src/ @solidstate/=node_modules/@solidstate/ -@latticexyz/=node_modules/@latticexyz/ diff --git a/packages/store/src/MudTest.sol b/packages/store/src/MudTest.sol index 384f281df8..031f44c861 100644 --- a/packages/store/src/MudTest.sol +++ b/packages/store/src/MudTest.sol @@ -11,8 +11,4 @@ contract MudTest is Test { worldAddress = vm.parseAddress(vm.readFile(".mudtest")); StoreSwitch.setStoreAddress(worldAddress); } - - function storeAddress() public view returns (address) { - return worldAddress; - } } diff --git a/packages/store/src/StoreRead.sol b/packages/store/src/StoreRead.sol index 4c3f603b2f..c668816d2f 100644 --- a/packages/store/src/StoreRead.sol +++ b/packages/store/src/StoreRead.sol @@ -60,8 +60,4 @@ contract StoreRead is IStoreRead { ) public view virtual returns (bytes memory) { return StoreCore.getFieldSlice(tableId, key, schemaIndex, schema, start, end); } - - function storeAddress() public view returns (address) { - return address(this); - } } diff --git a/packages/store/test/StoreSwitch.t.sol b/packages/store/test/StoreSwitch.t.sol index 4aebeba45d..6ed176daee 100644 --- a/packages/store/test/StoreSwitch.t.sol +++ b/packages/store/test/StoreSwitch.t.sol @@ -7,7 +7,7 @@ import { StoreCore } from "../src/StoreCore.sol"; import { StoreReadWithStubs } from "../src/StoreReadWithStubs.sol"; import { StoreSwitch } from "../src/StoreSwitch.sol"; -// Mock Store and its consumer +// Mock Store to call MockSystem contract StoreSwitchTestStore is StoreReadWithStubs { MockSystem mockSystem = new MockSystem(); From 072d16463a73cd5974fd3b33aca967579b0c4c0b Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 17:00:25 +0300 Subject: [PATCH 19/25] rebuild --- .../abi/StoreMock.sol/StoreMock.abi.json | 13 ---- .../abi/StoreRead.sol/StoreRead.abi.json | 13 ---- .../StoreReadWithStubs.abi.json | 13 ---- packages/store/gas-report.json | 6 +- .../abi/StoreRead.sol/StoreRead.abi.json | 13 ---- packages/world/abi/World.sol/World.abi.json | 13 ---- packages/world/gas-report.json | 72 +++++++++---------- 7 files changed, 39 insertions(+), 104 deletions(-) diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json b/packages/store/abi/StoreMock.sol/StoreMock.abi.json index ab8aedf4c8..dcf872c81f 100644 --- a/packages/store/abi/StoreMock.sol/StoreMock.abi.json +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json @@ -636,19 +636,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json b/packages/store/abi/StoreRead.sol/StoreRead.abi.json index aeb543231c..3e8785719d 100644 --- a/packages/store/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json @@ -307,18 +307,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json index 06b71d5c6c..380d5e6255 100644 --- a/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json +++ b/packages/store/abi/StoreReadWithStubs.sol/StoreReadWithStubs.abi.json @@ -641,19 +641,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json index bb9f555237..7993745630 100644 --- a/packages/store/gas-report.json +++ b/packages/store/gas-report.json @@ -417,7 +417,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooks", "name": "set record on table with subscriber", - "gasUsed": 74387 + "gasUsed": 74409 }, { "file": "test/StoreCoreGas.t.sol", @@ -441,7 +441,7 @@ "file": "test/StoreCoreGas.t.sol", "test": "testHooksDynamicData", "name": "set (dynamic) record on table with subscriber", - "gasUsed": 167824 + "gasUsed": 167846 }, { "file": "test/StoreCoreGas.t.sol", @@ -621,7 +621,7 @@ "file": "test/StoreMetadata.t.sol", "test": "testSetAndGet", "name": "set record in StoreMetadataTable", - "gasUsed": 251265 + "gasUsed": 251257 }, { "file": "test/StoreMetadata.t.sol", diff --git a/packages/world/abi/StoreRead.sol/StoreRead.abi.json b/packages/world/abi/StoreRead.sol/StoreRead.abi.json index aeb543231c..3e8785719d 100644 --- a/packages/world/abi/StoreRead.sol/StoreRead.abi.json +++ b/packages/world/abi/StoreRead.sol/StoreRead.abi.json @@ -307,18 +307,5 @@ ], "stateMutability": "view", "type": "function" - }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/packages/world/abi/World.sol/World.abi.json b/packages/world/abi/World.sol/World.abi.json index 4f2d3b8189..013356766d 100644 --- a/packages/world/abi/World.sol/World.abi.json +++ b/packages/world/abi/World.sol/World.abi.json @@ -824,19 +824,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "storeAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index c224b22bb4..36f0745446 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -15,7 +15,7 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "set a record on a table with keysInTableModule installed", - "gasUsed": 189048 + "gasUsed": 189004 }, { "file": "test/KeysInTableModule.t.sol", @@ -33,13 +33,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "change a composite record on a table with keysInTableModule installed", - "gasUsed": 28420 + "gasUsed": 28442 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "delete a composite record on a table with keysInTableModule installed", - "gasUsed": 269873 + "gasUsed": 270004 }, { "file": "test/KeysInTableModule.t.sol", @@ -51,25 +51,25 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "change a record on a table with keysInTableModule installed", - "gasUsed": 27034 + "gasUsed": 27056 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "delete a record on a table with keysInTableModule installed", - "gasUsed": 141223 + "gasUsed": 141266 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 606570 + "gasUsed": 606592 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "Get list of keys with a given value", - "gasUsed": 7694 + "gasUsed": 7716 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,25 +81,25 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 606570 + "gasUsed": 606592 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "set a record on a table with KeysWithValueModule installed", - "gasUsed": 162081 + "gasUsed": 162059 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 606570 + "gasUsed": 606592 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "change a record on a table with KeysWithValueModule installed", - "gasUsed": 129735 + "gasUsed": 129713 }, { "file": "test/KeysWithValueModule.t.sol", @@ -111,97 +111,97 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 606570 + "gasUsed": 606592 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "set a field on a table with KeysWithValueModule installed", - "gasUsed": 170378 + "gasUsed": 170334 }, { "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "change a field on a table with KeysWithValueModule installed", - "gasUsed": 132736 + "gasUsed": 132692 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueNotQuery", "name": "CombinedHasHasValueNotQuery", - "gasUsed": 163100 + "gasUsed": 163160 }, { "file": "test/query.t.sol", "test": "testCombinedHasHasValueQuery", "name": "CombinedHasHasValueQuery", - "gasUsed": 76965 + "gasUsed": 77029 }, { "file": "test/query.t.sol", "test": "testCombinedHasNotQuery", "name": "CombinedHasNotQuery", - "gasUsed": 222462 + "gasUsed": 222474 }, { "file": "test/query.t.sol", "test": "testCombinedHasQuery", "name": "CombinedHasQuery", - "gasUsed": 139903 + "gasUsed": 139829 }, { "file": "test/query.t.sol", "test": "testCombinedHasValueNotQuery", "name": "CombinedHasValueNotQuery", - "gasUsed": 139039 + "gasUsed": 139055 }, { "file": "test/query.t.sol", "test": "testCombinedHasValueQuery", "name": "CombinedHasValueQuery", - "gasUsed": 19577 + "gasUsed": 19621 }, { "file": "test/query.t.sol", "test": "testHasQuery", "name": "HasQuery", - "gasUsed": 31583 + "gasUsed": 31559 }, { "file": "test/query.t.sol", "test": "testHasQuery1000Keys", "name": "HasQuery with 1000 keys", - "gasUsed": 10784675 + "gasUsed": 10806607 }, { "file": "test/query.t.sol", "test": "testHasQuery100Keys", "name": "HasQuery with 100 keys", - "gasUsed": 1006878 + "gasUsed": 1009010 }, { "file": "test/query.t.sol", "test": "testHasValueQuery", "name": "HasValueQuery", - "gasUsed": 9500 + "gasUsed": 9522 }, { "file": "test/query.t.sol", "test": "testNotValueQuery", "name": "NotValueQuery", - "gasUsed": 70145 + "gasUsed": 70209 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 1 record", - "gasUsed": 39886 + "gasUsed": 39819 }, { "file": "test/SnapSyncModule.t.sol", "test": "testSnapSyncGas", "name": "Call snap sync on a table with 2 records", - "gasUsed": 57218 + "gasUsed": 57129 }, { "file": "test/UniqueEntityModule.t.sol", @@ -213,25 +213,25 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "get a unique entity nonce (non-root module)", - "gasUsed": 71077 + "gasUsed": 71099 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 769203 + "gasUsed": 769225 }, { "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "get a unique entity nonce (root module)", - "gasUsed": 71077 + "gasUsed": 71099 }, { "file": "test/World.t.sol", "test": "testDeleteRecord", "name": "Delete record", - "gasUsed": 15038 + "gasUsed": 15060 }, { "file": "test/World.t.sol", @@ -279,7 +279,7 @@ "file": "test/World.t.sol", "test": "testSetField", "name": "Write data to a table field", - "gasUsed": 43627 + "gasUsed": 43649 }, { "file": "test/World.t.sol", @@ -297,24 +297,24 @@ "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (cold)", - "gasUsed": 38951 + "gasUsed": 38906 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testPopFromField", "name": "pop 1 address (warm)", - "gasUsed": 21741 + "gasUsed": 21696 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (cold)", - "gasUsed": 41263 + "gasUsed": 41285 }, { "file": "test/WorldDynamicUpdate.t.sol", "test": "testUpdateInField", "name": "updateInField 1 item (warm)", - "gasUsed": 24465 + "gasUsed": 24487 } ] From 5001ca51bab77effef30e5e26e20ec4600dbf531 Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 21:57:44 +0300 Subject: [PATCH 20/25] Update packages/store/src/StoreSwitch.sol Co-authored-by: alvarius --- packages/store/src/StoreSwitch.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index af8e08aa5d..1681d1c64e 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -38,8 +38,7 @@ library StoreSwitch { /** * Set the Store address for use by other StoreSwitch functions. - * 0x00 is a magic number for msg.sender - * (which means that uninitialized storeAddress is msg.sender by default) + * If it stays uninitialized, StoreSwitch falls back to calling store methods on msg.sender. */ function setStoreAddress(address _storeAddress) internal { _layout().storeAddress = _storeAddress; From 4cf107c45d264ccae19c39fe4291ce7f608e02e9 Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 21:59:20 +0300 Subject: [PATCH 21/25] Update packages/store/src/StoreCore.sol Co-authored-by: alvarius --- packages/store/src/StoreCore.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/store/src/StoreCore.sol b/packages/store/src/StoreCore.sol index 7be810483b..af8a8c6b71 100644 --- a/packages/store/src/StoreCore.sol +++ b/packages/store/src/StoreCore.sol @@ -30,8 +30,9 @@ library StoreCore { * (see https://github.com/latticexyz/mud/issues/444) */ function initialize() internal { - // Use address(this) instead of msg.sender (the default) when using StoreSwitch - // from within the Store contract itself (e.g. during delegatecall) + // StoreSwitch uses the storeAddress to decide where to write data to. + // If StoreSwitch is called in the context of a Store contract (storeAddress == address(this)), + // StoreSwitch uses internal methods to write data instead of external calls. StoreSwitch.setStoreAddress(address(this)); // Register internal schema table From 65ddf91508572f57e1a1635d51b3eec8fa161a5a Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 22:12:17 +0300 Subject: [PATCH 22/25] Create selfish-cycles-retire.md --- .changeset/selfish-cycles-retire.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .changeset/selfish-cycles-retire.md diff --git a/.changeset/selfish-cycles-retire.md b/.changeset/selfish-cycles-retire.md new file mode 100644 index 0000000000..8582a7fc3f --- /dev/null +++ b/.changeset/selfish-cycles-retire.md @@ -0,0 +1,15 @@ +--- +"@latticexyz/std-contracts": minor +"@latticexyz/store": minor +"@latticexyz/world": minor +--- + +`MudV2Test` has been renamed to `MudTest` and moved to another package. +```solidity +// old import +import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; +// new import +import { MudTest } from "@latticexyz/store/src/MudTest.sol"; +``` + +StoreSwitch has been rewritten to use a storage slot instead of `function isStore()` to determine which contract is Store. From 80706ac5f0d1402ee76d55a55ff6bdcf80f4a563 Mon Sep 17 00:00:00 2001 From: dk1a Date: Mon, 17 Jul 2023 22:27:01 +0300 Subject: [PATCH 23/25] prettier --- .changeset/selfish-cycles-retire.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/selfish-cycles-retire.md b/.changeset/selfish-cycles-retire.md index 8582a7fc3f..8cf6b83fba 100644 --- a/.changeset/selfish-cycles-retire.md +++ b/.changeset/selfish-cycles-retire.md @@ -5,6 +5,7 @@ --- `MudV2Test` has been renamed to `MudTest` and moved to another package. + ```solidity // old import import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; From 12659f444f6a2925a385f7c03b2085fac77ca262 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 18 Jul 2023 13:15:35 +0300 Subject: [PATCH 24/25] Update .changeset/selfish-cycles-retire.md Co-authored-by: alvarius --- .changeset/selfish-cycles-retire.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/selfish-cycles-retire.md b/.changeset/selfish-cycles-retire.md index 8cf6b83fba..0210d879d4 100644 --- a/.changeset/selfish-cycles-retire.md +++ b/.changeset/selfish-cycles-retire.md @@ -4,7 +4,7 @@ "@latticexyz/world": minor --- -`MudV2Test` has been renamed to `MudTest` and moved to another package. +Rename `MudV2Test` to `MudTest` and move from `@latticexyz/std-contracts` to `@latticexyz/store`. ```solidity // old import From b6068a18b807736ad2d41cc642cbc8556598e5f5 Mon Sep 17 00:00:00 2001 From: dk1a Date: Tue, 18 Jul 2023 13:17:02 +0300 Subject: [PATCH 25/25] Update .changeset/selfish-cycles-retire.md Co-authored-by: alvarius --- .changeset/selfish-cycles-retire.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.changeset/selfish-cycles-retire.md b/.changeset/selfish-cycles-retire.md index 0210d879d4..e00c8d3b07 100644 --- a/.changeset/selfish-cycles-retire.md +++ b/.changeset/selfish-cycles-retire.md @@ -13,4 +13,11 @@ import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; import { MudTest } from "@latticexyz/store/src/MudTest.sol"; ``` -StoreSwitch has been rewritten to use a storage slot instead of `function isStore()` to determine which contract is Store. +Refactor `StoreSwitch` to use a storage slot instead of `function isStore()` to determine which contract is Store: + +- Previously `StoreSwitch` called `isStore()` on `msg.sender` to determine if `msg.sender` is a `Store` contract. If the call succeeded, the `Store` methods were called on `msg.sender`, otherwise the data was written to the own storage. +- With this change `StoreSwitch` instead checks for an `address` in a known storage slot. If the address equals the own address, data is written to the own storage. If it is an external address, `Store` methods are called on this address. If it is unset (`address(0)`), store methods are called on `msg.sender`. +- In practice this has the same effect as before: By default the `World` contracts sets its own address in `StoreSwitch`, while `System` contracts keep the Store address undefined, so `Systems` write to their caller (`World`) if they are executed via `call` or directly to the `World` storage if they are executed via `delegatecall`. +- Besides gas savings, this change has two additional benefits: + 1. it is now possible for `Systems` to explicitly set a `Store` address to make them exclusive to that `Store` and + 2. table libraries can now be used in tests without having to provide an explicit `Store` argument, because the `MudTest` base contract redirects reads and writes to the internal `World` contract.