From 24ae687fc6282cf90cf1ecf64bcebbcdd1b1d015 Mon Sep 17 00:00:00 2001 From: wshino Date: Mon, 5 Aug 2024 00:32:03 +0900 Subject: [PATCH 1/9] Update dependencies. --- package.json | 4 +- pnpm-lock.yaml | 144 ++++++++++++++++++++++++++++--------------------- 2 files changed, 85 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index d98329fd..d8570d5e 100644 --- a/package.json +++ b/package.json @@ -27,11 +27,11 @@ "dependencies": { "@matterlabs": "github:matter-labs/era-contracts", "@openzeppelin/contracts-upgradeable": "v5.0.1", - "@rhinestone/modulekit": "github:rhinestonewtf/modulekit#test/safe-latest", + "@rhinestone/modulekit": "github:zkemail/modulekit#test/safe-latest", "@zk-email/contracts": "v6.0.3", "email-wallet-sdk": "github:zkemail/email-wallet-sdk", "erc7579-implementation": "github:erc7579/erc7579-implementation", - "ether-email-auth": "github:zkemail/ether-email-auth", + "ether-email-auth": "github:zkemail/ether-email-auth#711c7892c244b210febe9d6f8cc28eddbce5fbdc", "solidity-stringutils": "github:Arachnid/solidity-stringutils" }, "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ddd0bc5..9745bba7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: v5.0.1 version: 5.0.1(@openzeppelin/contracts@5.0.2) '@rhinestone/modulekit': - specifier: github:rhinestonewtf/modulekit#test/safe-latest - version: https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/924f6aba8a4baab2f98b1a2160aca912bb6546f1(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) + specifier: github:zkemail/modulekit#test/safe-latest + version: https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) '@zk-email/contracts': specifier: v6.0.3 version: 6.0.3 @@ -27,8 +27,8 @@ importers: specifier: github:erc7579/erc7579-implementation version: https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) ether-email-auth: - specifier: github:zkemail/ether-email-auth - version: https://codeload.github.com/zkemail/ether-email-auth/tar.gz/10a50a599feed9df9fd8db3e151787e3020f52d6 + specifier: github:zkemail/ether-email-auth#711c7892c244b210febe9d6f8cc28eddbce5fbdc + version: '@zk-email/ether-email-auth@https://codeload.github.com/zkemail/ether-email-auth/tar.gz/711c7892c244b210febe9d6f8cc28eddbce5fbdc' solidity-stringutils: specifier: github:Arachnid/solidity-stringutils version: https://codeload.github.com/Arachnid/solidity-stringutils/tar.gz/4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461 @@ -323,27 +323,27 @@ packages: '@prb/math@4.0.3': resolution: {integrity: sha512-/RSt3VU1k2m3ox6U6kUL1MrktnAHr8vhydXu4eDtqFAms1gm3XnGpoZIPaK1lm2zdJQmKBwJ4EXALPARsuOlaA==} - '@rhinestone/checknsignatures@https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/a4b89298e28e62a984d62aad14a94dff255abdf0': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/a4b89298e28e62a984d62aad14a94dff255abdf0} + '@rhinestone/checknsignatures@https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/9847c6b0d551c75ac337be1c9fe87f4449c352c9': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/9847c6b0d551c75ac337be1c9fe87f4449c352c9} version: 0.0.1 '@rhinestone/erc4337-validation@0.0.1-alpha.2': resolution: {integrity: sha512-sxBSHoR0hV0rN2bv5HfINHR3RyBChfd0OWH0TP8nlA9FolJ1EezLByxcyrvAgi2QLQ2Zf2zVcNky1qYdfF4NjQ==} - '@rhinestone/module-bases@https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/99c4540e6f7f8b0b4a34accca97914c213671274': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/99c4540e6f7f8b0b4a34accca97914c213671274} + '@rhinestone/module-bases@https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a} version: 0.0.1 - '@rhinestone/modulekit@https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/924f6aba8a4baab2f98b1a2160aca912bb6546f1': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/924f6aba8a4baab2f98b1a2160aca912bb6546f1} + '@rhinestone/modulekit@https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c': + resolution: {tarball: https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c} version: 0.4.6 - '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/d961421641b826f6c970e13b0af18111ec10ebad': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/d961421641b826f6c970e13b0af18111ec10ebad} - version: 1.0.0 + '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80} + version: 1.0.2 - '@rhinestone/sentinellist@https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f} + '@rhinestone/sentinellist@https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47} version: 1.0.1 '@safe-global/safe-contracts@1.4.1': @@ -474,8 +474,8 @@ packages: version: 1.0.1-solc-0.8 engines: {node: '>=10'} - '@uniswap/v3-periphery@https://codeload.github.com/Uniswap/v3-periphery/tar.gz/697c2474757ea89fec12a4e6db16a574fe259610': - resolution: {tarball: https://codeload.github.com/Uniswap/v3-periphery/tar.gz/697c2474757ea89fec12a4e6db16a574fe259610} + '@uniswap/v3-periphery@https://codeload.github.com/Uniswap/v3-periphery/tar.gz/0682387198a24c7cd63566a2c58398533860a5d1': + resolution: {tarball: https://codeload.github.com/Uniswap/v3-periphery/tar.gz/0682387198a24c7cd63566a2c58398533860a5d1} version: 1.4.4 engines: {node: '>=10'} @@ -485,6 +485,11 @@ packages: '@zk-email/contracts@6.0.3': resolution: {integrity: sha512-nPSG27431Cz5bzPlR/ltn7qa9k+Joc/6LDHUz+JeFWEP/ff9VnzK11P0ay5qdX14qpQ647varPdxGtulosUtxw==} + '@zk-email/ether-email-auth@https://codeload.github.com/zkemail/ether-email-auth/tar.gz/711c7892c244b210febe9d6f8cc28eddbce5fbdc': + resolution: {tarball: https://codeload.github.com/zkemail/ether-email-auth/tar.gz/711c7892c244b210febe9d6f8cc28eddbce5fbdc} + version: 1.0.0 + engines: {node: '18'} + abbrev@1.0.9: resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} @@ -887,6 +892,10 @@ packages: resolution: {tarball: https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b} version: 0.3.1 + erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56: + resolution: {tarball: https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56} + version: 0.3.1 + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -933,13 +942,9 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - ether-email-auth@https://codeload.github.com/zkemail/ether-email-auth/tar.gz/10a50a599feed9df9fd8db3e151787e3020f52d6: - resolution: {tarball: https://codeload.github.com/zkemail/ether-email-auth/tar.gz/10a50a599feed9df9fd8db3e151787e3020f52d6} - version: 1.0.0 - engines: {node: '18'} - ethereum-bloom-filters@1.1.0: resolution: {integrity: sha512-J1gDRkLpuGNvWYzWslBQR9cDV4nd4kfvVTE/Wy4Kkm4yb3EYRSlyi0eB/inTsSTTVyA0+HyzHgbr95Fn/Z1fSw==} + deprecated: do not use this package use package versions above as this can miss some topics ethereum-cryptography@0.1.3: resolution: {integrity: sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==} @@ -1028,8 +1033,8 @@ packages: debug: optional: true - forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d: - resolution: {tarball: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d} + forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1: + resolution: {tarball: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1} version: 1.9.1 form-data-encoder@2.1.4: @@ -1796,9 +1801,9 @@ packages: solady@0.0.123: resolution: {integrity: sha512-F/B8OMCplGsS4FrdPrnEG0xdg8HKede5PwC+Rum8soj/LWxfKckA0p+Uwnlbgey2iI82IHvmSOCNhsdbA+lUrw==} - solady@https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088: - resolution: {tarball: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088} - version: 0.0.217 + solady@https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9: + resolution: {tarball: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9} + version: 0.0.229 solarray@https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684: resolution: {tarball: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684} @@ -2109,7 +2114,7 @@ snapshots: '@openzeppelin/contracts': 4.9.6 '@openzeppelin/contracts-upgradeable': 4.9.6 '@uniswap/v3-core': https://codeload.github.com/Uniswap/v3-core/tar.gz/6562c52e8f75f0c10f9deaf44861847585fc8129 - '@uniswap/v3-periphery': https://codeload.github.com/Uniswap/v3-periphery/tar.gz/697c2474757ea89fec12a4e6db16a574fe259610 + '@uniswap/v3-periphery': https://codeload.github.com/Uniswap/v3-periphery/tar.gz/0682387198a24c7cd63566a2c58398533860a5d1 '@zk-email/contracts': 4.1.0 accountabstraction: https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) solady: 0.0.123 @@ -2541,10 +2546,10 @@ snapshots: '@prb/math@4.0.3': {} - '@rhinestone/checknsignatures@https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/a4b89298e28e62a984d62aad14a94dff255abdf0': + '@rhinestone/checknsignatures@https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/9847c6b0d551c75ac337be1c9fe87f4449c352c9': dependencies: - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d - solady: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088 + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 '@rhinestone/erc4337-validation@0.0.1-alpha.2(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: @@ -2552,9 +2557,9 @@ snapshots: account-abstraction: accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) account-abstraction-v0.6: accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 prettier: 2.8.8 - solady: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 solhint: 4.5.4(typescript@5.5.2) transitivePeerDependencies: - bufferutil @@ -2567,11 +2572,11 @@ snapshots: - typescript - utf-8-validate - '@rhinestone/module-bases@https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/99c4540e6f7f8b0b4a34accca97914c213671274(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))': + '@rhinestone/module-bases@https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))': dependencies: '@ERC4337/account-abstraction': accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d + erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 transitivePeerDependencies: - bufferutil - encoding @@ -2582,22 +2587,22 @@ snapshots: - typechain - utf-8-validate - '@rhinestone/modulekit@https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/924f6aba8a4baab2f98b1a2160aca912bb6546f1(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': + '@rhinestone/modulekit@https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: '@ERC4337/account-abstraction': accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@ERC4337/account-abstraction-v0.6': accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@prb/math': 4.0.3 '@rhinestone/erc4337-validation': 0.0.1-alpha.2(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) - '@rhinestone/module-bases': https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/99c4540e6f7f8b0b4a34accca97914c213671274(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - '@rhinestone/safe7579': https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/d961421641b826f6c970e13b0af18111ec10ebad(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) - '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f + '@rhinestone/module-bases': https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + '@rhinestone/safe7579': https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) + '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47 '@safe-global/safe-contracts': 1.4.1(ethers@5.7.2) '@zerodev/kernel': kernel@https://codeload.github.com/kopy-kat/kernel/tar.gz/acc457ce5169929ce3ce0f06a9540f85ccc8b25f ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 - erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) excessively-safe-call: '@nomad-xyz/excessively-safe-call@https://codeload.github.com/nomad-xyz/ExcessivelySafeCall/tar.gz/81cd99ce3e69117d665d7601c330ea03b97acce0' - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d - solady: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088 + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 solarray: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684 transitivePeerDependencies: - bufferutil @@ -2610,19 +2615,19 @@ snapshots: - typescript - utf-8-validate - '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/d961421641b826f6c970e13b0af18111ec10ebad(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': + '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: '@ERC4337/account-abstraction': accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@ERC4337/account-abstraction-v0.6': accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - '@rhinestone/checknsignatures': https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/a4b89298e28e62a984d62aad14a94dff255abdf0 + '@rhinestone/checknsignatures': https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/9847c6b0d551c75ac337be1c9fe87f4449c352c9 '@rhinestone/erc4337-validation': 0.0.1-alpha.2(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) - '@rhinestone/module-bases': https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/99c4540e6f7f8b0b4a34accca97914c213671274(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f + '@rhinestone/module-bases': https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47 '@safe-global/safe-contracts': 1.4.1(ethers@5.7.2) ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 - erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d - solady: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088 + erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 solarray: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684 transitivePeerDependencies: - bufferutil @@ -2635,9 +2640,9 @@ snapshots: - typescript - utf-8-validate - '@rhinestone/sentinellist@https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f': + '@rhinestone/sentinellist@https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47': dependencies: - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 '@safe-global/safe-contracts@1.4.1(ethers@5.7.2)': dependencies: @@ -2790,7 +2795,7 @@ snapshots: '@uniswap/v3-core@https://codeload.github.com/Uniswap/v3-core/tar.gz/6562c52e8f75f0c10f9deaf44861847585fc8129': {} - '@uniswap/v3-periphery@https://codeload.github.com/Uniswap/v3-periphery/tar.gz/697c2474757ea89fec12a4e6db16a574fe259610': + '@uniswap/v3-periphery@https://codeload.github.com/Uniswap/v3-periphery/tar.gz/0682387198a24c7cd63566a2c58398533860a5d1': dependencies: '@openzeppelin/contracts': 3.4.2-solc-0.7 '@uniswap/lib': 4.0.1-alpha @@ -2808,6 +2813,8 @@ snapshots: '@openzeppelin/contracts': 5.0.2 dotenv: 16.4.5 + '@zk-email/ether-email-auth@https://codeload.github.com/zkemail/ether-email-auth/tar.gz/711c7892c244b210febe9d6f8cc28eddbce5fbdc': {} + abbrev@1.0.9: {} accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)): @@ -3278,7 +3285,7 @@ snapshots: '@openzeppelin/contracts': 4.9.6 '@openzeppelin/contracts-upgradeable': 4.9.6 '@uniswap/v3-core': https://codeload.github.com/Uniswap/v3-core/tar.gz/6562c52e8f75f0c10f9deaf44861847585fc8129 - '@uniswap/v3-periphery': https://codeload.github.com/Uniswap/v3-periphery/tar.gz/697c2474757ea89fec12a4e6db16a574fe259610 + '@uniswap/v3-periphery': https://codeload.github.com/Uniswap/v3-periphery/tar.gz/0682387198a24c7cd63566a2c58398533860a5d1 '@zk-email/contracts': 4.1.0 solady: 0.0.123 solidity-stringutils: https://codeload.github.com/Arachnid/solidity-stringutils/tar.gz/4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461 @@ -3307,11 +3314,28 @@ snapshots: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/8ab162604cb4878381bb8a15064fec42f775440b(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)): dependencies: - '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/446b16c3ec5ba1d0acd730ecf2bebd2ac48f915f + '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47 + account-abstraction: accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/f1c5c11b273b7ddae26bb20809419b33ccb8f043(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) + ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + transitivePeerDependencies: + - bufferutil + - encoding + - ethers + - hardhat + - lodash + - supports-color + - typechain + - utf-8-validate + + erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)): + dependencies: + '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47 account-abstraction: accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/f1c5c11b273b7ddae26bb20809419b33ccb8f043(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 - forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d - solady: https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088 + forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 transitivePeerDependencies: - bufferutil - encoding @@ -3355,8 +3379,6 @@ snapshots: esutils@2.0.3: {} - ether-email-auth@https://codeload.github.com/zkemail/ether-email-auth/tar.gz/10a50a599feed9df9fd8db3e151787e3020f52d6: {} - ethereum-bloom-filters@1.1.0: dependencies: '@noble/hashes': 1.4.0 @@ -3526,7 +3548,7 @@ snapshots: optionalDependencies: debug: 4.3.5 - forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/07263d193d621c4b2b0ce8b4d54af58f6957d97d: {} + forge-std@https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1: {} form-data-encoder@2.1.4: {} @@ -4376,7 +4398,7 @@ snapshots: solady@0.0.123: {} - solady@https://codeload.github.com/vectorized/solady/tar.gz/fcb4426857d2464a316544924b20c5d43f2b0088: {} + solady@https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9: {} solarray@https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684: {} From 246d80b33aa682a8c383fe002f0a434e1ae45347 Mon Sep 17 00:00:00 2001 From: wshino Date: Mon, 5 Aug 2024 00:38:26 +0900 Subject: [PATCH 2/9] Add implementation and update unit tests. 1. Add isActivated function to EmailRecoveryManager 2. Add isAuthorizedToBeRecovered to EmailRecoveryModule and UniversalEmailRecoveryModule 3. Update unit tests in some actions. --- src/EmailRecoveryManager.sol | 10 ++++++++++ src/interfaces/IEmailRecoveryModule.sol | 1 + .../IUniversalEmailRecoveryModule.sol | 1 + src/modules/EmailRecoveryModule.sol | 19 +++++++++++++++++-- src/modules/UniversalEmailRecoveryModule.sol | 9 +++++++++ .../configureRecovery.t.sol | 6 ++++++ .../deInitRecoveryModule.t.sol | 6 ++++++ .../updateRecoveryConfig.t.sol | 6 ++++++ .../EmailRecoveryModule/onInstall.t.sol | 3 +++ .../EmailRecoveryModule/onUninstall.t.sol | 3 +++ .../onInstall.t.sol | 3 +++ .../onUninstall.t.sol | 3 +++ 12 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/EmailRecoveryManager.sol b/src/EmailRecoveryManager.sol index 7d36cfc0..46bf3f28 100644 --- a/src/EmailRecoveryManager.sol +++ b/src/EmailRecoveryManager.sol @@ -103,6 +103,16 @@ abstract contract EmailRecoveryManager is return recoveryRequests[account]; } + /** + * @notice Checks if the recovery is activated for a given account + * @param recoveredAccount The address of the recovered account for which the activation status is being checked + * @return bool True if the recovery request is activated, false otherwise + */ + function isActivated(address recoveredAccount) public view override returns (bool) { + return guardianConfigs[recoveredAccount].threshold > 0; + } + + /** * @notice Returns a two-dimensional array of strings representing the subject templates for an * acceptance by a new guardian. diff --git a/src/interfaces/IEmailRecoveryModule.sol b/src/interfaces/IEmailRecoveryModule.sol index 982c5947..f0e69c4b 100644 --- a/src/interfaces/IEmailRecoveryModule.sol +++ b/src/interfaces/IEmailRecoveryModule.sol @@ -2,5 +2,6 @@ pragma solidity ^0.8.25; interface IEmailRecoveryModule { + function isAuthorizedToBeRecovered(address account) external view returns (bool); function canStartRecoveryRequest(address smartAccount) external view returns (bool); } diff --git a/src/interfaces/IUniversalEmailRecoveryModule.sol b/src/interfaces/IUniversalEmailRecoveryModule.sol index 0a11c9b5..97bc05c6 100644 --- a/src/interfaces/IUniversalEmailRecoveryModule.sol +++ b/src/interfaces/IUniversalEmailRecoveryModule.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.25; interface IUniversalEmailRecoveryModule { + function isAuthorizedToBeRecovered(address account) external returns (bool); function canStartRecoveryRequest( address account, address validator diff --git a/src/modules/EmailRecoveryModule.sol b/src/modules/EmailRecoveryModule.sol index 0fc6f0e0..157e9067 100644 --- a/src/modules/EmailRecoveryModule.sol +++ b/src/modules/EmailRecoveryModule.sol @@ -34,12 +34,17 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai */ bytes4 public immutable selector; + /** + * Mapping of Account address to authorized validator + */ + mapping(address account => bool isAuthorized) internal authorized; + event RecoveryExecuted(address indexed account, address indexed validator); error InvalidSelector(bytes4 selector); error InvalidOnInstallData(); error InvalidValidator(address validator); - + constructor( address verifier, address dkimRegistry, @@ -97,7 +102,7 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai ) { revert InvalidValidator(validator); } - + authorized[msg.sender] = true; configureRecovery(guardians, weights, threshold, delay, expiry); } @@ -106,6 +111,7 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai * @dev the data parameter is not used */ function onUninstall(bytes calldata /* data */ ) external { + authorized[msg.sender] = false; deInitRecoveryModule(); } @@ -118,6 +124,15 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai return getGuardianConfig(account).threshold != 0; } + /** + * Check if the recovery module is authorized to recover the account + * @param account The smart account to check + * @return true if the module is authorized, false otherwise + */ + function isAuthorizedToBeRecovered(address account) external view returns (bool) { + return authorized[account]; + } + /** * Check if a recovery request can be initiated based on guardian acceptance * @param account The smart account to check diff --git a/src/modules/UniversalEmailRecoveryModule.sol b/src/modules/UniversalEmailRecoveryModule.sol index 350dc6fa..412261a1 100644 --- a/src/modules/UniversalEmailRecoveryModule.sol +++ b/src/modules/UniversalEmailRecoveryModule.sol @@ -229,6 +229,15 @@ contract UniversalEmailRecoveryModule is return getGuardianConfig(account).threshold != 0; } + /** + * Check if the recovery module is authorized to recover the account + * @param account The smart account to check + * @return true if the module is authorized, false otherwise + */ + function isAuthorizedToBeRecovered(address account) external view returns (bool) { + return validatorCount[account] > 0; + } + /** * Check if a recovery request can be initiated based on guardian acceptance * @param account The smart account to check diff --git a/test/unit/EmailRecoveryManager/configureRecovery.t.sol b/test/unit/EmailRecoveryManager/configureRecovery.t.sol index db423c3e..9b90b917 100644 --- a/test/unit/EmailRecoveryManager/configureRecovery.t.sol +++ b/test/unit/EmailRecoveryManager/configureRecovery.t.sol @@ -42,6 +42,9 @@ contract EmailRecoveryManager_configureRecovery_Test is UnitBase { vm.startPrank(accountAddress); emailRecoveryModule.workaround_validatorsPush(accountAddress, validatorAddress); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); + vm.expectEmit(); emit IEmailRecoveryManager.RecoveryConfigured( instance.account, guardians.length, totalWeight, threshold @@ -66,6 +69,9 @@ contract EmailRecoveryManager_configureRecovery_Test is UnitBase { emailRecoveryModule.getGuardian(accountAddress, guardians[0]); assertEq(uint256(guardian.status), uint256(GuardianStatus.REQUESTED)); assertEq(guardian.weight, guardianWeights[0]); + + isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } function test_ConfigureRecovery_RevertWhen_ZeroGuardians() public { diff --git a/test/unit/EmailRecoveryManager/deInitRecoveryModule.t.sol b/test/unit/EmailRecoveryManager/deInitRecoveryModule.t.sol index 1780bb41..29ac7b5d 100644 --- a/test/unit/EmailRecoveryManager/deInitRecoveryModule.t.sol +++ b/test/unit/EmailRecoveryManager/deInitRecoveryModule.t.sol @@ -28,6 +28,9 @@ contract EmailRecoveryManager_deInitRecoveryModule_Test is UnitBase { acceptGuardian(accountSalt1); acceptGuardian(accountSalt2); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); + vm.prank(accountAddress); vm.expectEmit(); emit IEmailRecoveryManager.RecoveryDeInitialized(accountAddress); @@ -66,5 +69,8 @@ contract EmailRecoveryManager_deInitRecoveryModule_Test is UnitBase { assertEq(guardianConfig.totalWeight, 0); assertEq(guardianConfig.acceptedWeight, 0); assertEq(guardianConfig.threshold, 0); + + isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); } } diff --git a/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol b/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol index ea7658da..88276015 100644 --- a/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol +++ b/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol @@ -98,6 +98,9 @@ contract EmailRecoveryManager_updateRecoveryConfig_Test is UnitBase { recoveryConfig = emailRecoveryModule.getRecoveryConfig(accountAddress); assertEq(recoveryConfig.delay, newDelay); assertEq(recoveryConfig.expiry, newExpiry); + + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } function test_UpdateRecoveryConfig_Succeeds() public { @@ -117,5 +120,8 @@ contract EmailRecoveryManager_updateRecoveryConfig_Test is UnitBase { recoveryConfig = emailRecoveryModule.getRecoveryConfig(accountAddress); assertEq(recoveryConfig.delay, newDelay); assertEq(recoveryConfig.expiry, newExpiry); + + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } } diff --git a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol index ef6aa14d..54d638c6 100644 --- a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol @@ -49,5 +49,8 @@ contract EmailRecoveryModule_onInstall_Test is EmailRecoveryModuleBase { bool isInitialized = emailRecoveryModule.isInitialized(accountAddress); assertTrue(isInitialized); + + bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); + assertTrue(isAuthorizedToBeRecovered); } } diff --git a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol index 40046a09..88ec68b7 100644 --- a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol @@ -22,5 +22,8 @@ contract EmailRecoveryModule_onUninstall_Test is EmailRecoveryModuleBase { bool isInitialized = emailRecoveryModule.isInitialized(accountAddress); assertFalse(isInitialized); + + bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); + assertFalse(isAuthorizedToBeRecovered); } } diff --git a/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol b/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol index 9261aa74..f0dd694c 100644 --- a/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol +++ b/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol @@ -54,5 +54,8 @@ contract UniversalEmailRecoveryModule_onInstall_Test is UnitBase { bytes4[] memory allowedSelectors = emailRecoveryModule.getAllowedSelectors(accountAddress); assertEq(allowedValidators.length, 1); assertEq(allowedSelectors.length, 1); + + bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); + assertTrue(isAuthorizedToBeRecovered); } } diff --git a/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol b/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol index ae1a84f1..25d73b5a 100644 --- a/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol +++ b/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol @@ -62,5 +62,8 @@ contract UniversalEmailRecoveryModule_onUninstall_Test is UnitBase { allowedSelectors = emailRecoveryModule.getAllowedSelectors(accountAddress); assertEq(allowedValidators.length, 0); assertEq(allowedSelectors.length, 0); + + bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); + assertFalse(isAuthorizedToBeRecovered); } } From c3c67f7a2533bcf5c2fad3141eeb4ad992901708 Mon Sep 17 00:00:00 2001 From: wshino Date: Mon, 5 Aug 2024 03:25:26 +0900 Subject: [PATCH 3/9] Update dependency for @rhinestone/modulekit. --- package.json | 2 +- pnpm-lock.yaml | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index d8570d5e..bc3d2624 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "dependencies": { "@matterlabs": "github:matter-labs/era-contracts", "@openzeppelin/contracts-upgradeable": "v5.0.1", - "@rhinestone/modulekit": "github:zkemail/modulekit#test/safe-latest", + "@rhinestone/modulekit": "github:rhinestonewtf/modulekit", "@zk-email/contracts": "v6.0.3", "email-wallet-sdk": "github:zkemail/email-wallet-sdk", "erc7579-implementation": "github:erc7579/erc7579-implementation", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9745bba7..b4bfee54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: v5.0.1 version: 5.0.1(@openzeppelin/contracts@5.0.2) '@rhinestone/modulekit': - specifier: github:zkemail/modulekit#test/safe-latest - version: https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) + specifier: github:rhinestonewtf/modulekit + version: https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/926d6c963ee2e3e1e5bf8c3d8f099ee106c286e7(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) '@zk-email/contracts': specifier: v6.0.3 version: 6.0.3 @@ -334,13 +334,13 @@ packages: resolution: {tarball: https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a} version: 0.0.1 - '@rhinestone/modulekit@https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c': - resolution: {tarball: https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c} - version: 0.4.6 + '@rhinestone/modulekit@https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/926d6c963ee2e3e1e5bf8c3d8f099ee106c286e7': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/926d6c963ee2e3e1e5bf8c3d8f099ee106c286e7} + version: 0.4.8 - '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80} - version: 1.0.2 + '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/33f110f08ed5fcab75c29d7cfb93f7f3e4da76a7': + resolution: {tarball: https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/33f110f08ed5fcab75c29d7cfb93f7f3e4da76a7} + version: 1.0.0 '@rhinestone/sentinellist@https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47': resolution: {tarball: https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47} @@ -1801,9 +1801,9 @@ packages: solady@0.0.123: resolution: {integrity: sha512-F/B8OMCplGsS4FrdPrnEG0xdg8HKede5PwC+Rum8soj/LWxfKckA0p+Uwnlbgey2iI82IHvmSOCNhsdbA+lUrw==} - solady@https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9: - resolution: {tarball: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9} - version: 0.0.229 + solady@https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f: + resolution: {tarball: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f} + version: 0.0.230 solarray@https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684: resolution: {tarball: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684} @@ -2549,7 +2549,7 @@ snapshots: '@rhinestone/checknsignatures@https://codeload.github.com/rhinestonewtf/checknsignatures/tar.gz/9847c6b0d551c75ac337be1c9fe87f4449c352c9': dependencies: forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f '@rhinestone/erc4337-validation@0.0.1-alpha.2(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: @@ -2559,7 +2559,7 @@ snapshots: ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 prettier: 2.8.8 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f solhint: 4.5.4(typescript@5.5.2) transitivePeerDependencies: - bufferutil @@ -2587,14 +2587,14 @@ snapshots: - typechain - utf-8-validate - '@rhinestone/modulekit@https://codeload.github.com/zkemail/modulekit/tar.gz/6e2491d97deaeb49980c31bb5c5af8204071a51c(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': + '@rhinestone/modulekit@https://codeload.github.com/rhinestonewtf/modulekit/tar.gz/926d6c963ee2e3e1e5bf8c3d8f099ee106c286e7(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: '@ERC4337/account-abstraction': accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@ERC4337/account-abstraction-v0.6': accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@prb/math': 4.0.3 '@rhinestone/erc4337-validation': 0.0.1-alpha.2(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) '@rhinestone/module-bases': https://codeload.github.com/rhinestonewtf/module-bases/tar.gz/7d7dbe629e6620dcc3e0e7f9dce8aa305964ae5a(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) - '@rhinestone/safe7579': https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) + '@rhinestone/safe7579': https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/33f110f08ed5fcab75c29d7cfb93f7f3e4da76a7(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2) '@rhinestone/sentinellist': https://codeload.github.com/rhinestonewtf/sentinellist/tar.gz/6dff696f39fb55bfdde9581544d788932f145e47 '@safe-global/safe-contracts': 1.4.1(ethers@5.7.2) '@zerodev/kernel': kernel@https://codeload.github.com/kopy-kat/kernel/tar.gz/acc457ce5169929ce3ce0f06a9540f85ccc8b25f @@ -2602,7 +2602,7 @@ snapshots: erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) excessively-safe-call: '@nomad-xyz/excessively-safe-call@https://codeload.github.com/nomad-xyz/ExcessivelySafeCall/tar.gz/81cd99ce3e69117d665d7601c330ea03b97acce0' forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f solarray: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684 transitivePeerDependencies: - bufferutil @@ -2615,7 +2615,7 @@ snapshots: - typescript - utf-8-validate - '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/a143586bb6ceebbcd5b6b6665bb8a791271caa80(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': + '@rhinestone/safe7579@https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/33f110f08ed5fcab75c29d7cfb93f7f3e4da76a7(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2))(typescript@5.5.2)': dependencies: '@ERC4337/account-abstraction': accountabstraction@https://codeload.github.com/kopy-kat/account-abstraction/tar.gz/c5887153fbfe3ed09b2637cac39873f96d676f38(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) '@ERC4337/account-abstraction-v0.6': accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/7174d6d845618dbd11cee68eefa715f5263690b6(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) @@ -2627,7 +2627,7 @@ snapshots: ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 erc7579: erc7579-implementation@https://codeload.github.com/erc7579/erc7579-implementation/tar.gz/b3f8bcb2df3aae3217213ffa8b7a87c1eb42ec56(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f solarray: https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684 transitivePeerDependencies: - bufferutil @@ -3318,7 +3318,7 @@ snapshots: account-abstraction: accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/f1c5c11b273b7ddae26bb20809419b33ccb8f043(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f transitivePeerDependencies: - bufferutil - encoding @@ -3335,7 +3335,7 @@ snapshots: account-abstraction: accountabstraction@https://codeload.github.com/eth-infinitism/account-abstraction/tar.gz/f1c5c11b273b7ddae26bb20809419b33ccb8f043(ethers@5.7.2)(hardhat@2.22.5(typescript@5.5.2))(lodash@4.17.21)(typechain@5.2.0(typescript@5.5.2)) ds-test: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 forge-std: https://codeload.github.com/foundry-rs/forge-std/tar.gz/4d63c978718517fa02d4e330fbe7372dbb06c2f1 - solady: https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f transitivePeerDependencies: - bufferutil - encoding @@ -4398,7 +4398,7 @@ snapshots: solady@0.0.123: {} - solady@https://codeload.github.com/vectorized/solady/tar.gz/e9f6c3fb7d0a3e43fa25f87cbf8c699619be65f9: {} + solady@https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f: {} solarray@https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684: {} From d0b56b5b0092ba2648c0b1cbd7716673c0e13a2b Mon Sep 17 00:00:00 2001 From: wshino Date: Tue, 6 Aug 2024 11:28:30 +0900 Subject: [PATCH 4/9] Remove isAuthorizedToBeRecovered. --- src/EmailRecoveryManager.sol | 19 ++++++++++--- src/interfaces/IEmailRecoveryManager.sol | 1 + src/interfaces/IEmailRecoveryModule.sol | 1 - .../IUniversalEmailRecoveryModule.sol | 1 - src/modules/EmailRecoveryModule.sol | 16 ----------- src/modules/UniversalEmailRecoveryModule.sol | 9 ------ .../EmailRecoveryManager.integration.t.sol | 28 ++++--------------- .../EmailRecoveryManager/acceptGuardian.t.sol | 8 +----- .../completeRecovery.t.sol | 6 ++++ .../processRecovery.t.sol | 8 +----- .../EmailRecoveryModule/onInstall.t.sol | 4 +-- .../EmailRecoveryModule/onUninstall.t.sol | 4 +-- .../onInstall.t.sol | 4 +-- .../onUninstall.t.sol | 4 +-- 14 files changed, 37 insertions(+), 76 deletions(-) diff --git a/src/EmailRecoveryManager.sol b/src/EmailRecoveryManager.sol index 46bf3f28..31ef8e40 100644 --- a/src/EmailRecoveryManager.sol +++ b/src/EmailRecoveryManager.sol @@ -105,14 +105,13 @@ abstract contract EmailRecoveryManager is /** * @notice Checks if the recovery is activated for a given account - * @param recoveredAccount The address of the recovered account for which the activation status is being checked + * @param account The address of the account for which the activation status is being checked * @return bool True if the recovery request is activated, false otherwise */ - function isActivated(address recoveredAccount) public view override returns (bool) { - return guardianConfigs[recoveredAccount].threshold > 0; + function isActivated(address account) public view override returns (bool) { + return guardianConfigs[account].threshold > 0; } - /** * @notice Returns a two-dimensional array of strings representing the subject templates for an * acceptance by a new guardian. @@ -283,6 +282,10 @@ abstract contract EmailRecoveryManager is revert RecoveryInProcess(); } + if (!isActivated(account)) { + revert RecoveryIsNotActivated(); + } + // This check ensures GuardianStatus is correct and also implicitly that the // account in email is a valid account GuardianStorage memory guardianStorage = getGuardian(account, guardian); @@ -323,6 +326,10 @@ abstract contract EmailRecoveryManager is templateIdx, subjectParams, address(this) ); + if (!isActivated(account)) { + revert RecoveryIsNotActivated(); + } + GuardianConfig memory guardianConfig = guardianConfigs[account]; if (guardianConfig.threshold > guardianConfig.acceptedWeight) { revert ThresholdExceedsAcceptedWeight( @@ -378,6 +385,10 @@ abstract contract EmailRecoveryManager is } RecoveryRequest memory recoveryRequest = recoveryRequests[account]; + if (!isActivated(account)) { + revert RecoveryIsNotActivated(); + } + uint256 threshold = guardianConfigs[account].threshold; if (threshold == 0) { revert NoRecoveryConfigured(); diff --git a/src/interfaces/IEmailRecoveryManager.sol b/src/interfaces/IEmailRecoveryManager.sol index baed6d90..6edddcaa 100644 --- a/src/interfaces/IEmailRecoveryManager.sol +++ b/src/interfaces/IEmailRecoveryManager.sol @@ -77,6 +77,7 @@ interface IEmailRecoveryManager { error RecoveryRequestExpired(uint256 blockTimestamp, uint256 executeBefore); error InvalidCalldataHash(bytes32 calldataHash, bytes32 expectedCalldataHash); error NoRecoveryInProcess(); + error RecoveryIsNotActivated(); /*////////////////////////////////////////////////////////////////////////// FUNCTIONS diff --git a/src/interfaces/IEmailRecoveryModule.sol b/src/interfaces/IEmailRecoveryModule.sol index f0e69c4b..982c5947 100644 --- a/src/interfaces/IEmailRecoveryModule.sol +++ b/src/interfaces/IEmailRecoveryModule.sol @@ -2,6 +2,5 @@ pragma solidity ^0.8.25; interface IEmailRecoveryModule { - function isAuthorizedToBeRecovered(address account) external view returns (bool); function canStartRecoveryRequest(address smartAccount) external view returns (bool); } diff --git a/src/interfaces/IUniversalEmailRecoveryModule.sol b/src/interfaces/IUniversalEmailRecoveryModule.sol index 97bc05c6..0a11c9b5 100644 --- a/src/interfaces/IUniversalEmailRecoveryModule.sol +++ b/src/interfaces/IUniversalEmailRecoveryModule.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.25; interface IUniversalEmailRecoveryModule { - function isAuthorizedToBeRecovered(address account) external returns (bool); function canStartRecoveryRequest( address account, address validator diff --git a/src/modules/EmailRecoveryModule.sol b/src/modules/EmailRecoveryModule.sol index 157e9067..3c009ff1 100644 --- a/src/modules/EmailRecoveryModule.sol +++ b/src/modules/EmailRecoveryModule.sol @@ -34,11 +34,6 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai */ bytes4 public immutable selector; - /** - * Mapping of Account address to authorized validator - */ - mapping(address account => bool isAuthorized) internal authorized; - event RecoveryExecuted(address indexed account, address indexed validator); error InvalidSelector(bytes4 selector); @@ -102,7 +97,6 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai ) { revert InvalidValidator(validator); } - authorized[msg.sender] = true; configureRecovery(guardians, weights, threshold, delay, expiry); } @@ -111,7 +105,6 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai * @dev the data parameter is not used */ function onUninstall(bytes calldata /* data */ ) external { - authorized[msg.sender] = false; deInitRecoveryModule(); } @@ -124,15 +117,6 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai return getGuardianConfig(account).threshold != 0; } - /** - * Check if the recovery module is authorized to recover the account - * @param account The smart account to check - * @return true if the module is authorized, false otherwise - */ - function isAuthorizedToBeRecovered(address account) external view returns (bool) { - return authorized[account]; - } - /** * Check if a recovery request can be initiated based on guardian acceptance * @param account The smart account to check diff --git a/src/modules/UniversalEmailRecoveryModule.sol b/src/modules/UniversalEmailRecoveryModule.sol index 412261a1..350dc6fa 100644 --- a/src/modules/UniversalEmailRecoveryModule.sol +++ b/src/modules/UniversalEmailRecoveryModule.sol @@ -229,15 +229,6 @@ contract UniversalEmailRecoveryModule is return getGuardianConfig(account).threshold != 0; } - /** - * Check if the recovery module is authorized to recover the account - * @param account The smart account to check - * @return true if the module is authorized, false otherwise - */ - function isAuthorizedToBeRecovered(address account) external view returns (bool) { - return validatorCount[account] > 0; - } - /** * Check if a recovery request can be initiated based on guardian acceptance * @param account The smart account to check diff --git a/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol b/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol index 78fc4fce..9bfb1c33 100644 --- a/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol +++ b/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol @@ -32,13 +32,7 @@ contract EmailRecoveryManager_Integration_Test is EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[0]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } @@ -171,7 +165,7 @@ contract EmailRecoveryManager_Integration_Test is instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1); } @@ -206,23 +200,11 @@ contract EmailRecoveryManager_Integration_Test is vm.warp(12 seconds); emailAuthMsg = getRecoveryEmailAuthMessage(accountAddress1, guardians1[0], calldataHash1); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.ACCEPTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleRecovery(emailAuthMsg, templateIdx); emailAuthMsg = getRecoveryEmailAuthMessage(accountAddress1, guardians1[1], calldataHash1); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.ACCEPTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleRecovery(emailAuthMsg, templateIdx); } @@ -231,7 +213,7 @@ contract EmailRecoveryManager_Integration_Test is instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1); } diff --git a/test/unit/EmailRecoveryManager/acceptGuardian.t.sol b/test/unit/EmailRecoveryManager/acceptGuardian.t.sol index a6d83360..6a505df6 100644 --- a/test/unit/EmailRecoveryManager/acceptGuardian.t.sol +++ b/test/unit/EmailRecoveryManager/acceptGuardian.t.sol @@ -40,13 +40,7 @@ contract EmailRecoveryManager_acceptGuardian_Test is UnitBase { instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.exposed_acceptGuardian(guardian1, templateIdx, subjectParams, nullifier); } diff --git a/test/unit/EmailRecoveryManager/completeRecovery.t.sol b/test/unit/EmailRecoveryManager/completeRecovery.t.sol index 42e8c99f..d0dfc515 100644 --- a/test/unit/EmailRecoveryManager/completeRecovery.t.sol +++ b/test/unit/EmailRecoveryManager/completeRecovery.t.sol @@ -134,6 +134,9 @@ contract EmailRecoveryManager_completeRecovery_Test is UnitBase { assertEq(recoveryRequest.executeBefore, 0); assertEq(recoveryRequest.currentWeight, 0); assertEq(recoveryRequest.calldataHash, ""); + + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } function test_CompleteRecovery_SucceedsAlmostExpiry() public { @@ -155,5 +158,8 @@ contract EmailRecoveryManager_completeRecovery_Test is UnitBase { assertEq(recoveryRequest.executeBefore, 0); assertEq(recoveryRequest.currentWeight, 0); assertEq(recoveryRequest.calldataHash, ""); + + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } } diff --git a/test/unit/EmailRecoveryManager/processRecovery.t.sol b/test/unit/EmailRecoveryManager/processRecovery.t.sol index a01d7f4f..d59c8e12 100644 --- a/test/unit/EmailRecoveryManager/processRecovery.t.sol +++ b/test/unit/EmailRecoveryManager/processRecovery.t.sol @@ -71,13 +71,7 @@ contract EmailRecoveryManager_processRecovery_Test is UnitBase { instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.ACCEPTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.exposed_processRecovery( guardian1, templateIdx, subjectParams, nullifier ); diff --git a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol index 54d638c6..8cc5d404 100644 --- a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol @@ -50,7 +50,7 @@ contract EmailRecoveryModule_onInstall_Test is EmailRecoveryModuleBase { bool isInitialized = emailRecoveryModule.isInitialized(accountAddress); assertTrue(isInitialized); - bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); - assertTrue(isAuthorizedToBeRecovered); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } } diff --git a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol index 88ec68b7..807a16fb 100644 --- a/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol +++ b/test/unit/modules/EmailRecoveryModule/onUninstall.t.sol @@ -23,7 +23,7 @@ contract EmailRecoveryModule_onUninstall_Test is EmailRecoveryModuleBase { bool isInitialized = emailRecoveryModule.isInitialized(accountAddress); assertFalse(isInitialized); - bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); - assertFalse(isAuthorizedToBeRecovered); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); } } diff --git a/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol b/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol index f0dd694c..32b333de 100644 --- a/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol +++ b/test/unit/modules/UniversalEmailRecoveryModule/onInstall.t.sol @@ -55,7 +55,7 @@ contract UniversalEmailRecoveryModule_onInstall_Test is UnitBase { assertEq(allowedValidators.length, 1); assertEq(allowedSelectors.length, 1); - bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); - assertTrue(isAuthorizedToBeRecovered); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); } } diff --git a/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol b/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol index 25d73b5a..b9611f30 100644 --- a/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol +++ b/test/unit/modules/UniversalEmailRecoveryModule/onUninstall.t.sol @@ -63,7 +63,7 @@ contract UniversalEmailRecoveryModule_onUninstall_Test is UnitBase { assertEq(allowedValidators.length, 0); assertEq(allowedSelectors.length, 0); - bool isAuthorizedToBeRecovered = emailRecoveryModule.isAuthorizedToBeRecovered(accountAddress); - assertFalse(isAuthorizedToBeRecovered); + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); } } From 4850ef378046ff213b901b30b483e28ddaf29950 Mon Sep 17 00:00:00 2001 From: wshino Date: Tue, 6 Aug 2024 11:30:45 +0900 Subject: [PATCH 5/9] Remove assertions, the state isn't changed. --- test/unit/EmailRecoveryManager/completeRecovery.t.sol | 6 ------ test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol | 6 ------ 2 files changed, 12 deletions(-) diff --git a/test/unit/EmailRecoveryManager/completeRecovery.t.sol b/test/unit/EmailRecoveryManager/completeRecovery.t.sol index d0dfc515..42e8c99f 100644 --- a/test/unit/EmailRecoveryManager/completeRecovery.t.sol +++ b/test/unit/EmailRecoveryManager/completeRecovery.t.sol @@ -134,9 +134,6 @@ contract EmailRecoveryManager_completeRecovery_Test is UnitBase { assertEq(recoveryRequest.executeBefore, 0); assertEq(recoveryRequest.currentWeight, 0); assertEq(recoveryRequest.calldataHash, ""); - - bool isActivated = emailRecoveryModule.isActivated(accountAddress); - assertTrue(isActivated); } function test_CompleteRecovery_SucceedsAlmostExpiry() public { @@ -158,8 +155,5 @@ contract EmailRecoveryManager_completeRecovery_Test is UnitBase { assertEq(recoveryRequest.executeBefore, 0); assertEq(recoveryRequest.currentWeight, 0); assertEq(recoveryRequest.calldataHash, ""); - - bool isActivated = emailRecoveryModule.isActivated(accountAddress); - assertTrue(isActivated); } } diff --git a/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol b/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol index 88276015..ea7658da 100644 --- a/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol +++ b/test/unit/EmailRecoveryManager/updateRecoveryConfig.t.sol @@ -98,9 +98,6 @@ contract EmailRecoveryManager_updateRecoveryConfig_Test is UnitBase { recoveryConfig = emailRecoveryModule.getRecoveryConfig(accountAddress); assertEq(recoveryConfig.delay, newDelay); assertEq(recoveryConfig.expiry, newExpiry); - - bool isActivated = emailRecoveryModule.isActivated(accountAddress); - assertTrue(isActivated); } function test_UpdateRecoveryConfig_Succeeds() public { @@ -120,8 +117,5 @@ contract EmailRecoveryManager_updateRecoveryConfig_Test is UnitBase { recoveryConfig = emailRecoveryModule.getRecoveryConfig(accountAddress); assertEq(recoveryConfig.delay, newDelay); assertEq(recoveryConfig.expiry, newExpiry); - - bool isActivated = emailRecoveryModule.isActivated(accountAddress); - assertTrue(isActivated); } } From afa80760e4e36566e6f6b718450ea2a8ddd7fd47 Mon Sep 17 00:00:00 2001 From: wshino Date: Tue, 6 Aug 2024 11:50:44 +0900 Subject: [PATCH 6/9] Remove whitespaces. --- src/modules/EmailRecoveryModule.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/EmailRecoveryModule.sol b/src/modules/EmailRecoveryModule.sol index 3c009ff1..7def95f2 100644 --- a/src/modules/EmailRecoveryModule.sol +++ b/src/modules/EmailRecoveryModule.sol @@ -39,7 +39,7 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai error InvalidSelector(bytes4 selector); error InvalidOnInstallData(); error InvalidValidator(address validator); - + constructor( address verifier, address dkimRegistry, From 4424fdfec99a6556171964b2b7ec29dd76503001 Mon Sep 17 00:00:00 2001 From: wshino Date: Tue, 6 Aug 2024 13:44:30 +0900 Subject: [PATCH 7/9] Fix tests test-multi-account and test-simulate. --- .../EmailRecoveryModule.t.sol | 33 +++---------------- .../UniversalEmailRecoveryModule.t.sol | 33 +++---------------- 2 files changed, 10 insertions(+), 56 deletions(-) diff --git a/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol b/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol index c1cd7659..d1aafc31 100644 --- a/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol +++ b/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol @@ -141,13 +141,7 @@ contract OwnableValidatorRecovery_EmailRecoveryModule_Integration_Test is EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[0]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } @@ -160,13 +154,7 @@ contract OwnableValidatorRecovery_EmailRecoveryModule_Integration_Test is EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[1]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } @@ -181,13 +169,8 @@ contract OwnableValidatorRecovery_EmailRecoveryModule_Integration_Test is getRecoveryEmailAuthMessage(accountAddress1, guardians1[0], calldataHash1); instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.ACCEPTED) - ) - ); + + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleRecovery(emailAuthMsg, templateIdx); } @@ -227,13 +210,7 @@ contract OwnableValidatorRecovery_EmailRecoveryModule_Integration_Test is EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[0]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } diff --git a/test/integration/OwnableValidatorRecovery/UniversalEmailRecoveryModule/UniversalEmailRecoveryModule.t.sol b/test/integration/OwnableValidatorRecovery/UniversalEmailRecoveryModule/UniversalEmailRecoveryModule.t.sol index be34f9e8..774607ef 100644 --- a/test/integration/OwnableValidatorRecovery/UniversalEmailRecoveryModule/UniversalEmailRecoveryModule.t.sol +++ b/test/integration/OwnableValidatorRecovery/UniversalEmailRecoveryModule/UniversalEmailRecoveryModule.t.sol @@ -139,13 +139,7 @@ contract OwnableValidatorRecovery_UniversalEmailRecoveryModule_Integration_Test EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[0]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } @@ -158,13 +152,7 @@ contract OwnableValidatorRecovery_UniversalEmailRecoveryModule_Integration_Test EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[1]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } @@ -179,13 +167,8 @@ contract OwnableValidatorRecovery_UniversalEmailRecoveryModule_Integration_Test getRecoveryEmailAuthMessage(accountAddress1, guardians1[0], calldataHash1); instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.ACCEPTED) - ) - ); + + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleRecovery(emailAuthMsg, templateIdx); } @@ -225,13 +208,7 @@ contract OwnableValidatorRecovery_UniversalEmailRecoveryModule_Integration_Test EmailAuthMsg memory emailAuthMsg = getAcceptanceEmailAuthMessage(accountAddress1, guardians1[0]); - vm.expectRevert( - abi.encodeWithSelector( - IEmailRecoveryManager.InvalidGuardianStatus.selector, - uint256(GuardianStatus.NONE), - uint256(GuardianStatus.REQUESTED) - ) - ); + vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); emailRecoveryModule.handleAcceptance(emailAuthMsg, templateIdx); } From 26685b4b6197d7ec986a72c2eab5d8c0b9baaea5 Mon Sep 17 00:00:00 2001 From: JohnGuilding Date: Tue, 6 Aug 2024 10:37:10 +0100 Subject: [PATCH 8/9] isActivated unit test --- .../EmailRecoveryManager/isActivated.t.sol | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/unit/EmailRecoveryManager/isActivated.t.sol diff --git a/test/unit/EmailRecoveryManager/isActivated.t.sol b/test/unit/EmailRecoveryManager/isActivated.t.sol new file mode 100644 index 00000000..eaf6b86b --- /dev/null +++ b/test/unit/EmailRecoveryManager/isActivated.t.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { console2 } from "forge-std/console2.sol"; +import { ModuleKitHelpers } from "modulekit/ModuleKit.sol"; +import { MODULE_TYPE_EXECUTOR } from "modulekit/external/ERC7579.sol"; +import { IEmailRecoveryManager } from "src/interfaces/IEmailRecoveryManager.sol"; +import { GuardianStorage, GuardianStatus } from "src/libraries/EnumerableGuardianMap.sol"; +import { UnitBase } from "../UnitBase.t.sol"; + +contract EmailRecoveryManager_isActivated_Test is UnitBase { + using ModuleKitHelpers for *; + + function setUp() public override { + super.setUp(); + } + + function test_isActivated_ReturnsTrueWhenModuleIsInstalled() public { + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertTrue(isActivated); + } + + function test_isActivated_ReturnsFalseWhenModuleIsInstalled() public { + instance.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); + + bool isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); + } +} From ca8fb13a38e4d874e314394f1572eee84602fa21 Mon Sep 17 00:00:00 2001 From: JohnGuilding Date: Tue, 6 Aug 2024 10:38:20 +0100 Subject: [PATCH 9/9] Remove isActivated check in completeRecovery --- src/EmailRecoveryManager.sol | 6 +----- .../EmailRecoveryManager.integration.t.sol | 4 ++-- test/unit/assertErrorSelectors.t.sol | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/EmailRecoveryManager.sol b/src/EmailRecoveryManager.sol index 31ef8e40..15798f26 100644 --- a/src/EmailRecoveryManager.sol +++ b/src/EmailRecoveryManager.sol @@ -107,7 +107,7 @@ abstract contract EmailRecoveryManager is * @notice Checks if the recovery is activated for a given account * @param account The address of the account for which the activation status is being checked * @return bool True if the recovery request is activated, false otherwise - */ + */ function isActivated(address account) public view override returns (bool) { return guardianConfigs[account].threshold > 0; } @@ -385,10 +385,6 @@ abstract contract EmailRecoveryManager is } RecoveryRequest memory recoveryRequest = recoveryRequests[account]; - if (!isActivated(account)) { - revert RecoveryIsNotActivated(); - } - uint256 threshold = guardianConfigs[account].threshold; if (threshold == 0) { revert NoRecoveryConfigured(); diff --git a/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol b/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol index 47375887..73245faf 100644 --- a/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol +++ b/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol @@ -171,7 +171,7 @@ contract EmailRecoveryManager_Integration_Test is instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); + vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector); emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1); } @@ -219,7 +219,7 @@ contract EmailRecoveryManager_Integration_Test is instance1.uninstallModule(MODULE_TYPE_EXECUTOR, recoveryModuleAddress, ""); vm.stopPrank(); - vm.expectRevert(IEmailRecoveryManager.RecoveryIsNotActivated.selector); + vm.expectRevert(IEmailRecoveryManager.NoRecoveryConfigured.selector); emailRecoveryModule.completeRecovery(accountAddress1, recoveryCalldata1); } diff --git a/test/unit/assertErrorSelectors.t.sol b/test/unit/assertErrorSelectors.t.sol index 6f06493b..00bfbd9f 100644 --- a/test/unit/assertErrorSelectors.t.sol +++ b/test/unit/assertErrorSelectors.t.sol @@ -51,6 +51,7 @@ contract LogErrorSelectors_Test is Test { assertEq(IEmailRecoveryManager.RecoveryRequestExpired.selector, bytes4(0x566ad75e)); assertEq(IEmailRecoveryManager.InvalidCalldataHash.selector, bytes4(0x54d53855)); assertEq(IEmailRecoveryManager.NoRecoveryInProcess.selector, bytes4(0x87434f51)); + assertEq(IEmailRecoveryManager.RecoveryIsNotActivated.selector, bytes4(0xc737140f)); } function test_EmailRecoveryUniversalFactory_AssertSelectors() public {