From b2b5cd3cc771483512dc164c1faceb225f3a65d9 Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Wed, 18 Dec 2024 18:43:27 +0300 Subject: [PATCH 1/7] 7779 bases management + use in MSA --- package.json | 3 ++- src/MSAAdvanced.sol | 5 ++-- src/core/ERC7779Adapter.sol | 32 +++++++++++++++++++--- test/core/TestFuzz_ERC7779Adapter.t.sol | 35 +++++++++++++++++++++++++ test/mocks/MockERC7779.sol | 12 +++++++++ 5 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 test/core/TestFuzz_ERC7779Adapter.t.sol create mode 100644 test/mocks/MockERC7779.sol diff --git a/package.json b/package.json index 1690b99..5b2fc0a 100644 --- a/package.json +++ b/package.json @@ -53,5 +53,6 @@ ], "publishConfig": { "access": "public" - } + }, + "packageManager": "pnpm@9.14.1+sha512.7f1de9cffea40ff4594c48a94776112a0db325e81fb18a9400362ff7b7247f4fbd76c3011611c9f8ac58743c3dc526017894e07948de9b72052f874ee2edfdcd" } diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index 7eb6587..bb1f2c3 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -254,7 +254,7 @@ contract MSAAdvanced is if (signer != address(this)) { return VALIDATION_FAILED; } - + _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); return VALIDATION_SUCCESS; } else { return VALIDATION_FAILED; @@ -369,7 +369,8 @@ contract MSAAdvanced is // checks if already initialized and reverts before setting the state to initialized _initModuleManager(); - + _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); + // bootstrap the account (address bootstrap, bytes memory bootstrapCall) = abi.decode(data, (address, bytes)); _initAccount(bootstrap, bootstrapCall); diff --git a/src/core/ERC7779Adapter.sol b/src/core/ERC7779Adapter.sol index 1304fb3..b91ba35 100644 --- a/src/core/ERC7779Adapter.sol +++ b/src/core/ERC7779Adapter.sol @@ -1,7 +1,16 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.23; +pragma solidity ^0.8.27; abstract contract ERC7779Adapter { + error NonAuthorizedOnRedelegationCaller(); + + // keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - 1)) & ~bytes32(uint256(0xff)); + bytes32 internal constant ERC7779_STORAGE_BASE = 0xc473de86d0138e06e4d4918a106463a7cc005258d2e21915272bcb4594c18900; + + struct ERC7779Storage { + bytes32[] storageBases; + } + /* * @dev Externally shares the storage bases that has been used throughout the account. * Majority of 7702 accounts will have their distinctive storage base to reduce the @@ -16,7 +25,21 @@ abstract contract ERC7779Adapter { storage at this slot, but just append their base to the array. * This append operation should be done during the initialization of the account. */ - function accountStorageBases() external view returns (bytes32[] memory) { } + function accountStorageBases() external view returns (bytes32[] memory) { + ERC7779Storage storage $; + assembly { + $.slot := ERC7779_STORAGE_BASE + } + return $.storageBases; + } + + function _addStorageBase(bytes32 storageBase) internal { + ERC7779Storage storage $; + assembly { + $.slot := ERC7779_STORAGE_BASE + } + $.storageBases.push(storageBase); + } /* * @dev Function called before redelegation. @@ -28,9 +51,10 @@ abstract contract ERC7779Adapter { for redelegation. * msg.sender should be the owner of the account. */ - function onRedelegation() external pure returns (bool) { + function onRedelegation() external returns (bool) { + require(msg.sender == address(this), NonAuthorizedOnRedelegationCaller()); // this is not implemented at the moment so that the account can preserve state across // delegations return true; } -} +} \ No newline at end of file diff --git a/test/core/TestFuzz_ERC7779Adapter.t.sol b/test/core/TestFuzz_ERC7779Adapter.t.sol new file mode 100644 index 0000000..5cdebe5 --- /dev/null +++ b/test/core/TestFuzz_ERC7779Adapter.t.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.27; + +import { MockERC7779 } from "../mocks/MockERC7779.sol"; +import "forge-std/Test.sol"; + +/// @title TestFuzz_ERC7779Adapter +/// @notice Tests the ERC7779Adapter contract +contract TestFuzz_ERC7779Adapter is Test { + MockERC7779 private mockERC7779; + + function setUp() public { + mockERC7779 = new MockERC7779(); + //bytes32 erc7779StorageBase = keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - 1)) & ~bytes32(uint256(0xff)); + //console.logBytes32(erc7779StorageBase); + } + + function test_Fuzz_ERC7779Adapter_AddStorageBases(uint256 amountOfBases) public { + vm.assume(amountOfBases > 0 && amountOfBases < 100); + bytes32[] memory expectedStorageBases = new bytes32[](amountOfBases); + + for (uint256 i = 0; i < amountOfBases; i++) { + bytes32 storageBase = bytes32(uint256(i)); + expectedStorageBases[i] = storageBase; + mockERC7779.addStorageBase(storageBase); + } + + bytes32[] memory retrievedStorageBases = mockERC7779.accountStorageBases(); + assertEq(retrievedStorageBases.length, amountOfBases); + for (uint256 i = 0; i < amountOfBases; i++) { + assertEq(retrievedStorageBases[i], expectedStorageBases[i]); + } + } +} + diff --git a/test/mocks/MockERC7779.sol b/test/mocks/MockERC7779.sol new file mode 100644 index 0000000..a813912 --- /dev/null +++ b/test/mocks/MockERC7779.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.27; + +import { ERC7779Adapter } from "src/core/ERC7779Adapter.sol"; + +contract MockERC7779 is ERC7779Adapter { + + function addStorageBase(bytes32 storageBase) external { + _addStorageBase(storageBase); + } + +} From dafb83dd86fe1c547776fcb1ca3565b78707b93e Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Thu, 19 Dec 2024 14:48:36 +0300 Subject: [PATCH 2/7] clean package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 5b2fc0a..1690b99 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,5 @@ ], "publishConfig": { "access": "public" - }, - "packageManager": "pnpm@9.14.1+sha512.7f1de9cffea40ff4594c48a94776112a0db325e81fb18a9400362ff7b7247f4fbd76c3011611c9f8ac58743c3dc526017894e07948de9b72052f874ee2edfdcd" + } } From c9e07a7af9bcfd6497ed47ee63b9be9c3654d325 Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Thu, 19 Dec 2024 15:00:16 +0300 Subject: [PATCH 3/7] rm _addBase from using w/o module flow --- src/MSAAdvanced.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index bb1f2c3..840e9b8 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -254,7 +254,6 @@ contract MSAAdvanced is if (signer != address(this)) { return VALIDATION_FAILED; } - _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); return VALIDATION_SUCCESS; } else { return VALIDATION_FAILED; @@ -370,7 +369,8 @@ contract MSAAdvanced is // checks if already initialized and reverts before setting the state to initialized _initModuleManager(); _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); - + _addStorageBase(HOOKMANAGER_STORAGE_LOCATION); + // bootstrap the account (address bootstrap, bytes memory bootstrapCall) = abi.decode(data, (address, bytes)); _initAccount(bootstrap, bootstrapCall); From fe0f49a51d9be73c48d3aae91f1d46110d733053 Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Fri, 20 Dec 2024 13:57:11 +0300 Subject: [PATCH 4/7] apply 7779 for 7702 only --- src/MSAAdvanced.sol | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index 840e9b8..7e68444 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -368,8 +368,17 @@ contract MSAAdvanced is // checks if already initialized and reverts before setting the state to initialized _initModuleManager(); - _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); - _addStorageBase(HOOKMANAGER_STORAGE_LOCATION); + bool isERC7702; + assembly { + isERC7702 := eq( + extcodehash(address()), + 0xeadcdba66a79ab5dce91622d1d75c8cff5cff0b96944c3bf1072cd08ce018329 // (keccak256(0xef01)) + ) + } + if (isERC7702) { + _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); + _addStorageBase(HOOKMANAGER_STORAGE_LOCATION); + } // bootstrap the account (address bootstrap, bytes memory bootstrapCall) = abi.decode(data, (address, bytes)); From e999763a6f4f276a35c7b3c05df4d5d21e061f72 Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Mon, 23 Dec 2024 11:48:10 +0300 Subject: [PATCH 5/7] lint --- package.json | 5 +- pnpm-lock.yaml | 235 ++++++++++++++++++------ src/MSAAdvanced.sol | 9 +- src/core/ERC7779Adapter.sol | 10 +- test/core/TestFuzz_ERC7779Adapter.t.sol | 5 +- test/mocks/MockERC7779.sol | 2 - 6 files changed, 196 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 1690b99..fb382cc 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "solady": "github:vectorized/solady" }, "devDependencies": { - "solhint": "^5.0.1" + "solhint": "^5.0.3" }, "files": [ "src", @@ -53,5 +53,6 @@ ], "publishConfig": { "access": "public" - } + }, + "packageManager": "pnpm@9.14.1+sha512.7f1de9cffea40ff4594c48a94776112a0db325e81fb18a9400362ff7b7247f4fbd76c3011611c9f8ac58743c3dc526017894e07948de9b72052f874ee2edfdcd" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bb9f05..53900a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,8 +25,8 @@ importers: version: https://codeload.github.com/vectorized/solady/tar.gz/cfa9a7392bc2d85659788bb99c420fb326dde24e devDependencies: solhint: - specifier: ^5.0.1 - version: 5.0.1(typescript@4.9.5) + specifier: ^5.0.3 + version: 5.0.3(typescript@4.9.5) packages: @@ -174,36 +174,36 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nomicfoundation/edr-darwin-arm64@0.4.0': - resolution: {integrity: sha512-7+rraFk9tCqvfemv9Ita5vTlSBAeO/S5aDKOgGRgYt0JEKZlrX161nDW6UfzMPxWl9GOLEDUzCEaYuNmXseUlg==} + '@nomicfoundation/edr-darwin-arm64@0.4.2': + resolution: {integrity: sha512-S+hhepupfqpBvMa9M1PVS08sVjGXsLnjyAsjhrrsjsNuTHVLhKzhkguvBD5g4If5skrwgOaVqpag4wnQbd15kQ==} engines: {node: '>= 18'} - '@nomicfoundation/edr-darwin-x64@0.4.0': - resolution: {integrity: sha512-+Hrc0mP9L6vhICJSfyGo/2taOToy1AIzVZawO3lU8Lf7oDQXfhQ4UkZnkWAs9SVu1eUwHUGGGE0qB8644piYgg==} + '@nomicfoundation/edr-darwin-x64@0.4.2': + resolution: {integrity: sha512-/zM94AUrXz6CmcsecRNHJ50jABDUFafmGc4iBmkfX/mTp4tVZj7XTyIogrQIt0FnTaeb4CgZoLap2+8tW/Uldg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-gnu@0.4.0': - resolution: {integrity: sha512-4HUDMchNClQrVRfVTqBeSX92hM/3khCgpZkXP52qrnJPqgbdCxosOehlQYZ65wu0b/kaaZSyvACgvCLSQ5oSzQ==} + '@nomicfoundation/edr-linux-arm64-gnu@0.4.2': + resolution: {integrity: sha512-TV3Pr2tFvvmCfPCi9PaCGLtqn+oLaPKfL2NWpnoCeFFdzDQXi2L930yP1oUPY5RXd78NLdVHMkEkbhb2b6Wuvg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-musl@0.4.0': - resolution: {integrity: sha512-D4J935ZRL8xfnP3zIFlCI9jXInJ0loDUkCTLeCEbOf2uuDumWDghKNQlF1itUS+EHaR1pFVBbuwqq8hVK0dASg==} + '@nomicfoundation/edr-linux-arm64-musl@0.4.2': + resolution: {integrity: sha512-PALwrLBk1M9rolXyhSX8xdhe5jL0qf/PgiCIF7W7lUyVKrI/I0oiU0EHDk/Xw7yi2UJg4WRyhhZoHYa0g4g8Qg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-gnu@0.4.0': - resolution: {integrity: sha512-6x7HPy+uN5Cb9N77e2XMmT6+QSJ+7mRbHnhkGJ8jm4cZvWuj2Io7npOaeHQ3YHK+TiQpTnlbkjoOIpEwpY3XZA==} + '@nomicfoundation/edr-linux-x64-gnu@0.4.2': + resolution: {integrity: sha512-5svkftypDjAZ1LxV1onojlaqPRxrTEjJLkrUwLL+Fao5ZMe7aTnk5QQ1Jv76gW6WYZnMXNgjPhRcnw3oSNrqFA==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-musl@0.4.0': - resolution: {integrity: sha512-3HFIJSXgyubOiaN4MWGXx2xhTnhwlJk0PiSYNf9+L/fjBtcRkb2nM910ZJHTvqCb6OT98cUnaKuAYdXIW2amgw==} + '@nomicfoundation/edr-linux-x64-musl@0.4.2': + resolution: {integrity: sha512-qiMlXQTggdH9zfOB4Eil4rQ95z8s7QdLJcOfz5Aym12qJNkCyF9hi4cc4dDCWA0CdI3x3oLbuf8qb81SF8R45w==} engines: {node: '>= 18'} - '@nomicfoundation/edr-win32-x64-msvc@0.4.0': - resolution: {integrity: sha512-CP4GsllEfXEz+lidcGYxKe5rDJ60TM5/blB5z/04ELVvw6/CK9eLcYeku7HV0jvV7VE6dADYKSdQyUkvd0El+A==} + '@nomicfoundation/edr-win32-x64-msvc@0.4.2': + resolution: {integrity: sha512-hDkAb0iaMmGYwBY/rA1oCX8VpsezfQcHPEPIEGXEcWC3WbnOgIZo0Qkpu/g0OMtFOJSQlWLXvKZuV7blhnrQag==} engines: {node: '>= 18'} - '@nomicfoundation/edr@0.4.0': - resolution: {integrity: sha512-T96DMSogO8TCdbKKctvxfsDljbhFOUKWc9fHJhSeUh71EEho2qR4951LKQF7t7UWEzguVYh/idQr5L/E3QeaMw==} + '@nomicfoundation/edr@0.4.2': + resolution: {integrity: sha512-U7v0HuZHfrsl/5FpUzuB2FYA0+FUglHHwiO6NhvLtNYKMZcPzdS6iUriMp/7GWs0SVxW3bAht9GinZPxdhVwWg==} engines: {node: '>= 18'} '@nomicfoundation/ethereumjs-common@4.0.4': @@ -292,6 +292,9 @@ packages: '@scure/base@1.1.7': resolution: {integrity: sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==} + '@scure/base@1.1.9': + resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} + '@scure/bip32@1.1.5': resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} @@ -359,6 +362,9 @@ packages: '@types/bn.js@5.1.5': resolution: {integrity: sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==} + '@types/bn.js@5.1.6': + resolution: {integrity: sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -383,6 +389,9 @@ packages: '@types/node@20.14.8': resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} + '@types/node@22.10.2': + resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/pbkdf2@3.1.2': resolution: {integrity: sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==} @@ -528,6 +537,9 @@ packages: bn.js@4.12.0: resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + bn.js@4.12.1: + resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==} + bn.js@5.2.1: resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} @@ -704,6 +716,15 @@ packages: supports-color: optional: true + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} @@ -739,6 +760,10 @@ packages: resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} engines: {node: '>=0.3.1'} + diff@5.2.0: + resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} + engines: {node: '>=0.3.1'} + difflib@0.2.4: resolution: {integrity: sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==} @@ -756,6 +781,9 @@ packages: elliptic@6.5.5: resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==} + elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -830,6 +858,7 @@ packages: ethereumjs-abi@0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} + deprecated: This library has been deprecated and usage is discouraged. ethereumjs-util@6.2.1: resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} @@ -906,6 +935,15 @@ packages: debug: optional: true + follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0: resolution: {tarball: https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0} version: 1.8.2 @@ -1106,8 +1144,8 @@ packages: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} - immutable@4.3.6: - resolution: {integrity: sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==} + immutable@4.3.7: + resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -1346,6 +1384,11 @@ packages: engines: {node: '>= 14.0.0'} hasBin: true + mocha@10.8.2: + resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} + engines: {node: '>= 14.0.0'} + hasBin: true + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -1636,6 +1679,9 @@ packages: serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -1676,8 +1722,8 @@ packages: engines: {node: '>=8.0.0'} hasBin: true - solhint@5.0.1: - resolution: {integrity: sha512-QeQLS9HGCnIiibt+xiOa/+MuP7BWz9N7C5+Mj9pLHshdkNhuo3AzCpWmjfWVZBUuwIUO3YyCRVIcYLR3YOKGfg==} + solhint@5.0.3: + resolution: {integrity: sha512-OLCH6qm/mZTCpplTXzXTJGId1zrtNuDYP5c2e6snIv/hdRVxPfBBz/bAlL91bY/Accavkayp2Zp2BaDSrLVXTQ==} hasBin: true solidity-coverage@0.8.12: @@ -1832,6 +1878,9 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + undici@5.28.4: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} @@ -1889,6 +1938,9 @@ packages: workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} + workerpool@6.5.1: + resolution: {integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -1928,6 +1980,10 @@ packages: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} @@ -2257,29 +2313,29 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nomicfoundation/edr-darwin-arm64@0.4.0': {} + '@nomicfoundation/edr-darwin-arm64@0.4.2': {} - '@nomicfoundation/edr-darwin-x64@0.4.0': {} + '@nomicfoundation/edr-darwin-x64@0.4.2': {} - '@nomicfoundation/edr-linux-arm64-gnu@0.4.0': {} + '@nomicfoundation/edr-linux-arm64-gnu@0.4.2': {} - '@nomicfoundation/edr-linux-arm64-musl@0.4.0': {} + '@nomicfoundation/edr-linux-arm64-musl@0.4.2': {} - '@nomicfoundation/edr-linux-x64-gnu@0.4.0': {} + '@nomicfoundation/edr-linux-x64-gnu@0.4.2': {} - '@nomicfoundation/edr-linux-x64-musl@0.4.0': {} + '@nomicfoundation/edr-linux-x64-musl@0.4.2': {} - '@nomicfoundation/edr-win32-x64-msvc@0.4.0': {} + '@nomicfoundation/edr-win32-x64-msvc@0.4.2': {} - '@nomicfoundation/edr@0.4.0': + '@nomicfoundation/edr@0.4.2': dependencies: - '@nomicfoundation/edr-darwin-arm64': 0.4.0 - '@nomicfoundation/edr-darwin-x64': 0.4.0 - '@nomicfoundation/edr-linux-arm64-gnu': 0.4.0 - '@nomicfoundation/edr-linux-arm64-musl': 0.4.0 - '@nomicfoundation/edr-linux-x64-gnu': 0.4.0 - '@nomicfoundation/edr-linux-x64-musl': 0.4.0 - '@nomicfoundation/edr-win32-x64-msvc': 0.4.0 + '@nomicfoundation/edr-darwin-arm64': 0.4.2 + '@nomicfoundation/edr-darwin-x64': 0.4.2 + '@nomicfoundation/edr-linux-arm64-gnu': 0.4.2 + '@nomicfoundation/edr-linux-arm64-musl': 0.4.2 + '@nomicfoundation/edr-linux-x64-gnu': 0.4.2 + '@nomicfoundation/edr-linux-x64-musl': 0.4.2 + '@nomicfoundation/edr-win32-x64-msvc': 0.4.2 '@nomicfoundation/ethereumjs-common@4.0.4': dependencies: @@ -2366,11 +2422,13 @@ snapshots: '@scure/base@1.1.7': {} + '@scure/base@1.1.9': {} + '@scure/bip32@1.1.5': dependencies: '@noble/hashes': 1.2.0 '@noble/secp256k1': 1.7.1 - '@scure/base': 1.1.7 + '@scure/base': 1.1.9 '@scure/bip32@1.4.0': dependencies: @@ -2381,7 +2439,7 @@ snapshots: '@scure/bip39@1.1.1': dependencies: '@noble/hashes': 1.2.0 - '@scure/base': 1.1.7 + '@scure/base': 1.1.9 '@scure/bip39@1.3.0': dependencies: @@ -2462,12 +2520,16 @@ snapshots: '@types/bn.js@4.11.6': dependencies: - '@types/node': 20.14.8 + '@types/node': 22.10.2 '@types/bn.js@5.1.5': dependencies: '@types/node': 20.14.8 + '@types/bn.js@5.1.6': + dependencies: + '@types/node': 22.10.2 + '@types/debug@4.1.12': dependencies: '@types/ms': 0.7.34 @@ -2491,6 +2553,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@22.10.2': + dependencies: + undici-types: 6.20.0 + '@types/pbkdf2@3.1.2': dependencies: '@types/node': 20.14.8 @@ -2540,7 +2606,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.5 + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -2645,6 +2711,8 @@ snapshots: bn.js@4.12.0: {} + bn.js@4.12.1: {} + bn.js@5.2.1: {} boxen@5.1.2: @@ -2856,6 +2924,12 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.4.0(supports-color@8.1.1): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 + decamelize@4.0.0: {} decompress-response@6.0.0: @@ -2880,6 +2954,8 @@ snapshots: diff@5.0.0: {} + diff@5.2.0: {} + difflib@0.2.4: dependencies: heap: 0.2.7 @@ -2910,6 +2986,16 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 + elliptic@6.6.1: + dependencies: + bn.js: 4.12.1 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + emoji-regex@8.0.0: {} encode-utf8@1.0.3: {} @@ -2992,15 +3078,15 @@ snapshots: ethereumjs-abi@0.6.8: dependencies: - bn.js: 4.12.0 + bn.js: 4.12.1 ethereumjs-util: 6.2.1 ethereumjs-util@6.2.1: dependencies: '@types/bn.js': 4.11.6 - bn.js: 4.12.0 + bn.js: 4.12.1 create-hash: 1.2.0 - elliptic: 6.5.5 + elliptic: 6.6.1 ethereum-cryptography: 0.1.3 ethjs-util: 0.1.6 rlp: 2.2.7 @@ -3123,6 +3209,10 @@ snapshots: optionalDependencies: debug: 4.3.5 + follow-redirects@1.15.9(debug@4.4.0): + optionalDependencies: + debug: 4.4.0(supports-color@8.1.1) + forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0: {} form-data-encoder@2.1.4: {} @@ -3322,13 +3412,13 @@ snapshots: dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/edr': 0.4.0 + '@nomicfoundation/edr': 0.4.2 '@nomicfoundation/ethereumjs-common': 4.0.4 '@nomicfoundation/ethereumjs-tx': 5.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 '@nomicfoundation/solidity-analyzer': 0.1.2 '@sentry/node': 5.30.0 - '@types/bn.js': 5.1.5 + '@types/bn.js': 5.1.6 '@types/lru-cache': 5.1.1 adm-zip: 0.4.16 aggregate-error: 3.1.0 @@ -3337,7 +3427,7 @@ snapshots: chalk: 2.4.2 chokidar: 3.6.0 ci-info: 2.0.0 - debug: 4.3.5 + debug: 4.4.0(supports-color@8.1.1) enquirer: 2.4.1 env-paths: 2.2.1 ethereum-cryptography: 1.2.0 @@ -3346,17 +3436,17 @@ snapshots: fp-ts: 1.19.3 fs-extra: 7.0.1 glob: 7.2.0 - immutable: 4.3.6 + immutable: 4.3.7 io-ts: 1.10.4 keccak: 3.0.4 lodash: 4.17.21 mnemonist: 0.38.5 - mocha: 10.4.0 + mocha: 10.8.2 p-map: 4.0.0 raw-body: 2.5.2 resolve: 1.17.0 semver: 6.3.1 - solc: 0.7.3(debug@4.3.5) + solc: 0.7.3(debug@4.4.0) source-map-support: 0.5.21 stacktrace-parser: 0.1.10 tsort: 0.0.1 @@ -3428,7 +3518,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.5 + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -3438,7 +3528,7 @@ snapshots: ignore@5.3.1: {} - immutable@4.3.6: {} + immutable@4.3.7: {} import-fresh@3.3.0: dependencies: @@ -3662,6 +3752,29 @@ snapshots: yargs-parser: 20.2.4 yargs-unparser: 2.0.0 + mocha@10.8.2: + dependencies: + ansi-colors: 4.1.3 + browser-stdout: 1.3.1 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@8.1.1) + diff: 5.2.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 8.1.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.1.6 + ms: 2.1.3 + serialize-javascript: 6.0.2 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.5.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + yargs-unparser: 2.0.0 + ms@2.1.2: {} ms@2.1.3: {} @@ -3930,6 +4043,10 @@ snapshots: dependencies: randombytes: 2.1.0 + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -3971,11 +4088,11 @@ snapshots: solady@https://codeload.github.com/vectorized/solady/tar.gz/cfa9a7392bc2d85659788bb99c420fb326dde24e: {} - solc@0.7.3(debug@4.3.5): + solc@0.7.3(debug@4.4.0): dependencies: command-exists: 1.2.9 commander: 3.0.2 - follow-redirects: 1.15.6(debug@4.3.5) + follow-redirects: 1.15.9(debug@4.4.0) fs-extra: 0.30.0 js-sha3: 0.8.0 memorystream: 0.3.1 @@ -3985,7 +4102,7 @@ snapshots: transitivePeerDependencies: - debug - solhint@5.0.1(typescript@4.9.5): + solhint@5.0.3(typescript@4.9.5): dependencies: '@solidity-parser/parser': 0.18.0 ajv: 6.12.6 @@ -4146,7 +4263,7 @@ snapshots: dependencies: '@types/prettier': 2.7.3 command-line-args: 4.0.7 - debug: 4.3.5 + debug: 4.4.0(supports-color@8.1.1) fs-extra: 7.0.1 glob: 7.2.3 js-sha3: 0.8.0 @@ -4167,6 +4284,8 @@ snapshots: undici-types@5.26.5: {} + undici-types@6.20.0: {} + undici@5.28.4: dependencies: '@fastify/busboy': 2.1.1 @@ -4219,6 +4338,8 @@ snapshots: workerpool@6.2.1: {} + workerpool@6.5.1: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -4235,6 +4356,8 @@ snapshots: yargs-parser@20.2.4: {} + yargs-parser@20.2.9: {} + yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index 7e68444..f4bb174 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -370,10 +370,11 @@ contract MSAAdvanced is _initModuleManager(); bool isERC7702; assembly { - isERC7702 := eq( - extcodehash(address()), - 0xeadcdba66a79ab5dce91622d1d75c8cff5cff0b96944c3bf1072cd08ce018329 // (keccak256(0xef01)) - ) + isERC7702 := + eq( + extcodehash(address()), + 0xeadcdba66a79ab5dce91622d1d75c8cff5cff0b96944c3bf1072cd08ce018329 // (keccak256(0xef01)) + ) } if (isERC7702) { _addStorageBase(MODULEMANAGER_STORAGE_LOCATION); diff --git a/src/core/ERC7779Adapter.sol b/src/core/ERC7779Adapter.sol index b91ba35..b28bdc0 100644 --- a/src/core/ERC7779Adapter.sol +++ b/src/core/ERC7779Adapter.sol @@ -4,13 +4,14 @@ pragma solidity ^0.8.27; abstract contract ERC7779Adapter { error NonAuthorizedOnRedelegationCaller(); - // keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - 1)) & ~bytes32(uint256(0xff)); - bytes32 internal constant ERC7779_STORAGE_BASE = 0xc473de86d0138e06e4d4918a106463a7cc005258d2e21915272bcb4594c18900; + // keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - + // 1)) & ~bytes32(uint256(0xff)); + bytes32 internal constant ERC7779_STORAGE_BASE = + 0xc473de86d0138e06e4d4918a106463a7cc005258d2e21915272bcb4594c18900; struct ERC7779Storage { bytes32[] storageBases; } - /* * @dev Externally shares the storage bases that has been used throughout the account. * Majority of 7702 accounts will have their distinctive storage base to reduce the @@ -25,6 +26,7 @@ abstract contract ERC7779Adapter { storage at this slot, but just append their base to the array. * This append operation should be done during the initialization of the account. */ + function accountStorageBases() external view returns (bytes32[] memory) { ERC7779Storage storage $; assembly { @@ -57,4 +59,4 @@ abstract contract ERC7779Adapter { // delegations return true; } -} \ No newline at end of file +} diff --git a/test/core/TestFuzz_ERC7779Adapter.t.sol b/test/core/TestFuzz_ERC7779Adapter.t.sol index 5cdebe5..934a407 100644 --- a/test/core/TestFuzz_ERC7779Adapter.t.sol +++ b/test/core/TestFuzz_ERC7779Adapter.t.sol @@ -11,7 +11,9 @@ contract TestFuzz_ERC7779Adapter is Test { function setUp() public { mockERC7779 = new MockERC7779(); - //bytes32 erc7779StorageBase = keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - 1)) & ~bytes32(uint256(0xff)); + //bytes32 erc7779StorageBase = + // keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) + // - 1)) & ~bytes32(uint256(0xff)); //console.logBytes32(erc7779StorageBase); } @@ -32,4 +34,3 @@ contract TestFuzz_ERC7779Adapter is Test { } } } - diff --git a/test/mocks/MockERC7779.sol b/test/mocks/MockERC7779.sol index a813912..ffe4560 100644 --- a/test/mocks/MockERC7779.sol +++ b/test/mocks/MockERC7779.sol @@ -4,9 +4,7 @@ pragma solidity ^0.8.27; import { ERC7779Adapter } from "src/core/ERC7779Adapter.sol"; contract MockERC7779 is ERC7779Adapter { - function addStorageBase(bytes32 storageBase) external { _addStorageBase(storageBase); } - } From e0a663b163eec2e15abdf787b9ad0ce5e7c3b7bd Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Mon, 23 Dec 2024 11:57:52 +0300 Subject: [PATCH 6/7] clean --- .npmrc | 3 +- package.json | 3 +- pnpm-lock.yaml | 237 ++++++++++++------------------------------------- 3 files changed, 60 insertions(+), 183 deletions(-) diff --git a/.npmrc b/.npmrc index c483022..77a286f 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ -shamefully-hoist=true \ No newline at end of file +shamefully-hoist=true +package-manager-strict=false \ No newline at end of file diff --git a/package.json b/package.json index fb382cc..3219b69 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,5 @@ ], "publishConfig": { "access": "public" - }, - "packageManager": "pnpm@9.14.1+sha512.7f1de9cffea40ff4594c48a94776112a0db325e81fb18a9400362ff7b7247f4fbd76c3011611c9f8ac58743c3dc526017894e07948de9b72052f874ee2edfdcd" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53900a9..4720a52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,8 +25,8 @@ importers: version: https://codeload.github.com/vectorized/solady/tar.gz/cfa9a7392bc2d85659788bb99c420fb326dde24e devDependencies: solhint: - specifier: ^5.0.3 - version: 5.0.3(typescript@4.9.5) + specifier: ^5.0.1 + version: 5.0.1(typescript@4.9.5) packages: @@ -174,36 +174,36 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nomicfoundation/edr-darwin-arm64@0.4.2': - resolution: {integrity: sha512-S+hhepupfqpBvMa9M1PVS08sVjGXsLnjyAsjhrrsjsNuTHVLhKzhkguvBD5g4If5skrwgOaVqpag4wnQbd15kQ==} + '@nomicfoundation/edr-darwin-arm64@0.4.0': + resolution: {integrity: sha512-7+rraFk9tCqvfemv9Ita5vTlSBAeO/S5aDKOgGRgYt0JEKZlrX161nDW6UfzMPxWl9GOLEDUzCEaYuNmXseUlg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-darwin-x64@0.4.2': - resolution: {integrity: sha512-/zM94AUrXz6CmcsecRNHJ50jABDUFafmGc4iBmkfX/mTp4tVZj7XTyIogrQIt0FnTaeb4CgZoLap2+8tW/Uldg==} + '@nomicfoundation/edr-darwin-x64@0.4.0': + resolution: {integrity: sha512-+Hrc0mP9L6vhICJSfyGo/2taOToy1AIzVZawO3lU8Lf7oDQXfhQ4UkZnkWAs9SVu1eUwHUGGGE0qB8644piYgg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-gnu@0.4.2': - resolution: {integrity: sha512-TV3Pr2tFvvmCfPCi9PaCGLtqn+oLaPKfL2NWpnoCeFFdzDQXi2L930yP1oUPY5RXd78NLdVHMkEkbhb2b6Wuvg==} + '@nomicfoundation/edr-linux-arm64-gnu@0.4.0': + resolution: {integrity: sha512-4HUDMchNClQrVRfVTqBeSX92hM/3khCgpZkXP52qrnJPqgbdCxosOehlQYZ65wu0b/kaaZSyvACgvCLSQ5oSzQ==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-musl@0.4.2': - resolution: {integrity: sha512-PALwrLBk1M9rolXyhSX8xdhe5jL0qf/PgiCIF7W7lUyVKrI/I0oiU0EHDk/Xw7yi2UJg4WRyhhZoHYa0g4g8Qg==} + '@nomicfoundation/edr-linux-arm64-musl@0.4.0': + resolution: {integrity: sha512-D4J935ZRL8xfnP3zIFlCI9jXInJ0loDUkCTLeCEbOf2uuDumWDghKNQlF1itUS+EHaR1pFVBbuwqq8hVK0dASg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-gnu@0.4.2': - resolution: {integrity: sha512-5svkftypDjAZ1LxV1onojlaqPRxrTEjJLkrUwLL+Fao5ZMe7aTnk5QQ1Jv76gW6WYZnMXNgjPhRcnw3oSNrqFA==} + '@nomicfoundation/edr-linux-x64-gnu@0.4.0': + resolution: {integrity: sha512-6x7HPy+uN5Cb9N77e2XMmT6+QSJ+7mRbHnhkGJ8jm4cZvWuj2Io7npOaeHQ3YHK+TiQpTnlbkjoOIpEwpY3XZA==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-musl@0.4.2': - resolution: {integrity: sha512-qiMlXQTggdH9zfOB4Eil4rQ95z8s7QdLJcOfz5Aym12qJNkCyF9hi4cc4dDCWA0CdI3x3oLbuf8qb81SF8R45w==} + '@nomicfoundation/edr-linux-x64-musl@0.4.0': + resolution: {integrity: sha512-3HFIJSXgyubOiaN4MWGXx2xhTnhwlJk0PiSYNf9+L/fjBtcRkb2nM910ZJHTvqCb6OT98cUnaKuAYdXIW2amgw==} engines: {node: '>= 18'} - '@nomicfoundation/edr-win32-x64-msvc@0.4.2': - resolution: {integrity: sha512-hDkAb0iaMmGYwBY/rA1oCX8VpsezfQcHPEPIEGXEcWC3WbnOgIZo0Qkpu/g0OMtFOJSQlWLXvKZuV7blhnrQag==} + '@nomicfoundation/edr-win32-x64-msvc@0.4.0': + resolution: {integrity: sha512-CP4GsllEfXEz+lidcGYxKe5rDJ60TM5/blB5z/04ELVvw6/CK9eLcYeku7HV0jvV7VE6dADYKSdQyUkvd0El+A==} engines: {node: '>= 18'} - '@nomicfoundation/edr@0.4.2': - resolution: {integrity: sha512-U7v0HuZHfrsl/5FpUzuB2FYA0+FUglHHwiO6NhvLtNYKMZcPzdS6iUriMp/7GWs0SVxW3bAht9GinZPxdhVwWg==} + '@nomicfoundation/edr@0.4.0': + resolution: {integrity: sha512-T96DMSogO8TCdbKKctvxfsDljbhFOUKWc9fHJhSeUh71EEho2qR4951LKQF7t7UWEzguVYh/idQr5L/E3QeaMw==} engines: {node: '>= 18'} '@nomicfoundation/ethereumjs-common@4.0.4': @@ -292,9 +292,6 @@ packages: '@scure/base@1.1.7': resolution: {integrity: sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==} - '@scure/base@1.1.9': - resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} - '@scure/bip32@1.1.5': resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} @@ -362,9 +359,6 @@ packages: '@types/bn.js@5.1.5': resolution: {integrity: sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==} - '@types/bn.js@5.1.6': - resolution: {integrity: sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==} - '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -389,9 +383,6 @@ packages: '@types/node@20.14.8': resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} - '@types/node@22.10.2': - resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} - '@types/pbkdf2@3.1.2': resolution: {integrity: sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==} @@ -537,9 +528,6 @@ packages: bn.js@4.12.0: resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} - bn.js@4.12.1: - resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==} - bn.js@5.2.1: resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} @@ -716,15 +704,6 @@ packages: supports-color: optional: true - debug@4.4.0: - resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} @@ -760,10 +739,6 @@ packages: resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} engines: {node: '>=0.3.1'} - diff@5.2.0: - resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} - engines: {node: '>=0.3.1'} - difflib@0.2.4: resolution: {integrity: sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==} @@ -781,9 +756,6 @@ packages: elliptic@6.5.5: resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==} - elliptic@6.6.1: - resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -858,7 +830,6 @@ packages: ethereumjs-abi@0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} - deprecated: This library has been deprecated and usage is discouraged. ethereumjs-util@6.2.1: resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} @@ -935,15 +906,6 @@ packages: debug: optional: true - follow-redirects@1.15.9: - resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0: resolution: {tarball: https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0} version: 1.8.2 @@ -1144,8 +1106,8 @@ packages: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} - immutable@4.3.7: - resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} + immutable@4.3.6: + resolution: {integrity: sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==} import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -1384,11 +1346,6 @@ packages: engines: {node: '>= 14.0.0'} hasBin: true - mocha@10.8.2: - resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} - engines: {node: '>= 14.0.0'} - hasBin: true - ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -1679,9 +1636,6 @@ packages: serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -1722,8 +1676,8 @@ packages: engines: {node: '>=8.0.0'} hasBin: true - solhint@5.0.3: - resolution: {integrity: sha512-OLCH6qm/mZTCpplTXzXTJGId1zrtNuDYP5c2e6snIv/hdRVxPfBBz/bAlL91bY/Accavkayp2Zp2BaDSrLVXTQ==} + solhint@5.0.1: + resolution: {integrity: sha512-QeQLS9HGCnIiibt+xiOa/+MuP7BWz9N7C5+Mj9pLHshdkNhuo3AzCpWmjfWVZBUuwIUO3YyCRVIcYLR3YOKGfg==} hasBin: true solidity-coverage@0.8.12: @@ -1878,9 +1832,6 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - undici-types@6.20.0: - resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} - undici@5.28.4: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} @@ -1938,9 +1889,6 @@ packages: workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} - workerpool@6.5.1: - resolution: {integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==} - wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -1980,10 +1928,6 @@ packages: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} - yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} @@ -2313,29 +2257,29 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nomicfoundation/edr-darwin-arm64@0.4.2': {} + '@nomicfoundation/edr-darwin-arm64@0.4.0': {} - '@nomicfoundation/edr-darwin-x64@0.4.2': {} + '@nomicfoundation/edr-darwin-x64@0.4.0': {} - '@nomicfoundation/edr-linux-arm64-gnu@0.4.2': {} + '@nomicfoundation/edr-linux-arm64-gnu@0.4.0': {} - '@nomicfoundation/edr-linux-arm64-musl@0.4.2': {} + '@nomicfoundation/edr-linux-arm64-musl@0.4.0': {} - '@nomicfoundation/edr-linux-x64-gnu@0.4.2': {} + '@nomicfoundation/edr-linux-x64-gnu@0.4.0': {} - '@nomicfoundation/edr-linux-x64-musl@0.4.2': {} + '@nomicfoundation/edr-linux-x64-musl@0.4.0': {} - '@nomicfoundation/edr-win32-x64-msvc@0.4.2': {} + '@nomicfoundation/edr-win32-x64-msvc@0.4.0': {} - '@nomicfoundation/edr@0.4.2': + '@nomicfoundation/edr@0.4.0': dependencies: - '@nomicfoundation/edr-darwin-arm64': 0.4.2 - '@nomicfoundation/edr-darwin-x64': 0.4.2 - '@nomicfoundation/edr-linux-arm64-gnu': 0.4.2 - '@nomicfoundation/edr-linux-arm64-musl': 0.4.2 - '@nomicfoundation/edr-linux-x64-gnu': 0.4.2 - '@nomicfoundation/edr-linux-x64-musl': 0.4.2 - '@nomicfoundation/edr-win32-x64-msvc': 0.4.2 + '@nomicfoundation/edr-darwin-arm64': 0.4.0 + '@nomicfoundation/edr-darwin-x64': 0.4.0 + '@nomicfoundation/edr-linux-arm64-gnu': 0.4.0 + '@nomicfoundation/edr-linux-arm64-musl': 0.4.0 + '@nomicfoundation/edr-linux-x64-gnu': 0.4.0 + '@nomicfoundation/edr-linux-x64-musl': 0.4.0 + '@nomicfoundation/edr-win32-x64-msvc': 0.4.0 '@nomicfoundation/ethereumjs-common@4.0.4': dependencies: @@ -2422,13 +2366,11 @@ snapshots: '@scure/base@1.1.7': {} - '@scure/base@1.1.9': {} - '@scure/bip32@1.1.5': dependencies: '@noble/hashes': 1.2.0 '@noble/secp256k1': 1.7.1 - '@scure/base': 1.1.9 + '@scure/base': 1.1.7 '@scure/bip32@1.4.0': dependencies: @@ -2439,7 +2381,7 @@ snapshots: '@scure/bip39@1.1.1': dependencies: '@noble/hashes': 1.2.0 - '@scure/base': 1.1.9 + '@scure/base': 1.1.7 '@scure/bip39@1.3.0': dependencies: @@ -2520,16 +2462,12 @@ snapshots: '@types/bn.js@4.11.6': dependencies: - '@types/node': 22.10.2 + '@types/node': 20.14.8 '@types/bn.js@5.1.5': dependencies: '@types/node': 20.14.8 - '@types/bn.js@5.1.6': - dependencies: - '@types/node': 22.10.2 - '@types/debug@4.1.12': dependencies: '@types/ms': 0.7.34 @@ -2553,10 +2491,6 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/node@22.10.2': - dependencies: - undici-types: 6.20.0 - '@types/pbkdf2@3.1.2': dependencies: '@types/node': 20.14.8 @@ -2606,7 +2540,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.0(supports-color@8.1.1) + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -2711,8 +2645,6 @@ snapshots: bn.js@4.12.0: {} - bn.js@4.12.1: {} - bn.js@5.2.1: {} boxen@5.1.2: @@ -2924,12 +2856,6 @@ snapshots: dependencies: ms: 2.1.2 - debug@4.4.0(supports-color@8.1.1): - dependencies: - ms: 2.1.3 - optionalDependencies: - supports-color: 8.1.1 - decamelize@4.0.0: {} decompress-response@6.0.0: @@ -2954,8 +2880,6 @@ snapshots: diff@5.0.0: {} - diff@5.2.0: {} - difflib@0.2.4: dependencies: heap: 0.2.7 @@ -2986,16 +2910,6 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - elliptic@6.6.1: - dependencies: - bn.js: 4.12.1 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - emoji-regex@8.0.0: {} encode-utf8@1.0.3: {} @@ -3078,15 +2992,15 @@ snapshots: ethereumjs-abi@0.6.8: dependencies: - bn.js: 4.12.1 + bn.js: 4.12.0 ethereumjs-util: 6.2.1 ethereumjs-util@6.2.1: dependencies: '@types/bn.js': 4.11.6 - bn.js: 4.12.1 + bn.js: 4.12.0 create-hash: 1.2.0 - elliptic: 6.6.1 + elliptic: 6.5.5 ethereum-cryptography: 0.1.3 ethjs-util: 0.1.6 rlp: 2.2.7 @@ -3209,10 +3123,6 @@ snapshots: optionalDependencies: debug: 4.3.5 - follow-redirects@1.15.9(debug@4.4.0): - optionalDependencies: - debug: 4.4.0(supports-color@8.1.1) - forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/19891e6a0b5474b9ea6827ddb90bb9388f7acfc0: {} form-data-encoder@2.1.4: {} @@ -3412,13 +3322,13 @@ snapshots: dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/edr': 0.4.2 + '@nomicfoundation/edr': 0.4.0 '@nomicfoundation/ethereumjs-common': 4.0.4 '@nomicfoundation/ethereumjs-tx': 5.0.4 '@nomicfoundation/ethereumjs-util': 9.0.4 '@nomicfoundation/solidity-analyzer': 0.1.2 '@sentry/node': 5.30.0 - '@types/bn.js': 5.1.6 + '@types/bn.js': 5.1.5 '@types/lru-cache': 5.1.1 adm-zip: 0.4.16 aggregate-error: 3.1.0 @@ -3427,7 +3337,7 @@ snapshots: chalk: 2.4.2 chokidar: 3.6.0 ci-info: 2.0.0 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.3.5 enquirer: 2.4.1 env-paths: 2.2.1 ethereum-cryptography: 1.2.0 @@ -3436,17 +3346,17 @@ snapshots: fp-ts: 1.19.3 fs-extra: 7.0.1 glob: 7.2.0 - immutable: 4.3.7 + immutable: 4.3.6 io-ts: 1.10.4 keccak: 3.0.4 lodash: 4.17.21 mnemonist: 0.38.5 - mocha: 10.8.2 + mocha: 10.4.0 p-map: 4.0.0 raw-body: 2.5.2 resolve: 1.17.0 semver: 6.3.1 - solc: 0.7.3(debug@4.4.0) + solc: 0.7.3(debug@4.3.5) source-map-support: 0.5.21 stacktrace-parser: 0.1.10 tsort: 0.0.1 @@ -3518,7 +3428,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -3528,7 +3438,7 @@ snapshots: ignore@5.3.1: {} - immutable@4.3.7: {} + immutable@4.3.6: {} import-fresh@3.3.0: dependencies: @@ -3752,29 +3662,6 @@ snapshots: yargs-parser: 20.2.4 yargs-unparser: 2.0.0 - mocha@10.8.2: - dependencies: - ansi-colors: 4.1.3 - browser-stdout: 1.3.1 - chokidar: 3.6.0 - debug: 4.4.0(supports-color@8.1.1) - diff: 5.2.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 8.1.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.1.6 - ms: 2.1.3 - serialize-javascript: 6.0.2 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.5.1 - yargs: 16.2.0 - yargs-parser: 20.2.9 - yargs-unparser: 2.0.0 - ms@2.1.2: {} ms@2.1.3: {} @@ -4043,10 +3930,6 @@ snapshots: dependencies: randombytes: 2.1.0 - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 - set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -4088,11 +3971,11 @@ snapshots: solady@https://codeload.github.com/vectorized/solady/tar.gz/cfa9a7392bc2d85659788bb99c420fb326dde24e: {} - solc@0.7.3(debug@4.4.0): + solc@0.7.3(debug@4.3.5): dependencies: command-exists: 1.2.9 commander: 3.0.2 - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.6(debug@4.3.5) fs-extra: 0.30.0 js-sha3: 0.8.0 memorystream: 0.3.1 @@ -4102,7 +3985,7 @@ snapshots: transitivePeerDependencies: - debug - solhint@5.0.3(typescript@4.9.5): + solhint@5.0.1(typescript@4.9.5): dependencies: '@solidity-parser/parser': 0.18.0 ajv: 6.12.6 @@ -4263,7 +4146,7 @@ snapshots: dependencies: '@types/prettier': 2.7.3 command-line-args: 4.0.7 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.3.5 fs-extra: 7.0.1 glob: 7.2.3 js-sha3: 0.8.0 @@ -4284,8 +4167,6 @@ snapshots: undici-types@5.26.5: {} - undici-types@6.20.0: {} - undici@5.28.4: dependencies: '@fastify/busboy': 2.1.1 @@ -4338,8 +4219,6 @@ snapshots: workerpool@6.2.1: {} - workerpool@6.5.1: {} - wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -4356,8 +4235,6 @@ snapshots: yargs-parser@20.2.4: {} - yargs-parser@20.2.9: {} - yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 @@ -4379,4 +4256,4 @@ snapshots: zksync-web3@0.14.4(ethers@5.7.2): dependencies: - ethers: 5.7.2 + ethers: 5.7.2 \ No newline at end of file From 9cf07e8e7db59a11af3067ce9cc4b5460d9a431d Mon Sep 17 00:00:00 2001 From: Filipp Makarov Date: Mon, 23 Dec 2024 13:46:41 +0300 Subject: [PATCH 7/7] add naive onRedelegation --- src/MSAAdvanced.sol | 9 +++++ src/core/ERC7779Adapter.sol | 11 ++++-- src/core/HookManager.sol | 9 +++++ src/core/ModuleManager.sol | 69 +++++++++++++++++++++++++++++++++++++ src/interfaces/IERC7779.sol | 26 ++++++++++++++ src/interfaces/IMSA.sol | 3 +- test/advanced/EIP7702.t.sol | 32 +++++++++++++++++ test/mocks/MockERC7779.sol | 4 +++ 8 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 src/interfaces/IERC7779.sol diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index f4bb174..45a9324 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -15,6 +15,7 @@ import { HashLib } from "./lib/HashLib.sol"; import { ECDSA } from "solady/utils/ECDSA.sol"; import { Initializable } from "./lib/Initializable.sol"; import { ERC7779Adapter } from "./core/ERC7779Adapter.sol"; +import { SentinelListLib } from "sentinellist/SentinelList.sol"; /** * @author zeroknots.eth | rhinestone.wtf @@ -34,6 +35,7 @@ contract MSAAdvanced is using ExecutionLib for bytes; using ModeLib for ModeCode; using ECDSA for bytes32; + using SentinelListLib for SentinelListLib.SentinelList; /** * @inheritdoc IERC7579Account @@ -397,4 +399,11 @@ contract MSAAdvanced is (bool success,) = bootstrap.delegatecall(bootstrapCall); if (!success) revert(); } + + function _onRedelegation() internal override { + _tryUninstallValidators(); + _tryUninstallExecutors(); + _tryUninstallHook(_getHook()); + _initModuleManager(); + } } diff --git a/src/core/ERC7779Adapter.sol b/src/core/ERC7779Adapter.sol index b28bdc0..b94a6b0 100644 --- a/src/core/ERC7779Adapter.sol +++ b/src/core/ERC7779Adapter.sol @@ -1,7 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.27; -abstract contract ERC7779Adapter { +import {IERC7779} from "../interfaces/IERC7779.sol"; + +abstract contract ERC7779Adapter is IERC7779 { error NonAuthorizedOnRedelegationCaller(); // keccak256(abi.encode(uint256(keccak256(bytes("InteroperableDelegatedAccount.ERC.Storage"))) - @@ -55,8 +57,11 @@ abstract contract ERC7779Adapter { */ function onRedelegation() external returns (bool) { require(msg.sender == address(this), NonAuthorizedOnRedelegationCaller()); - // this is not implemented at the moment so that the account can preserve state across - // delegations + _onRedelegation(); return true; } + + /// @dev This function is called before redelegation. + /// @dev Account should override this function to implement the specific logic. + function _onRedelegation() internal virtual; } diff --git a/src/core/HookManager.sol b/src/core/HookManager.sol index 5f07f3e..3e203f2 100644 --- a/src/core/HookManager.sol +++ b/src/core/HookManager.sol @@ -10,6 +10,8 @@ import "../interfaces/IERC7579Module.sol"; * @author zeroknots.eth | rhinestone.wtf */ abstract contract HookManager { + event HookUninstallFailed(address hook, bytes data); + /// @custom:storage-location erc7201:hookmanager.storage.msa struct HookManagerStorage { IHook _hook; @@ -55,6 +57,13 @@ abstract contract HookManager { IHook(hook).onUninstall(data); } + function _tryUninstallHook(address hook) internal virtual { + _setHook(address(0)); + try IHook(hook).onUninstall("") {} catch { + emit HookUninstallFailed(hook, ""); + } + } + function _getHook() internal view returns (address _hook) { bytes32 slot = HOOKMANAGER_STORAGE_LOCATION; assembly { diff --git a/src/core/ModuleManager.sol b/src/core/ModuleManager.sol index 0d6ec9e..bb1c31d 100644 --- a/src/core/ModuleManager.sol +++ b/src/core/ModuleManager.sol @@ -24,6 +24,9 @@ abstract contract ModuleManager is AccountBase, Receiver { error NoFallbackHandler(bytes4 selector); error CannotRemoveLastValidator(); + event ValidatorUninstallFailed(address validator, bytes data); + event ExecutorUninstallFailed(address executor, bytes data); + // forgefmt: disable-next-line // keccak256(abi.encode(uint256(keccak256("modulemanager.storage.msa")) - 1)) & ~bytes32(uint256(0xff)); bytes32 internal constant MODULEMANAGER_STORAGE_LOCATION = @@ -92,6 +95,39 @@ abstract contract ModuleManager is AccountBase, Receiver { IValidator(validator).onUninstall(disableModuleData); } + /* + function _tryUninstallValidators(bytes[] calldata data) internal { + SentinelListLib.SentinelList storage $valdiators = $moduleManager().$valdiators; + uint256 length = data.length; + uint256 index; + address validator = $valdiators.getNext(SENTINEL); + while (validator != SENTINEL) { + bytes memory uninstallData; + if (index < length) { + uninstallData = data[index]; + } + try IValidator(validator).onUninstall(uninstallData) {} catch { + emit ValidatorUninstallFailed(validator, uninstallData); + } + validator = $valdiators.getNext(validator); + index++; + } + $valdiators.popAll(); + } + */ + + function _tryUninstallValidators() internal { + SentinelListLib.SentinelList storage $valdiators = $moduleManager().$valdiators; + address validator = $valdiators.getNext(SENTINEL); + while (validator != SENTINEL) { + try IValidator(validator).onUninstall("") {} catch { + emit ValidatorUninstallFailed(validator, ""); + } + validator = $valdiators.getNext(validator); + } + $valdiators.popAll(); + } + function _isValidatorInstalled(address validator) internal view virtual returns (bool) { SentinelListLib.SentinelList storage $valdiators = $moduleManager().$valdiators; return $valdiators.contains(validator); @@ -131,6 +167,39 @@ abstract contract ModuleManager is AccountBase, Receiver { IExecutor(executor).onUninstall(disableModuleData); } + /* + function _tryUninstallExecutors(bytes[] calldata data) internal { + SentinelListLib.SentinelList storage $executors = $moduleManager().$executors; + uint256 length = data.length; + uint256 index; + address executor = $executors.getNext(SENTINEL); + while (executor != SENTINEL) { + bytes memory uninstallData; + if (index < length) { + uninstallData = data[index]; + } + try IExecutor(executor).onUninstall(uninstallData) {} catch { + emit ExecutorUninstallFailed(executor, uninstallData); + } + executor = $executors.getNext(executor); + index++; + } + $executors.popAll(); + } + */ + + function _tryUninstallExecutors() internal { + SentinelListLib.SentinelList storage $executors = $moduleManager().$executors; + address executor = $executors.getNext(SENTINEL); + while (executor != SENTINEL) { + try IExecutor(executor).onUninstall("") {} catch { + emit ExecutorUninstallFailed(executor, ""); + } + executor = $executors.getNext(executor); + } + $executors.popAll(); + } + function _isExecutorInstalled(address executor) internal view virtual returns (bool) { SentinelListLib.SentinelList storage $executors = $moduleManager().$executors; return $executors.contains(executor); diff --git a/src/interfaces/IERC7779.sol b/src/interfaces/IERC7779.sol new file mode 100644 index 0000000..1b0a467 --- /dev/null +++ b/src/interfaces/IERC7779.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.27; + +interface IERC7779 { + /* + * @dev Externally shares the storage bases that has been used throughout the account. + * Majority of 7702 accounts will have their distinctive storage base to reduce the chance of storage collision. + * This allows the external entities to know what the storage base is of the account. + * Wallets willing to redelegate already-delegated accounts should call accountStorageBase() to check if it confirms with the account it plans to redelegate. + * + * The bytes32 array should be stored at the storage slot: keccak(keccak('InteroperableDelegatedAccount.ERC.Storage')-1) & ~0xff + * This is an append-only array so newly redelegated accounts should not overwrite the storage at this slot, but just append their base to the array. + * This append operation should be done during the initialization of the account. + */ + function accountStorageBases() external view returns (bytes32[] memory); + + /* + * @dev Function called before redelegation. + * This function should prepare the account for a delegation to a different implementation. + * This function could be triggered by the new wallet that wants to redelegate an already delegated EOA. + * It should uninitialize storages if needed and execute wallet-specific logic to prepare for redelegation. + * msg.sender should be the owner of the account. + */ + function onRedelegation() external returns (bool); + +} diff --git a/src/interfaces/IMSA.sol b/src/interfaces/IMSA.sol index 5766cbd..459a6fb 100644 --- a/src/interfaces/IMSA.sol +++ b/src/interfaces/IMSA.sol @@ -3,10 +3,11 @@ pragma solidity ^0.8.21; import { IERC7579Account } from "./IERC7579Account.sol"; import { IERC4337Account } from "./IERC4337Account.sol"; +import { IERC7779 } from "./IERC7779.sol"; import { CallType, ExecType, ModeCode } from "../lib/ModeLib.sol"; -interface IMSA is IERC7579Account, IERC4337Account { +interface IMSA is IERC7579Account, IERC4337Account, IERC7779 { // Error thrown when an unsupported ModuleType is requested error UnsupportedModuleType(uint256 moduleTypeId); // Error thrown when an execution with an unsupported CallType was made diff --git a/test/advanced/EIP7702.t.sol b/test/advanced/EIP7702.t.sol index 0070f81..2263ac1 100644 --- a/test/advanced/EIP7702.t.sol +++ b/test/advanced/EIP7702.t.sol @@ -19,6 +19,8 @@ import { import "./TestBaseUtilAdvanced.t.sol"; import { HashLib } from "src/lib/HashLib.sol"; import { ECDSA } from "solady/utils/ECDSA.sol"; +import { MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR, MODULE_TYPE_HOOK } from "src/core/ModuleManager.sol"; +import { MockHook } from "../mocks/MockHook.sol"; contract EIP7702 is TestBaseUtilAdvanced { using ECDSA for bytes32; @@ -284,4 +286,34 @@ contract EIP7702 is TestBaseUtilAdvanced { // Assert that the value was set ie that execution was successful assertTrue(valueTarget.balance == value); } + + function test_onRedelegation() public { + address account = test_initializeAndExecSingle(); + + MockHook hook = new MockHook(); + + vm.prank(address(entrypoint)); + IMSA(account).installModule(MODULE_TYPE_HOOK, address(hook), ""); + + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_VALIDATOR, address(defaultValidator), "")); + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_EXECUTOR, address(defaultExecutor), "")); + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_HOOK, address(hook), "")); + // storage is cleared + vm.prank(address(account)); + IMSA(account).onRedelegation(); + assertFalse(IMSA(account).isModuleInstalled(MODULE_TYPE_VALIDATOR, address(defaultValidator), "")); + assertFalse(IMSA(account).isModuleInstalled(MODULE_TYPE_EXECUTOR, address(defaultExecutor), "")); + assertFalse(IMSA(account).isModuleInstalled(MODULE_TYPE_HOOK, address(hook), "")); + + // account is properly initialized to install modules again + vm.startPrank(address(entrypoint)); + IMSA(account).installModule(MODULE_TYPE_VALIDATOR, address(defaultValidator), ""); + IMSA(account).installModule(MODULE_TYPE_EXECUTOR, address(defaultExecutor), ""); + IMSA(account).installModule(MODULE_TYPE_HOOK, address(hook), ""); + + vm.stopPrank(); + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_VALIDATOR, address(defaultValidator), "")); + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_EXECUTOR, address(defaultExecutor), "")); + assertTrue(IMSA(account).isModuleInstalled(MODULE_TYPE_HOOK, address(hook), "")); + } } diff --git a/test/mocks/MockERC7779.sol b/test/mocks/MockERC7779.sol index ffe4560..fc89ca6 100644 --- a/test/mocks/MockERC7779.sol +++ b/test/mocks/MockERC7779.sol @@ -7,4 +7,8 @@ contract MockERC7779 is ERC7779Adapter { function addStorageBase(bytes32 storageBase) external { _addStorageBase(storageBase); } + + function _onRedelegation() internal override { + // do nothing + } }