diff --git a/package.json b/package.json index d98329f..bc3d262 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:rhinestonewtf/modulekit", "@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 8ddd0bc..b4bfee5 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: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 @@ -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} - 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/d961421641b826f6c970e13b0af18111ec10ebad': - resolution: {tarball: https://codeload.github.com/rhinestonewtf/safe7579/tar.gz/d961421641b826f6c970e13b0af18111ec10ebad} + '@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/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/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} @@ -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/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: @@ -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/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f 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/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/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/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 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/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f 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/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)) - '@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/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f 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/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/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f + 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/4d63c978718517fa02d4e330fbe7372dbb06c2f1 + solady: https://codeload.github.com/vectorized/solady/tar.gz/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f 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/e6d2a1c848921ca90a9ddac78ab24ffa5c7fb54f: {} solarray@https://codeload.github.com/sablier-labs/solarray/tar.gz/6bf10cb34cdace52a3ba5fe437e78cc82df92684: {} diff --git a/src/EmailRecoveryManager.sol b/src/EmailRecoveryManager.sol index 7d36cfc..15798f2 100644 --- a/src/EmailRecoveryManager.sol +++ b/src/EmailRecoveryManager.sol @@ -103,6 +103,15 @@ abstract contract EmailRecoveryManager is return recoveryRequests[account]; } + /** + * @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; + } + /** * @notice Returns a two-dimensional array of strings representing the subject templates for an * acceptance by a new guardian. @@ -273,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); @@ -313,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( diff --git a/src/interfaces/IEmailRecoveryManager.sol b/src/interfaces/IEmailRecoveryManager.sol index baed6d9..6edddca 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/modules/EmailRecoveryModule.sol b/src/modules/EmailRecoveryModule.sol index 0fc6f0e..7def95f 100644 --- a/src/modules/EmailRecoveryModule.sol +++ b/src/modules/EmailRecoveryModule.sol @@ -97,7 +97,6 @@ contract EmailRecoveryModule is EmailRecoveryManager, ERC7579ExecutorBase, IEmai ) { revert InvalidValidator(validator); } - configureRecovery(guardians, weights, threshold, delay, expiry); } diff --git a/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol b/test/integration/EmailRecoveryManager/EmailRecoveryManager.integration.t.sol index 71d0873..73245fa 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); } @@ -212,23 +206,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); } diff --git a/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol b/test/integration/OwnableValidatorRecovery/EmailRecoveryModule/EmailRecoveryModule.t.sol index c1cd765..d1aafc3 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 be34f9e..774607e 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); } diff --git a/test/unit/EmailRecoveryManager/acceptGuardian.t.sol b/test/unit/EmailRecoveryManager/acceptGuardian.t.sol index a6d8336..6a505df 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/configureRecovery.t.sol b/test/unit/EmailRecoveryManager/configureRecovery.t.sol index db423c3..9b90b91 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 1780bb4..29ac7b5 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/isActivated.t.sol b/test/unit/EmailRecoveryManager/isActivated.t.sol new file mode 100644 index 0000000..eaf6b86 --- /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); + } +} diff --git a/test/unit/EmailRecoveryManager/processRecovery.t.sol b/test/unit/EmailRecoveryManager/processRecovery.t.sol index a01d7f4..d59c8e1 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/assertErrorSelectors.t.sol b/test/unit/assertErrorSelectors.t.sol index 6f06493..00bfbd9 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 { diff --git a/test/unit/modules/EmailRecoveryModule/onInstall.t.sol b/test/unit/modules/EmailRecoveryModule/onInstall.t.sol index ef6aa14..8cc5d40 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 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 40046a0..807a16f 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 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 9261aa7..32b333d 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 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 ae1a84f..b9611f3 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 isActivated = emailRecoveryModule.isActivated(accountAddress); + assertFalse(isActivated); } }