diff --git a/.github/workflows/build-fmt.yml b/.github/workflows/build-fmt.yml index 0cb1b536..f7008038 100644 --- a/.github/workflows/build-fmt.yml +++ b/.github/workflows/build-fmt.yml @@ -18,17 +18,19 @@ jobs: - uses: Swatinem/rust-cache@v2 - - name: Setup Node.js + - name: Install Node.js uses: actions/setup-node@v3 with: node-version: 18 - cache: "yarn" + + - name: Install yarn + run: npm install -g yarn - name: Install dependencies run: yarn install --frozen-lockfile - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1.2.0 with: version: nightly-0079a1146b79a4aeda58b0258215bedb1f92700b @@ -36,22 +38,6 @@ jobs: working-directory: packages/contracts run: yarn build - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - name: Build and check for warnings env: RUSTFLAGS: "-D warnings" diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f816a17c..eff33c29 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -63,10 +63,6 @@ jobs: working-directory: packages/contracts run: yarn test - - name: Run script tests - working-directory: packages/contracts - run: yarn test:script - relayer: name: relayer runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 09588c48..922eee05 100644 --- a/.gitignore +++ b/.gitignore @@ -31,36 +31,15 @@ packages/contracts/test/build_integration/*.txt packages/contracts/test/test-proofs packages/contracts/deployments -# NFT Relayer -packages/nft_relayer/sendgrid.env -target -packages/nft_relayer/db/* -packages/nft_relayer/*.db -packages/nft_relayer/received_eml/*.eml -packages/nft_relayer/received_eml/*.json -packages/nft_relayer/proofs -packages/nft_relayer/logs -sql_database.db -.sqlx -.ic.pem -config.json - # Relayer -packages/relayer/sendgrid.env target -packages/relayer/db/* -packages/relayer/*.db -packages/relayer/received_eml/*.eml -packages/relayer/received_eml/*.json -packages/relayer/proofs packages/relayer/logs -sql_database.db -.sqlx +packages/relayer/config.json .ic.pem # ABIs packages/relayer/src/abis/* -!packages/realyer/src/abis/mod.rs +!packages/relayer/src/abis/mod.rs # Prover packages/prover/build/* @@ -76,6 +55,9 @@ packages/subgraph/build # Subgraphs packages/subgraph/build +# Kubernetes +secrets.yml + # Mac .DS_Store @@ -88,6 +70,16 @@ book # Editor settings .idea +# Kubernetes +secrets.yml + # For zksync zkout .cache + +# Example +example/contracts/artifacts +example/contracts/cache +example/contracts/node_modules +example/scripts/dist +example/contracts/broadcast \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ae1e9532..ab6d6d0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "Inflector" @@ -45,7 +45,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", "once_cell", "version_check", "zerocopy", @@ -62,9 +61,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "android-tzdata" @@ -83,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.90" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arrayref" @@ -105,18 +104,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - [[package]] name = "ascii-canvas" version = "3.0.0" @@ -126,74 +113,17 @@ dependencies = [ "term", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-imap" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98892ebee4c05fc66757e600a7466f0d9bfcde338f645d64add323789f26cb36" -dependencies = [ - "async-channel 2.3.1", - "base64 0.21.7", - "bytes", - "chrono", - "futures", - "imap-proto", - "log", - "nom", - "once_cell", - "pin-utils", - "self_cell", - "stop-token", - "thiserror", - "tokio", -] - [[package]] name = "async-lock" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] -[[package]] -name = "async-native-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9343dc5acf07e79ff82d0c37899f079db3534d99f189a1837c8e549c99405bec" -dependencies = [ - "native-tls", - "thiserror", - "tokio", - "url", -] - [[package]] name = "async-trait" version = "0.1.83" @@ -202,7 +132,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -226,14 +156,10 @@ dependencies = [ ] [[package]] -name = "atomic-write-file" -version = "0.1.4" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf54d4588732bdfc5ebc3eb9f74f20e027112fc31de412fc7ff0cd1c6896dae" -dependencies = [ - "nix", - "rand", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "auto_impl" @@ -243,7 +169,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -254,18 +180,19 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.1", + "hyper-util", "itoa", "matchit", "memchr", @@ -277,28 +204,33 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.2", "tokio", "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", "futures-util", - "http 0.2.12", - "http-body 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 1.0.2", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -363,6 +295,30 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "bigdecimal" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f850665a0385e070b64c38d2354e6c104c8479c59868d1e48a0c13ee2c7a1c1" +dependencies = [ + "autocfg", + "libm", + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "binread" version = "2.2.0" @@ -496,9 +452,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -534,7 +490,7 @@ dependencies = [ "hashbrown 0.14.5", "instant", "once_cell", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -566,7 +522,7 @@ dependencies = [ "serde", "serde_bytes", "stacker", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -578,14 +534,14 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -601,26 +557,20 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cc" -version = "1.1.31" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", "shlex", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cfdkim" version = "0.3.3" @@ -655,9 +605,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "charset" @@ -684,12 +634,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "chunked_transfer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" - [[package]] name = "cipher" version = "0.4.4" @@ -713,7 +657,7 @@ dependencies = [ "k256", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -729,7 +673,7 @@ dependencies = [ "pbkdf2 0.12.2", "rand", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -749,30 +693,7 @@ dependencies = [ "serde_derive", "sha2 0.10.8", "sha3", - "thiserror", -] - -[[package]] -name = "combine" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" -dependencies = [ - "ascii 0.9.3", - "byteorder", - "either", - "memchr", - "unreachable", -] - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", + "thiserror 1.0.69", ] [[package]] @@ -796,9 +717,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -843,9 +764,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -978,7 +899,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -1022,13 +943,22 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -1095,10 +1025,15 @@ dependencies = [ ] [[package]] -name = "dotenv" -version = "0.15.0" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] [[package]] name = "dotenvy" @@ -1147,7 +1082,7 @@ dependencies = [ "rand_core", "serde", "sha2 0.9.9", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -1195,21 +1130,31 @@ dependencies = [ ] [[package]] -name = "email-encoding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a87260449b06739ee78d6281c68d2a0ff3e3af64a78df63d3a1aeb3c06997c8a" +name = "email-tx-builder-relayer" +version = "0.1.0" dependencies = [ - "base64 0.22.1", - "memchr", + "anyhow", + "axum", + "bigdecimal 0.3.1", + "candid", + "chrono", + "ethers", + "handlebars", + "ic-agent", + "ic-utils", + "lazy_static", + "regex", + "relayer-utils", + "reqwest 0.12.9", + "serde", + "serde_json", + "slog", + "sqlx", + "tokio", + "tower-http", + "uuid 1.11.0", ] -[[package]] -name = "email_address" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" - [[package]] name = "ena" version = "0.14.3" @@ -1221,9 +1166,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1266,12 +1211,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1303,7 +1248,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sha3", - "thiserror", + "thiserror 1.0.69", "uuid 0.8.2", ] @@ -1320,7 +1265,7 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror", + "thiserror 1.0.69", "uint", ] @@ -1399,7 +1344,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1421,7 +1366,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.82", + "syn 2.0.90", "toml", "walkdir", ] @@ -1439,7 +1384,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -1465,9 +1410,9 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.82", + "syn 2.0.90", "tempfile", - "thiserror", + "thiserror 1.0.69", "tiny-keccak", "unicode-xid", ] @@ -1484,7 +1429,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1508,7 +1453,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "tracing-futures", @@ -1540,7 +1485,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-tungstenite", "tracing", @@ -1567,7 +1512,7 @@ dependencies = [ "ethers-core", "rand", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1595,7 +1540,7 @@ dependencies = [ "serde_json", "solang-parser", "svm-rs", - "thiserror", + "thiserror 1.0.69", "tiny-keccak", "tokio", "tracing", @@ -1603,12 +1548,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.3.1" @@ -1622,11 +1561,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.3.1", + "event-listener", "pin-project-lite", ] @@ -1653,18 +1592,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "ff" @@ -1713,9 +1643,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1828,7 +1758,7 @@ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.12.3", + "parking_lot", ] [[package]] @@ -1855,7 +1785,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -1955,65 +1885,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "graphql-introspection-query" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" -dependencies = [ - "serde", -] - -[[package]] -name = "graphql-parser" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" -dependencies = [ - "combine 3.8.1", - "thiserror", -] - -[[package]] -name = "graphql_client" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cdf7b487d864c2939b23902291a5041bc4a84418268f25fda1c8d4e15ad8fa" -dependencies = [ - "graphql_query_derive", - "reqwest 0.11.27", - "serde", - "serde_json", -] - -[[package]] -name = "graphql_client_codegen" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40f793251171991c4eb75bd84bc640afa8b68ff6907bc89d3b712a22f700506" -dependencies = [ - "graphql-introspection-query", - "graphql-parser", - "heck 0.4.1", - "lazy_static", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 1.0.109", -] - -[[package]] -name = "graphql_query_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bda454f3d313f909298f626115092d348bc231025699f557b27e248475f48c" -dependencies = [ - "graphql_client_codegen", - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "group" version = "0.13.0" @@ -2037,7 +1908,26 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2091,16 +1981,17 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "fd4ccde012831f9a071a637b0d4e31df31c0f6c525784b35ae76a9ac6bc1e315" dependencies = [ "log", + "num-order", "pest", "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2121,9 +2012,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hashers" @@ -2136,9 +2027,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] @@ -2148,9 +2039,6 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -2297,14 +2185,14 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", "tower-service", "tracing", @@ -2313,16 +2201,18 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.7", "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2352,14 +2242,14 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-util", - "rustls 0.23.15", + "rustls 0.23.19", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.6", + "webpki-roots 0.26.7", ] [[package]] @@ -2376,19 +2266,35 @@ dependencies = [ ] [[package]] -name = "hyper-util" -version = "0.1.9" +name = "hyper-tls" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", - "futures-channel", - "futures-util", + "http-body-util", + "hyper 1.5.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.5.1", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", "tower-service", "tracing", @@ -2442,7 +2348,7 @@ dependencies = [ "pkcs8", "rand", "rangemap", - "reqwest 0.12.8", + "reqwest 0.12.9", "ring 0.17.8", "rustls-webpki 0.102.8", "sec1", @@ -2452,7 +2358,7 @@ dependencies = [ "serde_repr", "sha2 0.10.8", "simple_asn1", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "url", @@ -2484,7 +2390,7 @@ dependencies = [ "serde_bytes", "serde_repr", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2504,7 +2410,7 @@ dependencies = [ "sha2 0.10.8", "strum", "strum_macros", - "thiserror", + "thiserror 1.0.69", "time", "tokio", ] @@ -2547,47 +2453,157 @@ dependencies = [ "data-encoding", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", ] [[package]] -name = "idna" -version = "0.2.3" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ + "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "imap-proto" -version = "0.16.5" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de555d9526462b6f9ece826a26fb7c67eca9a0245bd9ff84fa91972a5d5d8856" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "nom", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2619,13 +2635,13 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -2646,12 +2662,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] @@ -2678,7 +2694,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.7", + "socket2", "widestring", "windows-sys 0.48.0", "winreg", @@ -2730,31 +2746,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine 4.6.7", - "jni-sys", - "log", - "thiserror", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -2767,10 +2761,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -2856,43 +2851,17 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" -[[package]] -name = "lettre" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bd09637ae3ec7bd605b8e135e757980b3968430ff2b1a4a94fb7769e50166d" -dependencies = [ - "async-trait", - "base64 0.21.7", - "email-encoding", - "email_address", - "fastrand 1.9.0", - "futures-io", - "futures-util", - "hostname", - "httpdate", - "idna 0.3.0", - "mime", - "native-tls", - "nom", - "once_cell", - "quoted_printable 0.4.8", - "socket2 0.4.10", - "tokio", - "tokio-native-tls", -] - [[package]] name = "libc" -version = "0.2.161" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -2906,9 +2875,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.27.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", @@ -2927,6 +2896,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -2960,16 +2935,7 @@ checksum = "3da03d5980411a724e8aaf7b61a7b5e386ec55a7fb49ee3d0ff79efc7e5e7c7e" dependencies = [ "charset", "data-encoding", - "quoted_printable 0.5.1", -] - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", + "quoted_printable", ] [[package]] @@ -3014,9 +2980,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minicov" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" dependencies = [ "cc", "walkdir", @@ -3039,11 +3005,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -3066,30 +3031,12 @@ dependencies = [ "tempfile", ] -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - [[package]] name = "new_debug_unreachable" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -3108,7 +3055,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand", "serde", ] @@ -3156,6 +3102,21 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" +dependencies = [ + "num-modular", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -3194,36 +3155,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.82", -] - -[[package]] -name = "oauth2" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c38841cdd844847e3e7c8d29cef9dcfed8877f8f56f9071f77843ecf3baf937f" -dependencies = [ - "base64 0.13.1", - "chrono", - "getrandom", - "http 0.2.12", - "rand", - "reqwest 0.11.27", - "serde", - "serde_json", - "serde_path_to_error", - "sha2 0.10.8", - "thiserror", - "url", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", + "syn 2.0.90", ] [[package]] @@ -3295,7 +3227,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -3345,28 +3277,29 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" dependencies = [ "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -3375,17 +3308,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -3393,21 +3315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -3418,7 +3326,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -3524,7 +3432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] @@ -3548,7 +3456,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -3569,7 +3477,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.7.0", ] [[package]] @@ -3612,7 +3520,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -3635,29 +3543,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -3701,7 +3609,7 @@ dependencies = [ "halo2curves", "once_cell", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3738,12 +3646,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -3780,9 +3688,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -3805,9 +3713,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" dependencies = [ "cc", ] @@ -3826,48 +3734,52 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.15", - "socket2 0.5.7", - "thiserror", + "rustls 0.23.19", + "socket2", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.15", + "rustls 0.23.19", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", - "socket2 0.5.7", + "socket2", "tracing", "windows-sys 0.59.0", ] @@ -3881,12 +3793,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "quoted_printable" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" - [[package]] name = "quoted_printable" version = "0.5.1" @@ -3944,12 +3850,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "rayon" version = "1.10.0" @@ -3970,15 +3870,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.7" @@ -3996,14 +3887,14 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -4013,9 +3904,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -4028,59 +3919,10 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "relayer" -version = "1.0.3" -dependencies = [ - "anyhow", - "async-imap", - "async-native-tls", - "async-trait", - "axum", - "base64 0.21.7", - "candid", - "chrono", - "dotenv", - "ethers", - "ff", - "file-rotate", - "futures", - "graphql_client", - "handlebars", - "hex", - "http 1.1.0", - "ic-agent", - "ic-utils", - "lazy_static", - "lettre", - "num-bigint", - "num-traits", - "oauth2", - "rand", - "regex", - "relayer-utils", - "reqwest 0.11.27", - "rustc-hex", - "serde", - "serde_json", - "sled", - "slog", - "slog-async", - "slog-json", - "slog-term", - "sqlx", - "thiserror", - "tiny_http", - "tokio", - "tower-http", - "uuid 1.11.0", - "webbrowser", -] - [[package]] name = "relayer-utils" version = "0.4.2" -source = "git+https://github.com/zkemail/relayer-utils.git#298a0f90c49b232fd749a4a361c4999a83c713c4" +source = "git+https://github.com/zkemail/relayer-utils.git?branch=main#0663df1271beac13ec14c731ee1ce7ae4be54d16" dependencies = [ "anyhow", "base64 0.22.1", @@ -4124,12 +3966,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.31", "hyper-rustls 0.24.2", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -4144,7 +3986,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", @@ -4159,37 +4001,43 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", + "encoding_rs", "futures-channel", "futures-core", "futures-util", + "h2 0.4.7", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-rustls 0.27.3", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.15", + "rustls 0.23.19", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", + "system-configuration 0.6.1", "tokio", + "tokio-native-tls", "tokio-rustls 0.26.0", "tokio-util", "tower-service", @@ -4198,7 +4046,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.6", + "webpki-roots 0.26.7", "windows-registry", ] @@ -4285,9 +4133,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" dependencies = [ "const-oid", "digest 0.10.7", @@ -4313,9 +4161,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc-hex" @@ -4334,9 +4182,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -4359,9 +4207,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.15" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "once_cell", "ring 0.17.8", @@ -4394,6 +4242,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -4448,9 +4299,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ "cfg-if", "derive_more", @@ -4460,21 +4311,21 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -4542,20 +4393,14 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", ] -[[package]] -name = "self_cell" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" - [[package]] name = "semver" version = "1.0.23" @@ -4579,9 +4424,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.211" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -4618,20 +4463,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.211" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -4657,7 +4502,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -4770,7 +4615,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -4786,23 +4631,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg", -] - -[[package]] -name = "sled" -version = "0.34.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" -dependencies = [ - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", - "log", - "parking_lot 0.11.2", + "autocfg", ] [[package]] @@ -4853,22 +4682,15 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ - "libc", - "winapi", + "serde", ] [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4884,7 +4706,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "phf", - "thiserror", + "thiserror 1.0.69", "unicode-xid", ] @@ -4925,9 +4747,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -4938,30 +4760,30 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ - "ahash", "atoi", + "bigdecimal 0.4.6", "byteorder", "bytes", + "chrono", "crc", "crossbeam-queue", - "dotenvy", "either", - "event-listener 2.5.3", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "log", "memchr", - "native-tls", "once_cell", "paste", "percent-encoding", @@ -4970,36 +4792,37 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.69", + "time", "tokio", "tokio-stream", "tracing", "url", + "uuid 1.11.0", ] [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ - "atomic-write-file", "dotenvy", "either", - "heck 0.4.1", + "heck 0.5.0", "hex", "once_cell", "proc-macro2", @@ -5011,7 +4834,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 1.0.109", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -5019,15 +4842,17 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", + "bigdecimal 0.4.6", "bitflags 2.6.0", "byteorder", "bytes", + "chrono", "crc", "digest 0.10.7", "dotenvy", @@ -5054,21 +4879,25 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", + "time", "tracing", + "uuid 1.11.0", "whoami", ] [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", + "bigdecimal 0.4.6", "bitflags 2.6.0", "byteorder", + "chrono", "crc", "dotenvy", "etcetera", @@ -5084,27 +4913,30 @@ dependencies = [ "log", "md-5", "memchr", + "num-bigint", "once_cell", "rand", "serde", "serde_json", - "sha1", "sha2 0.10.8", "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", + "time", "tracing", + "uuid 1.11.0", "whoami", ] [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", + "chrono", "flume", "futures-channel", "futures-core", @@ -5115,12 +4947,20 @@ dependencies = [ "log", "percent-encoding", "serde", + "serde_urlencoded", "sqlx-core", + "time", "tracing", "url", - "urlencoding", + "uuid 1.11.0", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "stacker" version = "0.1.17" @@ -5140,18 +4980,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stop-token" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af91f480ee899ab2d9f8435bfdfc14d08a5754bd9d3fef1f1a1c23336aad6c8b" -dependencies = [ - "async-channel 1.9.0", - "cfg-if", - "futures-core", - "pin-project-lite", -] - [[package]] name = "string_cache" version = "0.8.7" @@ -5160,7 +4988,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "phf_shared 0.10.0", "precomputed-hash", ] @@ -5195,7 +5023,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -5225,7 +5053,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "url", "zip", ] @@ -5243,9 +5071,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.82" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -5260,13 +5088,24 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -5275,7 +5114,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -5288,6 +5138,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -5302,12 +5162,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand", "once_cell", "rustix", "windows-sys 0.59.0", @@ -5326,22 +5186,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.3", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -5395,15 +5275,13 @@ dependencies = [ ] [[package]] -name = "tiny_http" -version = "0.12.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "ascii 1.1.0", - "chunked_transfer", - "httpdate", - "log", + "displaydoc", + "zerovec", ] [[package]] @@ -5423,18 +5301,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -5447,7 +5325,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] @@ -5476,7 +5354,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.15", + "rustls 0.23.19", "rustls-pki-types", "tokio", ] @@ -5547,7 +5425,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -5556,14 +5434,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ "futures-core", "futures-util", - "pin-project", "pin-project-lite", + "sync_wrapper 0.1.2", "tokio", "tower-layer", "tower-service", @@ -5572,15 +5450,13 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.2" -source = "git+https://github.com/tower-rs/tower-http.git?rev=f33c3e038dc85b8d064541e915d501f9c9e6a6b4#f33c3e038dc85b8d064541e915d501f9c9e6a6b4" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "bitflags 2.6.0", "bytes", - "futures-core", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", + "http 1.1.0", "pin-project-lite", "tower-layer", "tower-service", @@ -5600,9 +5476,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -5612,20 +5488,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -5658,7 +5534,7 @@ dependencies = [ "lazy_static", "rand", "smallvec", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -5676,10 +5552,10 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.3", + "parking_lot", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "trust-dns-proto", @@ -5706,7 +5582,7 @@ dependencies = [ "rand", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -5755,9 +5631,9 @@ checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -5774,12 +5650,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-width" version = "0.1.14" @@ -5798,15 +5668,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - [[package]] name = "unroll" version = "0.1.5" @@ -5831,28 +5692,33 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", - "serde", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf-8" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" version = "0.8.2" @@ -5868,6 +5734,10 @@ name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "getrandom", + "serde", +] [[package]] name = "vcpkg" @@ -5881,12 +5751,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "walkdir" version = "2.5.0" @@ -5920,9 +5784,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -5933,36 +5797,37 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5970,32 +5835,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wasm-bindgen-test" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" +checksum = "3d919bb60ebcecb9160afee6c71b43a58a4f0517a2de0054cd050d02cec08201" dependencies = [ - "console_error_panic_hook", "js-sys", "minicov", + "once_cell", "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", @@ -6004,20 +5869,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" +checksum = "222ebde6ea87fbfa6bdd2e9f1fd8a91d60aee5db68792632176c4e16a74fc7d8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", ] [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -6028,29 +5893,22 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "webbrowser" -version = "0.8.15" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db67ae75a9405634f5882791678772c94ff5f16a66535aae186e26aa0841fc8b" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "core-foundation", - "home", - "jni", - "log", - "ndk-context", - "objc", - "raw-window-handle", - "url", - "web-sys", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -6061,9 +5919,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -6074,7 +5932,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.5.7", + "redox_syscall", "wasite", ] @@ -6154,15 +6012,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6190,21 +6039,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -6236,12 +6070,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6254,12 +6082,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6272,12 +6094,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6296,12 +6112,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6314,12 +6124,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6332,12 +6136,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6350,12 +6148,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -6387,6 +6179,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -6400,7 +6204,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -6421,6 +6225,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -6439,7 +6267,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.82", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", ] [[package]] @@ -6448,6 +6297,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zip" version = "0.6.6" @@ -6470,8 +6341,8 @@ dependencies = [ [[package]] name = "zk-regex-apis" -version = "2.2.0" -source = "git+https://github.com/zkemail/zk-regex.git#3319327ef3599989071ab2ea3cb9340a2c48b354" +version = "2.3.1" +source = "git+https://github.com/zkemail/zk-regex.git#7002a2179e076449b84e3e7e8ba94e88d0a2dc2f" dependencies = [ "fancy-regex", "itertools 0.13.0", @@ -6479,7 +6350,7 @@ dependencies = [ "serde", "serde-wasm-bindgen", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-test", ] diff --git a/SMTP.Dockerfile b/SMTP.Dockerfile index 8fd59e6b..b64fc25f 100644 --- a/SMTP.Dockerfile +++ b/SMTP.Dockerfile @@ -5,7 +5,7 @@ FROM rust:latest WORKDIR /app # Clone the GitHub repository -RUN git clone https://github.com/zkemail/relayer-smtp.git +RUN git clone https://github.com/zkfriendly/relayer-smtp.git # Change to the directory of the cloned repository WORKDIR /app/relayer-smtp diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..ba0ec548 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,62 @@ +# Docker Compose configuration for local development environment +# This setup provides a playground environment for developing and testing the relayer +# It includes: +# - A PostgreSQL database for storing relayer data +# - The relayer service built from local source code +version: '3.8' + +services: + db: + image: postgres:15 + environment: + POSTGRES_USER: relayer + POSTGRES_PASSWORD: relayer_password + POSTGRES_DB: relayer + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U relayer" ] + interval: 5s + timeout: 5s + retries: 5 + + smtp: + build: + context: . + dockerfile: SMTP.Dockerfile + environment: + - SERVER_HOST=${SMTP_INTERNAL_SERVER_HOST} + - SERVER_PORT=${SMTP_INTERNAL_SERVER_PORT} + - SMTP_DOMAIN_NAME=${SMTP_DOMAIN_NAME} + - SMTP_LOGIN_ID=${SMTP_LOGIN_ID} + - SMTP_LOGIN_PASSWORD=${SMTP_LOGIN_PASSWORD} + - MESSAGE_ID_DOMAIN=${SMTP_MESSAGE_ID_DOMAIN} + - JSON_LOGGER=${SMPT_JSON_LOGGER} + ports: + - "${SMTP_PORT}:${SMTP_INTERNAL_SERVER_PORT}" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:${SMTP_INTERNAL_SERVER_PORT}/api/ping" ] + interval: 1m30s + timeout: 30s + retries: 5 + start_period: 30s + + imap: + build: + context: . + dockerfile: IMAP.Dockerfile + environment: + - RELAYER_ENDPOINT=http://host.docker.internal:8000/api/receiveEmail + - IMAP_LOGIN_ID=${IMAP_LOGIN_ID} + - IMAP_LOGIN_PASSWORD=${IMAP_LOGIN_PASSWORD} + - IMAP_DOMAIN_NAME=${IMAP_DOMAIN_NAME} + - IMAP_PORT=${IMAP_PORT} + - AUTH_TYPE=${IMAP_AUTH_TYPE} + - JSON_LOGGER=${IMAP_JSON_LOGGER} + extra_hosts: + - "host.docker.internal:host-gateway" + +volumes: + postgres_data: diff --git a/infrastructure/README.md b/infrastructure/README.md deleted file mode 100644 index e62de821..00000000 --- a/infrastructure/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Infrastructure Management Scripts - -This document provides instructions on how to use the provided scripts to apply metrics and alerts to your Google Cloud Platform (GCP) environment. - -## Prerequisites - -- Ensure you have the [Google Cloud SDK](https://cloud.google.com/sdk) installed and authenticated. -- Make sure `jq` is installed for JSON processing. - -## Applying Metrics - -To apply a specific metric from a JSON file, use the `apply_metric.sh` script. This script reads the metric configuration from the specified JSON file and applies it to your GCP project. - -### Usage - -```bash -cd /path/to/your/project/infrastructure/metrics -./apply_metric.sh metric_file.json -``` - -- Replace `/path/to/your/project` with the root directory of your project. -- Replace `metric_file.json` with the path to the metric JSON file in the metrics directory. - -## Applying Alerts - -To apply a specific alert policy from a JSON file, use the `apply_alert.sh` script. This script reads the alert policy configuration from the specified JSON file and applies it to your GCP project. - -### Usage - -```bash -cd /path/to/your/project/infrastructure/alerts -./apply_alert.sh alert_file.json -``` - -- Replace `/path/to/your/project` with the root directory of your project. -- Replace `alert_file.json` with the path to your alert policy JSON file in the alerts directory. - -## Additional Notes - -- Ensure that you have the necessary permissions to apply metrics and alerts in your GCP project. -- If you encounter any errors, refer to the script logs for more details. diff --git a/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(Base_Sepolia).json b/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(Base_Sepolia).json deleted file mode 100644 index 337ff318..00000000 --- a/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(Base_Sepolia).json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "604800s", - "notificationPrompts": [ - "OPENED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "300s", - "perSeriesAligner": "ALIGN_FRACTION_TRUE" - } - ], - "comparison": "COMPARISON_LT", - "duration": "0s", - "filter": "resource.type = \"uptime_url\" AND resource.labels.host = \"auth-base-sepolia-staging.prove.email\" AND metric.type = \"monitoring.googleapis.com/uptime_check/check_passed\"", - "thresholdValue": 0.9, - "trigger": { - "count": 1 - } - }, - "displayName": "Uptime Check URL - Check passed", - "name": "projects/zkairdrop/alertPolicies/14540598362673761778/conditions/9717783705450711541" - } - ], - "displayName": "Uptime Check for AR Relayer (Base Sepolia)", - "documentation": { - "content": "Uptime check failed for account recovery relayer (Base Sepolia).", - "mimeType": "text/markdown", - "subject": "Uptime Check Failed for AR Base Sepolia Relayer" - }, - "enabled": true, - "name": "projects/zkairdrop/alertPolicies/14540598362673761778", - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/8151570453739639273", - "projects/zkairdrop/notificationChannels/7073288447352854381", - "projects/zkairdrop/notificationChannels/2385336445405127098", - "projects/zkairdrop/notificationChannels/17871058532858569683", - "projects/zkairdrop/notificationChannels/13717630568524701111" - ], - "severity": "WARNING" -} \ No newline at end of file diff --git a/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(ZKsync_Sepolia).json b/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(ZKsync_Sepolia).json deleted file mode 100644 index 387e43c5..00000000 --- a/infrastructure/alerts/Uptime_Check_for_AR_Relayer_(ZKsync_Sepolia).json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "604800s", - "notificationPrompts": [ - "OPENED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "300s", - "perSeriesAligner": "ALIGN_FRACTION_TRUE" - } - ], - "comparison": "COMPARISON_LT", - "duration": "0s", - "filter": "resource.type = \"uptime_url\" AND resource.labels.host = \"auth-zksync-sepolia-staging.prove.email\" AND metric.type = \"monitoring.googleapis.com/uptime_check/check_passed\"", - "thresholdValue": 0.9, - "trigger": { - "count": 1 - } - }, - "displayName": "Uptime Check URL - Check passed", - "name": "projects/zkairdrop/alertPolicies/1785328578980889069/conditions/12793827239849115908" - } - ], - "displayName": "Uptime Check for AR Relayer (ZKsync Sepolia)", - "documentation": { - "content": "Uptime check failed for account recovery relayer (ZKsync Sepolia).", - "mimeType": "text/markdown", - "subject": "Uptime Check Failed for AR ZKsync Sepolia Relayer" - }, - "enabled": true, - "name": "projects/zkairdrop/alertPolicies/1785328578980889069", - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/13717630568524701111", - "projects/zkairdrop/notificationChannels/17871058532858569683", - "projects/zkairdrop/notificationChannels/2385336445405127098", - "projects/zkairdrop/notificationChannels/7073288447352854381", - "projects/zkairdrop/notificationChannels/8151570453739639273" - ], - "severity": "WARNING" -} \ No newline at end of file diff --git a/infrastructure/alerts/Uptime_Check_for_Email_Wallet_Relayer.json b/infrastructure/alerts/Uptime_Check_for_Email_Wallet_Relayer.json deleted file mode 100644 index 1b9974cc..00000000 --- a/infrastructure/alerts/Uptime_Check_for_Email_Wallet_Relayer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "604800s", - "notificationPrompts": [ - "OPENED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "300s", - "perSeriesAligner": "ALIGN_FRACTION_TRUE" - } - ], - "comparison": "COMPARISON_LT", - "duration": "0s", - "filter": "resource.type = \"uptime_url\" AND resource.labels.host = \"relayerapi.emailwallet.org\" AND metric.type = \"monitoring.googleapis.com/uptime_check/check_passed\"", - "thresholdValue": 0.9, - "trigger": { - "count": 1 - } - }, - "displayName": "Uptime Check URL - Check passed", - "name": "projects/zkairdrop/alertPolicies/8542470102587481494/conditions/1395222843874964873" - } - ], - "displayName": "Uptime Check for Email Wallet Relayer", - "documentation": { - "content": "Uptime check failed for email wallet relayer.", - "mimeType": "text/markdown", - "subject": "Uptime Check Failed for Email Wallet" - }, - "enabled": true, - "name": "projects/zkairdrop/alertPolicies/8542470102587481494", - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/13717630568524701111", - "projects/zkairdrop/notificationChannels/2385336445405127098", - "projects/zkairdrop/notificationChannels/7073288447352854381", - "projects/zkairdrop/notificationChannels/8151570453739639273", - "projects/zkairdrop/notificationChannels/17871058532858569683" - ], - "severity": "WARNING" -} \ No newline at end of file diff --git a/infrastructure/alerts/apply_alert.sh b/infrastructure/alerts/apply_alert.sh deleted file mode 100755 index 6b5002fe..00000000 --- a/infrastructure/alerts/apply_alert.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Check if a file name is provided -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit 1 -fi - -FILE_NAME=$1 - -# Check if the file exists -if [ ! -f "$FILE_NAME" ]; then - echo "Error: File '$FILE_NAME' does not exist." - exit 1 -fi - -# Extract the display name from the JSON file -DISPLAY_NAME=$(jq -r '.displayName' "$FILE_NAME") - -# Create the alert policy using gcloud -gcloud alpha monitoring policies create --policy-from-file="$FILE_NAME" - -# Check if gcloud was successful -if [ $? -eq 0 ]; then - echo "Alert policy '$DISPLAY_NAME' applied successfully." -else - echo "Error applying alert policy '$DISPLAY_NAME'." - exit 1 -fi \ No newline at end of file diff --git a/infrastructure/alerts/logging_user_error-from-prover_[SUM].json b/infrastructure/alerts/logging_user_error-from-prover_[SUM].json deleted file mode 100644 index 33992920..00000000 --- a/infrastructure/alerts/logging_user_error-from-prover_[SUM].json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "1800s", - "notificationPrompts": [ - "OPENED", - "CLOSED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "60s", - "crossSeriesReducer": "REDUCE_SUM", - "perSeriesAligner": "ALIGN_COUNT" - } - ], - "comparison": "COMPARISON_GT", - "duration": "0s", - "filter": "metric.type=\"logging.googleapis.com/user/error-from-prover\" AND resource.type=\"k8s_container\"", - "trigger": { - "count": 1 - } - }, - "displayName": "logging/user/error-from-prover [SUM]" - } - ], - "displayName": "logging/user/error-from-prover [SUM]", - "documentation": { - "content": "This error happens when the prover get some error", - "mimeType": "text/markdown" - }, - "enabled": true, - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/16929435408944174030" - ], - "severity": "ERROR" -} \ No newline at end of file diff --git a/infrastructure/alerts/logging_user_error-handling-email-event_[SUM].json b/infrastructure/alerts/logging_user_error-handling-email-event_[SUM].json deleted file mode 100644 index 5eb0067f..00000000 --- a/infrastructure/alerts/logging_user_error-handling-email-event_[SUM].json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "1800s", - "notificationPrompts": [ - "OPENED", - "CLOSED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "60s", - "crossSeriesReducer": "REDUCE_SUM", - "perSeriesAligner": "ALIGN_COUNT" - } - ], - "comparison": "COMPARISON_GT", - "duration": "0s", - "filter": "resource.type = \"k8s_container\" AND metric.type = \"logging.googleapis.com/user/error-handling-email-event\" AND resource.type=\"k8s_container\"", - "trigger": { - "count": 1 - } - }, - "displayName": "logging/user/error-handling-email-event [SUM]" - } - ], - "displayName": "logging/user/error-handling-email-event [SUM]", - "documentation": { - "content": "This error happens when the relayer get in trouble about sending mail", - "mimeType": "text/markdown", - "subject": "error-handling-email-event" - }, - "enabled": true, - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/16929435408944174030" - ], - "severity": "WARNING" -} \ No newline at end of file diff --git a/infrastructure/alerts/logging_user_error-handling-email_[SUM].json b/infrastructure/alerts/logging_user_error-handling-email_[SUM].json deleted file mode 100644 index 8434fd60..00000000 --- a/infrastructure/alerts/logging_user_error-handling-email_[SUM].json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "alertStrategy": { - "autoClose": "1800s", - "notificationPrompts": [ - "OPENED", - "CLOSED" - ] - }, - "combiner": "OR", - "conditions": [ - { - "conditionThreshold": { - "aggregations": [ - { - "alignmentPeriod": "60s", - "crossSeriesReducer": "REDUCE_SUM", - "perSeriesAligner": "ALIGN_COUNT" - } - ], - "comparison": "COMPARISON_GT", - "duration": "0s", - "filter": "resource.type = \"k8s_container\" AND metric.type = \"logging.googleapis.com/user/error-handling-email\" AND resource.type=\"k8s_container\"", - "trigger": { - "count": 1 - } - }, - "displayName": "logging/user/error-handling-email [SUM]" - } - ], - "displayName": "logging/user/error-handling-email [SUM]", - "documentation": { - "content": "This error happens when the relayer got the contract call error or the zkregx errors.", - "mimeType": "text/markdown", - "subject": "error-handling-email" - }, - "enabled": true, - "notificationChannels": [ - "projects/zkairdrop/notificationChannels/16929435408944174030" - ], - "severity": "WARNING" -} \ No newline at end of file diff --git a/infrastructure/metrics/apply_metric.sh b/infrastructure/metrics/apply_metric.sh deleted file mode 100755 index d4619a11..00000000 --- a/infrastructure/metrics/apply_metric.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Check if a file name is provided -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit 1 -fi - -FILE_NAME=$1 - -# Check if the file exists -if [ ! -f "$FILE_NAME" ]; then - echo "Error: File '$FILE_NAME' does not exist." - exit 1 -fi - -# Extract the metric name using jq -METRIC_NAME=$(jq -r '.name' "$FILE_NAME") - -# Check if jq was successful -if [ -z "$METRIC_NAME" ]; then - echo "Error: Could not extract metric name from '$FILE_NAME'." - exit 1 -fi - -# Apply the metric using gcloud -gcloud logging metrics create "$METRIC_NAME" --config-from-file="$FILE_NAME" - -# Check if gcloud was successful -if [ $? -eq 0 ]; then - echo "Metric '$METRIC_NAME' applied successfully." -else - echo "Error applying metric '$METRIC_NAME'." - exit 1 -fi \ No newline at end of file diff --git a/infrastructure/metrics/contract-call-reverted-with-data.json b/infrastructure/metrics/contract-call-reverted-with-data.json deleted file mode 100644 index a2f500df..00000000 --- a/infrastructure/metrics/contract-call-reverted-with-data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "createTime": "2024-10-30T08:54:25.988017294Z", - "description": "The error of relayer calling contract in ar-base-sepolia", - "filter": "resource.type=\"k8s_container\"\nresource.labels.container_name=\"relayer-container\"\nresource.labels.namespace_name=\"ar-base-sepolia\"\n\"Contract call reverted with data\"\n", - "metricDescriptor": { - "description": "The error of relayer calling contract in ar-base-sepolia", - "metricKind": "DELTA", - "name": "projects/zkairdrop/metricDescriptors/logging.googleapis.com/user/contract-call-reverted-with-data", - "type": "logging.googleapis.com/user/contract-call-reverted-with-data", - "unit": "1", - "valueType": "INT64" - }, - "name": "contract-call-reverted-with-data", - "resourceName": "projects/zkairdrop/metrics/contract-call-reverted-with-data", - "updateTime": "2024-10-30T08:54:25.988017294Z" -} \ No newline at end of file diff --git a/infrastructure/metrics/error-from-prover.json b/infrastructure/metrics/error-from-prover.json deleted file mode 100644 index 4b800bad..00000000 --- a/infrastructure/metrics/error-from-prover.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "createTime": "2024-10-30T09:37:19.291096099Z", - "filter": "SEARCH(\"`ether-email-auth-prover`\")\nseverity=ERROR", - "metricDescriptor": { - "metricKind": "DELTA", - "name": "projects/zkairdrop/metricDescriptors/logging.googleapis.com/user/error-from-prover", - "type": "logging.googleapis.com/user/error-from-prover", - "unit": "1", - "valueType": "INT64" - }, - "name": "error-from-prover", - "resourceName": "projects/zkairdrop/metrics/error-from-prover", - "updateTime": "2024-10-30T09:37:19.291096099Z" -} \ No newline at end of file diff --git a/infrastructure/metrics/error-handling-email-event.json b/infrastructure/metrics/error-handling-email-event.json deleted file mode 100644 index 7b0cedd2..00000000 --- a/infrastructure/metrics/error-handling-email-event.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "createTime": "2024-10-30T09:19:28.911872031Z", - "filter": "resource.type=\"k8s_container\"\nresource.labels.container_name=\"relayer-container\"\nresource.labels.namespace_name=\"ar-base-sepolia\"\n\"Error handling email event:\"\n", - "metricDescriptor": { - "metricKind": "DELTA", - "name": "projects/zkairdrop/metricDescriptors/logging.googleapis.com/user/error-handling-email-event", - "type": "logging.googleapis.com/user/error-handling-email-event", - "unit": "1", - "valueType": "INT64" - }, - "name": "error-handling-email-event", - "resourceName": "projects/zkairdrop/metrics/error-handling-email-event", - "updateTime": "2024-10-30T09:19:28.911872031Z" -} \ No newline at end of file diff --git a/infrastructure/metrics/error-handling-email.json b/infrastructure/metrics/error-handling-email.json deleted file mode 100644 index 53b73e58..00000000 --- a/infrastructure/metrics/error-handling-email.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "createTime": "2024-10-30T09:14:37.273651500Z", - "filter": "resource.type=\"k8s_container\"\nresource.labels.container_name=\"relayer-container\"\nresource.labels.namespace_name=\"ar-base-sepolia\"\n\"Error handling email:\"\n", - "metricDescriptor": { - "metricKind": "DELTA", - "name": "projects/zkairdrop/metricDescriptors/logging.googleapis.com/user/error-handling-email", - "type": "logging.googleapis.com/user/error-handling-email", - "unit": "1", - "valueType": "INT64" - }, - "name": "error-handling-email", - "resourceName": "projects/zkairdrop/metrics/error-handling-email", - "updateTime": "2024-10-30T09:14:37.273651500Z" -} \ No newline at end of file diff --git a/kubernetes/cronjob.yml b/kubernetes/cronjob.yml index 94af6abd..67ad1e2b 100644 --- a/kubernetes/cronjob.yml +++ b/kubernetes/cronjob.yml @@ -2,12 +2,12 @@ apiVersion: v1 kind: ServiceAccount metadata: name: cronjob-service-account - namespace: ar-base-sepolia + namespace: email-tx-auth --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - namespace: ar-base-sepolia + namespace: email-tx-auth name: deployment-restart-role rules: - apiGroups: ["apps", "extensions"] @@ -18,11 +18,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: deployment-restart-rolebinding - namespace: ar-base-sepolia + namespace: email-tx-auth subjects: - kind: ServiceAccount name: cronjob-service-account - namespace: ar-base-sepolia + namespace: email-tx-auth roleRef: kind: Role name: deployment-restart-role @@ -32,7 +32,7 @@ apiVersion: batch/v1 kind: CronJob metadata: name: restart-deployment - namespace: ar-base-sepolia + namespace: email-tx-auth spec: schedule: "0 * * * *" jobTemplate: @@ -47,5 +47,5 @@ spec: - /bin/sh - -c - | - kubectl rollout restart deployment relayer-email-auth --namespace ar-base-sepolia + kubectl rollout restart deployment relayer-imap --namespace email-tx-auth restartPolicy: OnFailure diff --git a/kubernetes/ingress.yml b/kubernetes/ingress.yml index 923283ba..08a3279d 100644 --- a/kubernetes/ingress.yml +++ b/kubernetes/ingress.yml @@ -2,20 +2,20 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: managed-cert-ingress-email-auth - namespace: ar-base-sepolia + namespace: email-tx-auth annotations: - kubernetes.io/ingress.global-static-ip-name: k8s-email-auth-ip - networking.gke.io/managed-certificates: managed-cert-email-auth + kubernetes.io/ingress.global-static-ip-name: generic-relayer + networking.gke.io/managed-certificates: managed-cert-email-tx-auth ingressClassName: "gce" spec: rules: - - host: auth.prove.email + - host: relayer.zk.email http: paths: - pathType: Prefix path: / backend: service: - name: relayer-svc-email-auth + name: relayer-svc-email-tx-auth port: number: 443 diff --git a/kubernetes/managed-cert.yml b/kubernetes/managed-cert.yml index f89de24a..3bf0b05a 100644 --- a/kubernetes/managed-cert.yml +++ b/kubernetes/managed-cert.yml @@ -1,8 +1,8 @@ apiVersion: networking.gke.io/v1 kind: ManagedCertificate metadata: - name: managed-cert-email-auth - namespace: ar-base-sepolia + name: managed-cert-email-tx-auth + namespace: email-tx-auth spec: domains: - - auth.prove.email + - relayer.zk.email diff --git a/kubernetes/relayer.yml b/kubernetes/relayer.yml index e0f54ec5..1c9a8b9e 100644 --- a/kubernetes/relayer.yml +++ b/kubernetes/relayer.yml @@ -1,84 +1,12 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: relayer-config-email-auth - namespace: ar-base-sepolia - labels: - app: relayer -data: - EMAIL_ACCOUNT_RECOVERY_VERSION_ID: "" - CHAIN_RPC_PROVIDER: "" - CHAIN_RPC_EXPLORER: "" - CHAIN_ID: "" - WEB_SERVER_ADDRESS: "" - REGEX_JSON_DIR_PATH: "" - EMAIL_TEMPLATES_PATH: "" - CANISTER_ID: "" - IC_REPLICA_URL: "" - JSON_LOGGER: "" - PEM_PATH: "" - SMTP_SERVER: "" - ---- -apiVersion: v1 -kind: Secret -metadata: - name: relayer-secret-email-auth - namespace: ar-base-sepolia - labels: - app: relayer -type: Opaque -data: - PRIVATE_KEY: - DATABASE_URL: - PROVER_ADDRESS: - ICPEM: - ERROR_EMAIL_ADDR: ---- -apiVersion: v1 -kind: Secret -metadata: - name: relayer-smtp-secret - namespace: ar-base-sepolia - labels: - app: relayer -type: Opaque -data: - SMTP_LOGIN_ID: - SMTP_LOGIN_PASSWORD: - SMTP_DOMAIN_NAME: - SERVER_HOST: - SERVER_PORT: - JSON_LOGGER: - ---- -apiVersion: v1 -kind: Secret -metadata: - name: relayer-imap-secret - namespace: ar-base-sepolia - labels: - app: relayer -type: Opaque -data: - RELAYER_ENDPOINT: - IMAP_LOGIN_ID: - IMAP_LOGIN_PASSWORD: - IMAP_PORT: - IMAP_DOMAIN_NAME: - SERVER_HOST: - AUTH_TYPE: - JSON_LOGGER: - ---- apiVersion: apps/v1 kind: Deployment metadata: - name: relayer-email-auth - namespace: ar-base-sepolia + name: relayer-email-tx-auth + namespace: email-tx-auth labels: app: relayer spec: + replicas: 1 selector: matchLabels: app: relayer @@ -89,23 +17,25 @@ spec: spec: containers: - name: relayer-container - image: bisht13/ar-relayer-base-3:latest + image: bisht13/generic-relayer-7:latest ports: - containerPort: 4500 - envFrom: - - configMapRef: - name: relayer-config-email-auth - - secretRef: - name: relayer-secret-email-auth + resources: + requests: + cpu: 2 + memory: 4Gi + limits: + cpu: 4 + memory: 8Gi livenessProbe: httpGet: - path: /api/echo + path: /api/healthz port: 4500 initialDelaySeconds: 60 periodSeconds: 30 readinessProbe: httpGet: - path: /api/echo + path: /api/healthz port: 4500 initialDelaySeconds: 60 periodSeconds: 30 @@ -113,6 +43,42 @@ spec: - name: pem-volume mountPath: "/relayer/packages/relayer/.ic.pem" subPath: ".ic.pem" + - name: secret-volume + mountPath: "/relayer/packages/relayer/config.json" + subPath: "config.json" + volumes: + - name: secret-volume + secret: + secretName: relayer-secret-email-tx-auth + items: + - key: config.json + path: config.json + - name: pem-volume + secret: + secretName: relayer-secret-email-tx-auth + items: + - key: ICPEM + path: ".ic.pem" + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: relayer-smtp + namespace: email-tx-auth + labels: + app: relayer-smtp +spec: + replicas: 1 # Fixed replica count + selector: + matchLabels: + app: relayer-smtp + template: + metadata: + labels: + app: relayer-smtp + spec: + containers: - name: smtp-container image: bisht13/relayer-smtp:latest ports: @@ -120,28 +86,17 @@ spec: envFrom: - secretRef: name: relayer-smtp-secret - - name: imap-container - image: bisht13/relayer-imap-new:latest - envFrom: - - secretRef: - name: relayer-imap-secret - volumes: - - name: pem-volume - secret: - secretName: relayer-secret-email-auth - items: - - key: ICPEM - path: ".ic.pem" --- apiVersion: apps/v1 kind: Deployment metadata: name: relayer-imap - namespace: ar-base-sepolia + namespace: email-tx-auth labels: - app: relayer + app: relayer-imap spec: + replicas: 1 # Fixed replica count selector: matchLabels: app: relayer-imap @@ -161,8 +116,8 @@ spec: apiVersion: v1 kind: Service metadata: - name: relayer-svc-email-auth - namespace: ar-base-sepolia + name: relayer-svc-email-tx-auth + namespace: email-tx-auth spec: selector: app: relayer @@ -177,12 +132,33 @@ apiVersion: v1 kind: Service metadata: name: relayer-smtp-svc - namespace: ar-base-sepolia + namespace: email-tx-auth spec: selector: - app: relayer + app: relayer-smtp ports: - protocol: TCP port: 443 targetPort: 8080 type: ClusterIP + +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: relayer-email-tx-auth-hpa + namespace: email-tx-auth +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: relayer-email-tx-auth + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 diff --git a/package.json b/package.json index bf833b3a..f95dce16 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@zk-email/ether-email-auth", + "name": "@zk-email/email-tx-builder", "private": true, "version": "1.0.0", "description": "Smart contracts to auth messages via emails", diff --git a/packages/circuits/package.json b/packages/circuits/package.json index afc57f44..ecceca7f 100644 --- a/packages/circuits/package.json +++ b/packages/circuits/package.json @@ -1,5 +1,5 @@ { - "name": "@zk-email/ether-email-auth-circom", + "name": "@zk-email/email-tx-builder-circom", "license": "MIT", "version": "1.0.3", "scripts": { diff --git a/packages/contracts/package.json b/packages/contracts/package.json index e2affe77..862f69ad 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,11 +1,10 @@ { - "name": "@zk-email/ether-email-auth-contracts", + "name": "@zk-email/email-tx-builder-contracts", "version": "1.0.3", "license": "MIT", "scripts": { "build": "forge build --skip '*ZKSync*'", "test": "forge test --force --no-match-test \"testIntegration\" --no-match-contract \".*Script.*\" --skip '*ZKSync*'", - "test:script": "forge test --force --no-match-test \"testIntegration\" --skip '*ZKSync*' --match-path test/script/**/*.sol --threads 1", "zkbuild": "forge build --skip test --zksync", "zktest": "forge test --no-match-test \"testIntegration\" --no-match-contract \".*Script.*\" --system-mode=true --zksync --gas-limit 2000000000 --chain 300 --fork-url http://127.0.0.1:8011", "lint": "solhint 'src/**/*.sol'" diff --git a/packages/contracts/script/BaseDeployScript.sol b/packages/contracts/script/BaseDeployScript.sol index 31eef72f..b2c3686c 100644 --- a/packages/contracts/script/BaseDeployScript.sol +++ b/packages/contracts/script/BaseDeployScript.sol @@ -7,9 +7,6 @@ import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {SimpleWallet} from "../test/helpers/SimpleWallet.sol"; -import {RecoveryController} from "../test/helpers/RecoveryController.sol"; -import {RecoveryControllerZKSync} from "../test/helpers/RecoveryControllerZKSync.sol"; import {ZKSyncCreate2Factory} from "../src/utils/ZKSyncCreate2Factory.sol"; import {Verifier} from "../src/utils/Verifier.sol"; import {Groth16Verifier} from "../src/utils/Groth16Verifier.sol"; @@ -108,65 +105,6 @@ contract BaseDeployScript is Script { return emailAuthImplAddress; } - /// @notice Deploys a RecoveryController contract with specified owner, verifier, DKIM registry and EmailAuth implementation - function deployRecoveryController( - address owner, - address verifier, - address dkim, - address emailAuthImpl - ) public returns (address) { - address recoveryControllerProxyAddress; - RecoveryController recoveryControllerImpl = new RecoveryController(); - recoveryControllerProxyAddress = address( - new ERC1967Proxy( - address(recoveryControllerImpl), - abi.encodeCall( - RecoveryController.initialize, - (owner, verifier, dkim, emailAuthImpl) - ) - ) - ); - console.log( - "RecoveryController deployed at: %s", - recoveryControllerProxyAddress - ); - return recoveryControllerProxyAddress; - } - - /// @notice Deploys a ZK Sync specific RecoveryController with additional factory and proxy bytecode parameters - function deployRecoveryControllerZKSync( - address owner, - address verifier, - address dkim, - address emailAuthImpl, - address factoryImpl, - bytes32 proxyBytecodeHash - ) public returns (address) { - address recoveryControllerProxyAddress; - RecoveryControllerZKSync recoveryControllerZKSyncImpl = new RecoveryControllerZKSync(); - recoveryControllerProxyAddress = address( - new ERC1967Proxy( - address(recoveryControllerZKSyncImpl), - abi.encodeCall( - recoveryControllerZKSyncImpl.initialize, - ( - owner, - verifier, - dkim, - emailAuthImpl, - factoryImpl, - proxyBytecodeHash - ) - ) - ) - ); - console.log( - "RecoveryControllerZKSync deployed at: %s", - recoveryControllerProxyAddress - ); - return recoveryControllerProxyAddress; - } - /// @notice Deploys a ZK Sync Create2 factory contract function deployZKSyncCreate2Factory() public returns (address) { address factoryImplAddress; @@ -174,24 +112,4 @@ contract BaseDeployScript is Script { console.log("ZKSyncCreate2Factory deployed at: %s", factoryImplAddress); return factoryImplAddress; } - - /// @notice Deploys a SimpleWallet contract with a specified owner and recovery controller - function deploySimpleWallet( - address owner, - address recoveryController - ) public returns (address) { - address simpleWalletProxyAddress; - SimpleWallet simpleWalletImpl = new SimpleWallet(); - simpleWalletProxyAddress = address( - new ERC1967Proxy( - address(simpleWalletImpl), - abi.encodeCall( - simpleWalletImpl.initialize, - (owner, address(recoveryController)) - ) - ) - ); - console.log("SimpleWallet deployed at: %s", simpleWalletProxyAddress); - return simpleWalletProxyAddress; - } } diff --git a/packages/contracts/script/DeployRecoveryController.s.sol b/packages/contracts/script/DeployRecoveryController.s.sol deleted file mode 100644 index 40a47b31..00000000 --- a/packages/contracts/script/DeployRecoveryController.s.sol +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {console} from "forge-std/console.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {SimpleWallet} from "../test/helpers/SimpleWallet.sol"; -import {RecoveryController} from "../test/helpers/RecoveryController.sol"; -import {Verifier} from "../src/utils/Verifier.sol"; -import {Groth16Verifier} from "../src/utils/Groth16Verifier.sol"; -import {ECDSAOwnedDKIMRegistry} from "../src/utils/ECDSAOwnedDKIMRegistry.sol"; -import {EmailAuth} from "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {BaseDeployScript} from "./BaseDeployScript.sol"; - -contract Deploy is BaseDeployScript { - using ECDSA for *; - - address dkim; - address verifier; - address emailAuthImpl; - address simpleWallet; - address recoveryController; - - function run() public override { - super.run(); - vm.startBroadcast(deployerPrivateKey); - - // Deploy User-overrideable DKIM registry - dkim = vm.envOr("DKIM", address(0)); - if (address(dkim) == address(0)) { - address dkimSigner = vm.envAddress("DKIM_SIGNER"); - if (dkimSigner == address(0)) { - console.log("DKIM_SIGNER env var not set"); - return; - } - uint256 timeDelay = vm.envOr("DKIM_DELAY", uint256(0)); - console.log("DKIM_DELAY: %s", timeDelay); - - dkim = deployUserOverrideableDKIMRegistry( - initialOwner, - dkimSigner, - timeDelay - ); - } - - // Deploy Verifier - verifier = vm.envOr("VERIFIER", address(0)); - if (address(verifier) == address(0)) { - verifier = deployVerifier(initialOwner); - } - - // Deploy EmailAuth Implementation - emailAuthImpl = vm.envOr("EMAIL_AUTH_IMPL", address(0)); - if (emailAuthImpl == address(0)) { - emailAuthImpl = deployEmailAuthImplementation(); - } - - // Create RecoveryController as EmailAccountRecovery implementation - recoveryController = deployRecoveryController( - initialOwner, - address(verifier), - address(dkim), - address(emailAuthImpl) - ); - - // Deploy SimpleWallet Implementation - simpleWallet = deploySimpleWallet( - initialOwner, - address(recoveryController) - ); - - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/script/DeployRecoveryControllerZKSync.s.sol b/packages/contracts/script/DeployRecoveryControllerZKSync.s.sol deleted file mode 100644 index 1d09be27..00000000 --- a/packages/contracts/script/DeployRecoveryControllerZKSync.s.sol +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {console} from "forge-std/console.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {SimpleWallet} from "../test/helpers/SimpleWallet.sol"; -import {RecoveryControllerZKSync} from "../test/helpers/RecoveryControllerZKSync.sol"; -import {Verifier} from "../src/utils/Verifier.sol"; -import {Groth16Verifier} from "../src/utils/Groth16Verifier.sol"; -import {EmailAuth} from "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {ZKSyncCreate2Factory} from "../src/utils/ZKSyncCreate2Factory.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {BaseDeployScript} from "./BaseDeployScript.sol"; - -contract Deploy is BaseDeployScript { - using ECDSA for *; - - address dkim; - address verifier; - address emailAuthImpl; - address simpleWallet; - address recoveryControllerZKSync; - address factory; - - function run() public override { - super.run(); - - bytes32 proxyBytecodeHash = vm.envBytes32("PROXY_BYTECODE_HASH"); - if (proxyBytecodeHash == bytes32(0)) { - revert("PROXY_BYTECODE_HASH env var not set or invalid"); - } - - vm.startBroadcast(deployerPrivateKey); - - // Deploy Useroverrideable DKIM registry - dkim = vm.envOr("DKIM", address(0)); - if (address(dkim) == address(0)) { - address dkimSigner = vm.envAddress("DKIM_SIGNER"); - if (dkimSigner == address(0)) { - console.log("DKIM_SIGNER env var not set"); - return; - } - uint256 timeDelay = vm.envOr("DKIM_DELAY", uint256(0)); - console.log("DKIM_DELAY: %s", timeDelay); - - dkim = deployUserOverrideableDKIMRegistry(initialOwner, dkimSigner, timeDelay); - } - - // Deploy Verifier - verifier = vm.envOr("VERIFIER", address(0)); - if (address(verifier) == address(0)) { - verifier = deployVerifier(initialOwner); - } - - // Deploy EmailAuth Implementation - emailAuthImpl = vm.envOr("EMAIL_AUTH_IMPL", address(0)); - if (address(emailAuthImpl) == address(0)) { - emailAuthImpl = deployEmailAuthImplementation(); - } - - // Deploy Factory - factory = vm.envOr("ZKSYNC_CREATE2_FACTORY", address(0)); - if (address(factory) == address(0)) { - factory = deployZKSyncCreate2Factory(); - } - - // Create RecoveryControllerZKSync as EmailAccountRecovery implementation - recoveryControllerZKSync = deployRecoveryControllerZKSync( - initialOwner, address(verifier), address(dkim), address(emailAuthImpl), address(factory), proxyBytecodeHash - ); - - // Deploy SimpleWallet Implementation - simpleWallet = deploySimpleWallet(initialOwner, address(recoveryControllerZKSync)); - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/script/DeploySimpleWallet.s.sol b/packages/contracts/script/DeploySimpleWallet.s.sol deleted file mode 100644 index ab0a9c8c..00000000 --- a/packages/contracts/script/DeploySimpleWallet.s.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -// import "forge-std/Script.sol"; - -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import "../test/helpers/SimpleWallet.sol"; -import {BaseDeployScript} from "./BaseDeployScript.sol"; - -contract Deploy is BaseDeployScript { - function run() public override { - super.run(); - address controller = vm.envAddress("RECOVERY_CONTROLLER"); - deploySimpleWallet(initialOwner, address(controller)); - } -} diff --git a/packages/contracts/script/ReactivateDKIMPublicKeyHashSimpleWallet.s.sol b/packages/contracts/script/ReactivateDKIMPublicKeyHashSimpleWallet.s.sol deleted file mode 100644 index 8693c26f..00000000 --- a/packages/contracts/script/ReactivateDKIMPublicKeyHashSimpleWallet.s.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/Script.sol"; - -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "../test/helpers/SimpleWallet.sol"; -import "../test/helpers/RecoveryController.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; - -contract ReactivatePublicKeyHash is Script { - using ECDSA for *; - - UserOverrideableDKIMRegistry dkim; - RecoveryController recoveryController; - - function run() external { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - if (deployerPrivateKey == 0) { - console.log("PRIVATE_KEY env var not set"); - return; - } - address dkimAddr = vm.envAddress("DKIM"); - if (dkimAddr == address(0)) { - console.log("DKIM env var not set"); - return; - } - address walletAddr = vm.envAddress("SIMPLE_WALLET"); - if (walletAddr == address(0)) { - console.log("SIMPLE_WALLET env var not set"); - return; - } - dkim = UserOverrideableDKIMRegistry(dkimAddr); - string memory domainName = vm.envString("DOMAIN"); - if (bytes(domainName).length == 0) { - console.log("DOMAIN env var not set"); - return; - } - bytes32 publicKeyHash = vm.envBytes32("PUBLIC_KEY_HASH"); - if (publicKeyHash == bytes32(0)) { - console.log("PUBLIC_KEY_HASH env var not set"); - return; - } - string memory signedMsg = dkim.computeSignedMsg( - dkim.REACTIVATE_PREFIX(), - domainName, - publicKeyHash - ); - bytes32 digest = MessageHashUtils.toEthSignedMessageHash( - bytes(signedMsg) - ); - (uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPrivateKey, digest); - bytes memory signature = abi.encodePacked(r, s, v); - vm.startBroadcast(deployerPrivateKey); - dkim.reactivateDKIMPublicKeyHash( - domainName, - publicKeyHash, - walletAddr, - signature - ); - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/script/RequestGuardianSimpleWallet.sol b/packages/contracts/script/RequestGuardianSimpleWallet.sol deleted file mode 100644 index 18a1ab88..00000000 --- a/packages/contracts/script/RequestGuardianSimpleWallet.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/Script.sol"; - -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "../test/helpers/SimpleWallet.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "../src/utils/ECDSAOwnedDKIMRegistry.sol"; -import "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; - -contract RequestGuardian is Script { - using ECDSA for *; - - function run() external { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - if (deployerPrivateKey == 0) { - console.log("PRIVATE_KEY env var not set"); - return; - } - - address simpleWalletAddr = vm.envAddress("SIMPLE_WALLET"); - if (simpleWalletAddr == address(0)) { - console.log("SIMPLE_WALLET env var not set"); - return; - } - - address controllerAddr = vm.envAddress("RECOVERY_CONTROLLER"); - if (controllerAddr == address(0)) { - console.log("RECOVERY_CONTROLLER env var not set"); - return; - } - - bytes32 accountSalt = vm.envBytes32("ACCOUNT_SALT"); - if (accountSalt == 0) { - console.log("ACCOUNT_SALT env var not set"); - return; - } - - vm.startBroadcast(deployerPrivateKey); - address initialOwner = vm.addr(deployerPrivateKey); - console.log("Initial owner: %s", vm.toString(initialOwner)); - - RecoveryController controller = RecoveryController(controllerAddr); - address guardian = controller.computeEmailAuthAddress( - simpleWalletAddr, - accountSalt - ); - console.log("Guardian: %s", vm.toString(guardian)); - SimpleWallet wallet = SimpleWallet(payable(simpleWalletAddr)); - wallet.requestGuardian(guardian); - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/script/RevokeDKIMPublicKeyHashSimpleWallet.s.sol b/packages/contracts/script/RevokeDKIMPublicKeyHashSimpleWallet.s.sol deleted file mode 100644 index 38a28067..00000000 --- a/packages/contracts/script/RevokeDKIMPublicKeyHashSimpleWallet.s.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/Script.sol"; - -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "../test/helpers/SimpleWallet.sol"; -import "../test/helpers/RecoveryController.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; - -contract RevokePublicKeyHash is Script { - using ECDSA for *; - - UserOverrideableDKIMRegistry dkim; - RecoveryController recoveryController; - - function run() external { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - if (deployerPrivateKey == 0) { - console.log("PRIVATE_KEY env var not set"); - return; - } - address dkimAddr = vm.envAddress("DKIM"); - if (dkimAddr == address(0)) { - console.log("DKIM env var not set"); - return; - } - address walletAddr = vm.envAddress("SIMPLE_WALLET"); - if (walletAddr == address(0)) { - console.log("SIMPLE_WALLET env var not set"); - return; - } - dkim = UserOverrideableDKIMRegistry(dkimAddr); - string memory domainName = vm.envString("DOMAIN"); - if (bytes(domainName).length == 0) { - console.log("DOMAIN env var not set"); - return; - } - bytes32 publicKeyHash = vm.envBytes32("PUBLIC_KEY_HASH"); - if (publicKeyHash == bytes32(0)) { - console.log("PUBLIC_KEY_HASH env var not set"); - return; - } - string memory signedMsg = dkim.computeSignedMsg( - dkim.REVOKE_PREFIX(), - domainName, - publicKeyHash - ); - bytes32 digest = MessageHashUtils.toEthSignedMessageHash( - bytes(signedMsg) - ); - (uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPrivateKey, digest); - bytes memory signature = abi.encodePacked(r, s, v); - vm.startBroadcast(deployerPrivateKey); - dkim.revokeDKIMPublicKeyHash( - domainName, - publicKeyHash, - walletAddr, - signature - ); - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/script/SetDKIMPublicKeyHashSimpleWallet.s.sol b/packages/contracts/script/SetDKIMPublicKeyHashSimpleWallet.s.sol deleted file mode 100644 index dee8bc0b..00000000 --- a/packages/contracts/script/SetDKIMPublicKeyHashSimpleWallet.s.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/Script.sol"; - -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "../test/helpers/SimpleWallet.sol"; -import "../test/helpers/RecoveryController.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "../src/EmailAuth.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; - -contract SetPublicKeyHash is Script { - using ECDSA for *; - - UserOverrideableDKIMRegistry dkim; - RecoveryController recoveryController; - - function run() external { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - if (deployerPrivateKey == 0) { - console.log("PRIVATE_KEY env var not set"); - return; - } - address dkimAddr = vm.envAddress("DKIM"); - if (dkimAddr == address(0)) { - console.log("DKIM env var not set"); - return; - } - address walletAddr = vm.envAddress("SIMPLE_WALLET"); - if (walletAddr == address(0)) { - console.log("SIMPLE_WALLET env var not set"); - return; - } - dkim = UserOverrideableDKIMRegistry(dkimAddr); - string memory domainName = vm.envString("DOMAIN"); - if (bytes(domainName).length == 0) { - console.log("DOMAIN env var not set"); - return; - } - bytes32 publicKeyHash = vm.envBytes32("PUBLIC_KEY_HASH"); - if (publicKeyHash == bytes32(0)) { - console.log("PUBLIC_KEY_HASH env var not set"); - return; - } - string memory signedMsg = dkim.computeSignedMsg( - dkim.SET_PREFIX(), - domainName, - publicKeyHash - ); - bytes32 digest = MessageHashUtils.toEthSignedMessageHash( - bytes(signedMsg) - ); - (uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPrivateKey, digest); - bytes memory signature = abi.encodePacked(r, s, v); - vm.startBroadcast(deployerPrivateKey); - dkim.setDKIMPublicKeyHash( - domainName, - publicKeyHash, - walletAddr, - signature - ); - vm.stopBroadcast(); - } -} diff --git a/packages/contracts/src/EmailAccountRecovery.sol b/packages/contracts/src/EmailAccountRecovery.sol deleted file mode 100644 index d1754387..00000000 --- a/packages/contracts/src/EmailAccountRecovery.sol +++ /dev/null @@ -1,302 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "./EmailAuth.sol"; -import "@openzeppelin/contracts/utils/Create2.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; - -/// @title Email Account Recovery Contract -/// @notice Provides mechanisms for email-based account recovery, leveraging guardians and template-based email verification. -/// @dev This contract is abstract and requires implementation of several methods for configuring a new guardian and recovering an account contract. -abstract contract EmailAccountRecovery { - uint8 constant EMAIL_ACCOUNT_RECOVERY_VERSION_ID = 1; - address public verifierAddr; - address public dkimAddr; - address public emailAuthImplementationAddr; - - /// @notice Returns the address of the verifier contract. - /// @dev This function is virtual and can be overridden by inheriting contracts. - /// @return address The address of the verifier contract. - function verifier() public view virtual returns (address) { - return verifierAddr; - } - - /// @notice Returns the address of the DKIM contract. - /// @dev This function is virtual and can be overridden by inheriting contracts. - /// @return address The address of the DKIM contract. - function dkim() public view virtual returns (address) { - return dkimAddr; - } - - /// @notice Returns the address of the email auth contract implementation. - /// @dev This function is virtual and can be overridden by inheriting contracts. - /// @return address The address of the email authentication contract implementation. - function emailAuthImplementation() public view virtual returns (address) { - return emailAuthImplementationAddr; - } - - /// @notice Returns if the account to be recovered has already activated the controller (this contract). - /// @dev This function is virtual and should be implemented by inheriting contracts. - /// @dev This function helps a relayer inactivate the guardians' data after the account inactivates the controller (this contract). - /// @param recoveredAccount The address of the account to be recovered. - /// @return bool True if the account is already activated, false otherwise. - function isActivated( - address recoveredAccount - ) public view virtual returns (bool); - - /// @notice Returns a two-dimensional array of strings representing the command templates for an acceptance by a new guardian's. - /// @dev This function is virtual and should be implemented by inheriting contracts to define specific acceptance command templates. - /// @return string[][] A two-dimensional array of strings, where each inner array represents a set of fixed strings and matchers for a command template. - function acceptanceCommandTemplates() - public - view - virtual - returns (string[][] memory); - - /// @notice Returns a two-dimensional array of strings representing the command templates for email recovery. - /// @dev This function is virtual and should be implemented by inheriting contracts to define specific recovery command templates. - /// @return string[][] A two-dimensional array of strings, where each inner array represents a set of fixed strings and matchers for a command template. - function recoveryCommandTemplates() - public - view - virtual - returns (string[][] memory); - - /// @notice Extracts the account address to be recovered from the command parameters of an acceptance email. - /// @dev This function is virtual and should be implemented by inheriting contracts to extract the account address from the command parameters. - /// @param commandParams The command parameters of the acceptance email. - /// @param templateIdx The index of the acceptance command template. - function extractRecoveredAccountFromAcceptanceCommand( - bytes[] memory commandParams, - uint templateIdx - ) public view virtual returns (address); - - /// @notice Extracts the account address to be recovered from the command parameters of a recovery email. - /// @dev This function is virtual and should be implemented by inheriting contracts to extract the account address from the command parameters. - /// @param commandParams The command parameters of the recovery email. - /// @param templateIdx The index of the recovery command template. - function extractRecoveredAccountFromRecoveryCommand( - bytes[] memory commandParams, - uint templateIdx - ) public view virtual returns (address); - - function acceptGuardian( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 emailNullifier - ) internal virtual; - - function processRecovery( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 emailNullifier - ) internal virtual; - - /// @notice Completes the recovery process. - /// @dev This function must be implemented by inheriting contracts to finalize the recovery process. - /// @param account The address of the account to be recovered. - /// @param completeCalldata The calldata for the recovery process. - function completeRecovery( - address account, - bytes memory completeCalldata - ) external virtual; - - /// @notice Computes the address for email auth contract using the CREATE2 opcode. - /// @dev This function utilizes the `Create2` library to compute the address. The computation uses a provided account address to be recovered, account salt, - /// and the hash of the encoded ERC1967Proxy creation code concatenated with the encoded email auth contract implementation - /// address and the initialization call data. This ensures that the computed address is deterministic and unique per account salt. - /// @param recoveredAccount The address of the account to be recovered. - /// @param accountSalt A bytes32 salt value defined as a hash of the guardian's email address and an account code. This is assumed to be unique to a pair of the guardian's email address and the wallet address to be recovered. - /// @return address The computed address. - function computeEmailAuthAddress( - address recoveredAccount, - bytes32 accountSalt - ) public view virtual returns (address) { - return - Create2.computeAddress( - accountSalt, - keccak256( - abi.encodePacked( - type(ERC1967Proxy).creationCode, - abi.encode( - emailAuthImplementation(), - abi.encodeCall( - EmailAuth.initialize, - (recoveredAccount, accountSalt, address(this)) - ) - ) - ) - ) - ); - } - - /// @notice Deploys a new proxy contract for email authentication. - /// @dev This function uses the CREATE2 opcode to deploy a new ERC1967Proxy contract with a deterministic address. - /// @param recoveredAccount The address of the account to be recovered. - /// @param accountSalt A bytes32 salt value used to ensure the uniqueness of the deployed proxy address. - /// @return address The address of the newly deployed proxy contract. - function deployEmailAuthProxy( - address recoveredAccount, - bytes32 accountSalt - ) internal virtual returns (address) { - ERC1967Proxy proxy = new ERC1967Proxy{salt: accountSalt}( - emailAuthImplementation(), - abi.encodeCall( - EmailAuth.initialize, - (recoveredAccount, accountSalt, address(this)) - ) - ); - return address(proxy); - } - - /// @notice Calculates a unique command template ID for an acceptance command template using its index. - /// @dev Encodes the email account recovery version ID, "ACCEPTANCE", and the template index, - /// then uses keccak256 to hash these values into a uint ID. - /// @param templateIdx The index of the acceptance command template. - /// @return uint The computed uint ID. - function computeAcceptanceTemplateId( - uint templateIdx - ) public pure returns (uint) { - return - uint256( - keccak256( - abi.encode( - EMAIL_ACCOUNT_RECOVERY_VERSION_ID, - "ACCEPTANCE", - templateIdx - ) - ) - ); - } - - /// @notice Calculates a unique ID for a recovery command template using its index. - /// @dev Encodes the email account recovery version ID, "RECOVERY", and the template index, - /// then uses keccak256 to hash these values into a uint256 ID. - /// @param templateIdx The index of the recovery command template. - /// @return uint The computed uint ID. - function computeRecoveryTemplateId( - uint templateIdx - ) public pure returns (uint) { - return - uint256( - keccak256( - abi.encode( - EMAIL_ACCOUNT_RECOVERY_VERSION_ID, - "RECOVERY", - templateIdx - ) - ) - ); - } - /// @notice Handles an acceptance by a new guardian. - /// @dev This function validates the email auth message, deploys a new EmailAuth contract as a proxy if validations pass and initializes the contract. - /// @param emailAuthMsg The email auth message for the email send from the guardian. - /// @param templateIdx The index of the command template for acceptance, which should match with the command in the given email auth message. - function handleAcceptance( - EmailAuthMsg memory emailAuthMsg, - uint templateIdx - ) external { - address recoveredAccount = extractRecoveredAccountFromAcceptanceCommand( - emailAuthMsg.commandParams, - templateIdx - ); - require(recoveredAccount != address(0), "invalid account in email"); - address guardian = computeEmailAuthAddress( - recoveredAccount, - emailAuthMsg.proof.accountSalt - ); - uint templateId = computeAcceptanceTemplateId(templateIdx); - require(templateId == emailAuthMsg.templateId, "invalid template id"); - require(emailAuthMsg.proof.isCodeExist == true, "isCodeExist is false"); - - EmailAuth guardianEmailAuth; - if (guardian.code.length == 0) { - address proxyAddress = deployEmailAuthProxy( - recoveredAccount, - emailAuthMsg.proof.accountSalt - ); - guardianEmailAuth = EmailAuth(proxyAddress); - guardianEmailAuth.initDKIMRegistry(dkim()); - guardianEmailAuth.initVerifier(verifier()); - for ( - uint idx = 0; - idx < acceptanceCommandTemplates().length; - idx++ - ) { - guardianEmailAuth.insertCommandTemplate( - computeAcceptanceTemplateId(idx), - acceptanceCommandTemplates()[idx] - ); - } - for (uint idx = 0; idx < recoveryCommandTemplates().length; idx++) { - guardianEmailAuth.insertCommandTemplate( - computeRecoveryTemplateId(idx), - recoveryCommandTemplates()[idx] - ); - } - } else { - guardianEmailAuth = EmailAuth(payable(address(guardian))); - require( - guardianEmailAuth.controller() == address(this), - "invalid controller" - ); - } - - // An assertion to confirm that the authEmail function is executed successfully - // and does not return an error. - guardianEmailAuth.authEmail(emailAuthMsg); - acceptGuardian( - guardian, - templateIdx, - emailAuthMsg.commandParams, - emailAuthMsg.proof.emailNullifier - ); - } - - /// @notice Processes the recovery based on an email from the guardian. - /// @dev Verify the provided email auth message for a deployed guardian's EmailAuth contract and a specific command template for recovery. - /// Requires that the guardian is already deployed, and the template ID corresponds to the `templateId` in the given email auth message. Once validated. - /// @param emailAuthMsg The email auth message for recovery. - /// @param templateIdx The index of the command template for recovery, which should match with the command in the given email auth message. - function handleRecovery( - EmailAuthMsg memory emailAuthMsg, - uint templateIdx - ) external { - address recoveredAccount = extractRecoveredAccountFromRecoveryCommand( - emailAuthMsg.commandParams, - templateIdx - ); - require(recoveredAccount != address(0), "invalid account in email"); - address guardian = computeEmailAuthAddress( - recoveredAccount, - emailAuthMsg.proof.accountSalt - ); - // Check if the guardian is deployed - require(address(guardian).code.length > 0, "guardian is not deployed"); - uint templateId = uint256( - keccak256( - abi.encode( - EMAIL_ACCOUNT_RECOVERY_VERSION_ID, - "RECOVERY", - templateIdx - ) - ) - ); - require(templateId == emailAuthMsg.templateId, "invalid template id"); - - EmailAuth guardianEmailAuth = EmailAuth(payable(address(guardian))); - - // An assertion to confirm that the authEmail function is executed successfully - // and does not return an error. - guardianEmailAuth.authEmail(emailAuthMsg); - - processRecovery( - guardian, - templateIdx, - emailAuthMsg.commandParams, - emailAuthMsg.proof.emailNullifier - ); - } -} diff --git a/packages/contracts/src/EmailAccountRecoveryZKSync.sol b/packages/contracts/src/EmailAccountRecoveryZKSync.sol deleted file mode 100644 index a247524f..00000000 --- a/packages/contracts/src/EmailAccountRecoveryZKSync.sol +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import {EmailAuth} from "./EmailAuth.sol"; -import {EmailAccountRecovery} from "./EmailAccountRecovery.sol"; -import {ZKSyncCreate2Factory} from "./utils/ZKSyncCreate2Factory.sol"; - -/// @title Email Account Recovery Contract -/// @notice Provides mechanisms for email-based account recovery, leveraging guardians and template-based email verification. -/// @dev This contract is abstract and requires implementation of several methods for configuring a new guardian and recovering an account contract. -abstract contract EmailAccountRecoveryZKSync is EmailAccountRecovery { - // This is the address of the zkSync factory contract - address public factoryAddr; - // The bytecodeHash is assumed to be provided as an initialization parameter because type(ERC1967Proxy).creationCode doesn't work on eraVM currently - // If you failed some test cases, check the bytecodeHash by yourself - // see, test/ComputeCreate2Address.t.sol - bytes32 public proxyBytecodeHash; - - /// @notice Returns the address of the zkSyncfactory contract. - /// @dev This function is virtual and can be overridden by inheriting contracts. - /// @return address The address of the zkSync factory contract. - function factory() public view virtual returns (address) { - return factoryAddr; - } - - /// @notice Computes the address for email auth contract using the CREATE2 opcode. - /// @dev This function utilizes the `ZKSyncCreate2Factory` to compute the address. The computation uses a provided account address to be recovered, account salt, - /// and the hash of the encoded ERC1967Proxy creation code concatenated with the encoded email auth contract implementation - /// address and the initialization call data. This ensures that the computed address is deterministic and unique per account salt. - /// @param recoveredAccount The address of the account to be recovered. - /// @param accountSalt A bytes32 salt value defined as a hash of the guardian's email address and an account code. This is assumed to be unique to a pair of the guardian's email address and the wallet address to be recovered. - /// @return address The computed address. - function computeEmailAuthAddress( - address recoveredAccount, - bytes32 accountSalt - ) public view virtual override returns (address) { - // If on zksync, we use another logic to calculate create2 address. - return - ZKSyncCreate2Factory(factory()).computeAddress( - accountSalt, - proxyBytecodeHash, - abi.encode( - emailAuthImplementation(), - abi.encodeCall( - EmailAuth.initialize, - (recoveredAccount, accountSalt, address(this)) - ) - ) - ); - } - - /// @notice Deploys a proxy contract for email authentication using the CREATE2 opcode. - /// @dev This function utilizes the `ZKSyncCreate2Factory` to deploy the proxy contract. The deployment uses a provided account address to be recovered, account salt, - /// and the hash of the encoded ERC1967Proxy creation code concatenated with the encoded email auth contract implementation - /// address and the initialization call data. This ensures that the deployed address is deterministic and unique per account salt. - /// @param recoveredAccount The address of the account to be recovered. - /// @param accountSalt A bytes32 salt value defined as a hash of the guardian's email address and an account code. This is assumed to be unique to a pair of the guardian's email address and the wallet address to be recovered. - /// @return address The address of the deployed proxy contract. - function deployEmailAuthProxy( - address recoveredAccount, - bytes32 accountSalt - ) internal virtual override returns (address) { - (bool success, bytes memory returnData) = ZKSyncCreate2Factory( - factory() - ).deploy( - accountSalt, - proxyBytecodeHash, - abi.encode( - emailAuthImplementation(), - abi.encodeCall( - EmailAuth.initialize, - (recoveredAccount, accountSalt, address(this)) - ) - ) - ); - require(success, "zksync deploy failed"); - address payable proxyAddress = abi.decode(returnData, (address)); - return proxyAddress; - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_acceptanceSubjectTemplates.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_acceptanceSubjectTemplates.t.sol deleted file mode 100644 index 7e596e79..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_acceptanceSubjectTemplates.t.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_acceptanceCommandTemplates is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testAcceptanceCommandTemplates() public { - skipIfZkSync(); - - setUp(); - string[][] memory res = recoveryController.acceptanceCommandTemplates(); - assertEq(res[0][0], "Accept"); - assertEq(res[0][1], "guardian"); - assertEq(res[0][2], "request"); - assertEq(res[0][3], "for"); - assertEq(res[0][4], "{ethAddr}"); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_completeRecovery.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_completeRecovery.t.sol deleted file mode 100644 index 00ba5401..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_completeRecovery.t.sol +++ /dev/null @@ -1,237 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_completeRecovery is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - setUp(); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED - ); - } - - function handleRecovery() public { - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testCompleteRecovery() public { - skipIfZkSync(); - - handleRecovery(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(someRelayer); - vm.warp(4 days); - recoveryController.completeRecovery( - address(simpleWallet), - new bytes(0) - ); - vm.stopPrank(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), newSigner); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - } - - function testExpectRevertCompleteRecoveryRecoveryNotInProgress() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - vm.startPrank(someRelayer); - vm.warp(4 days); - vm.expectRevert(bytes("recovery not in progress")); - bytes memory recoveryCalldata; - recoveryController.completeRecovery( - address(simpleWallet), - recoveryCalldata - ); - - vm.stopPrank(); - } - - function testExpectRevertCompleteRecovery() public { - skipIfZkSync(); - - vm.warp(block.timestamp + 3 days); - - handleRecovery(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.warp(0); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("timelock not expired")); - bytes memory recoveryCalldata; - recoveryController.completeRecovery( - address(simpleWallet), - recoveryCalldata - ); - - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_general.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_general.t.sol deleted file mode 100644 index 7f574df4..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_general.t.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "../helpers/StructHelper.sol"; - -contract EmailAccountRecoveryTest_general is Test, StructHelper { - function test_erifier() public { - assertEq(recoveryController.verifier(), address(verifier)); - } - - function test_DKIM() public { - assertEq(recoveryController.dkim(), address(dkim)); - } - - function test_EmailAuthImplementation() public { - assertEq(recoveryController.emailAuthImplementation(), address(emailAuth)); - } -} \ No newline at end of file diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleAcceptance.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleAcceptance.t.sol deleted file mode 100644 index 3e689134..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleAcceptance.t.sol +++ /dev/null @@ -1,438 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; - -contract EmailAccountRecoveryTest_handleAcceptance is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - skipIfZkSync(); - - setUp(); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } - - function testExpectRevertHandleAcceptanceInvalidRecoveredAccount() public { - skipIfZkSync(); - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = recoveryController - .computeAcceptanceTemplateId(0); - emailAuthMsg.commandParams[0] = abi.encode(address(0x0)); // Invalid account - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryController.handleAcceptance(emailAuthMsg, 0); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidTemplateId() public { - skipIfZkSync(); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = 999; // invalid template id - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template id")); - recoveryController.handleAcceptance(emailAuthMsg, 0); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidEmailAuthMsgStructure() - public - { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - // Create an invalid EmailAuthMsg with empty commandParams - EmailAuthMsg memory emailAuthMsg; - emailAuthMsg.templateId = recoveryController - .computeAcceptanceTemplateId(templateIdx); - emailAuthMsg.commandParams = new bytes[](0); // Invalid structure - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidVerifier() public { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - // Set Verifier address to address(0) - vm.store( - address(recoveryController), - bytes32(uint256(0)), // Assuming Verifier is the 1st storage slot in RecoveryController - bytes32(uint256(0)) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid verifier address")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidDKIMRegistry() public { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - // Set DKIMRegistry address to address(0) - vm.store( - address(recoveryController), - bytes32(uint256(1)), // Assuming DKIMRegistry is the 2nd storage slot in RecoveryController - bytes32(uint256(0)) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid dkim registry address")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidEmailAuthImplementationAddr() - public - { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - // Set EmailAuthImplementationAddr address to address(0) - vm.store( - address(recoveryController), - bytes32(uint256(2)), // Assuming EmailAuthImplementationAddr is the 3rd storage slot in RecoveryController - bytes32(uint256(0)) - ); - - vm.startPrank(someRelayer); - vm.expectRevert( - abi.encodeWithSelector( - ERC1967Utils.ERC1967InvalidImplementation.selector, - address(0) - ) - ); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidController() public { - skipIfZkSync(); - - // First, request and accept a guardian - requestGuardian(); - uint templateIdx = 0; - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.prank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED, - "Guardian should be accepted" - ); - - // Now, set an invalid controller for the guardian's EmailAuth contract - address invalidController = address(0x1234); - vm.mockCall( - guardian, - abi.encodeWithSelector(bytes4(keccak256("controller()"))), - abi.encode(invalidController) - ); - - // Try to handle acceptance again, which should fail due to invalid controller - vm.expectRevert("invalid controller"); - vm.prank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - } - - function testHandleAcceptance() public { - skipIfZkSync(); - - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED - ); - } - - // Can not test recovery in progress using handleAcceptance - // Can not test invalid guardian using handleAcceptance - - function testExpectRevertHandleAcceptanceGuardianStatusMustBeRequested() - public - { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - emailAuthMsg.proof.accountSalt = 0x0; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian status must be REQUESTED")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidTemplateIndex() public { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 1; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template index")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidCommandParams() public { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](2); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - commandParamsForAcceptance[1] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidWalletAddressInEmail() - public - { - skipIfZkSync(); - - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid account in email")); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleRecovery.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleRecovery.t.sol deleted file mode 100644 index 7bb5f67b..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_handleRecovery.t.sol +++ /dev/null @@ -1,556 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController, EmailAccountRecovery} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_handleRecovery is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - setUp(); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - skipIfZkSync(); - - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED - ); - } - - function testExpectRevertHandleRecoveryInvalidRecoveredAccount() public { - skipIfZkSync(); - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = recoveryController.computeRecoveryTemplateId( - 0 - ); - emailAuthMsg.commandParams[0] = abi.encode(address(0x0)); // Invalid account - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid account in email")); - recoveryController.handleRecovery(emailAuthMsg, 0); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidAccountInEmail() public { - skipIfZkSync(); - - handleAcceptance(); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(address(0x0)); // Invalid account - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid account in email")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryGuardianCodeLengthZero() public { - skipIfZkSync(); - - handleAcceptance(); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - // Mock guardian with no code - vm.etch(guardian, ""); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian is not deployed")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryTemplateIdMismatch() public { - skipIfZkSync(); - - handleAcceptance(); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = 999; // Invalid template ID - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template id")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryAuthEmailFailure() public { - skipIfZkSync(); - - handleAcceptance(); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - emailAuthMsg.templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - // Mock authEmail to fail - vm.mockCallRevert( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - "REVERT_MESSAGE" - ); - - vm.startPrank(someRelayer); - vm.expectRevert(); // Expect any revert due to authEmail failure - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testHandleRecovery() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testExpectRevertHandleRecoveryGuardianIsNotDeployed() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - emailAuthMsg.proof.accountSalt = 0x0; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian is not deployed")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidTemplateId() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template id")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - // Can not test recovery in progress using handleRecovery - // Can not test invalid guardian using handleRecovery - - function testExpectRevertHandleRecoveryGuardianStatusMustBeAccepted() - public - { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - emailAuthMsg.proof.accountSalt = 0x0; - - // vm.mockCall( - // address(simpleWallet.emailAuthImplementationAddr()), - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - // // Deploy mock guardian, that status is NONE - // address mockCallAddress; - // if(block.chainid == 300) { - // mockCallAddress = address(0x889170C6bEe9053626f8460A9875d22Cf6DE0782); - // } else { - // mockCallAddress = address(0x2Cfb66029975B1c8881adaa3b79c5Caa4FEB84B5); - // } - // vm.mockCall( - // mockCallAddress, - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian is not deployed")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidTemplateIndex() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 1; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template index")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidCommandParams() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](3); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - commandParamsForRecovery[1] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - // function testExpectRevertHandleRecoveryInvalidGuardianInEmail() public { - // handleAcceptance(); - - // assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - // assertEq( - // recoveryController.currentTimelockOfAccount(address(simpleWallet)), - // 0 - // ); - // assertEq(simpleWallet.owner(), deployer); - // assertEq( - // recoveryController.newSignerCandidateOfAccount(address(simpleWallet)), - // address(0x0) - // ); - // uint templateIdx = 0; - - // EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - // uint templateId = recoveryController.computeRecoveryTemplateId(templateIdx); - // emailAuthMsg.templateId = templateId; - // bytes[] memory commandParamsForRecovery = new bytes[](2); - // commandParamsForRecovery[0] = abi.encode(address(0x0)); - // commandParamsForRecovery[1] = abi.encode(newSigner); - // emailAuthMsg.commandParams = commandParamsForRecovery; - - // vm.mockCall( - // address(recoveryController.emailAuthImplementationAddr()), - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - // vm.startPrank(someRelayer); - // vm.expectRevert(bytes("invalid guardian in email")); - // recoveryController.handleRecovery(emailAuthMsg, templateIdx); - // vm.stopPrank(); - // } - - function testExpectRevertHandleRecoveryInvalidNewSigner() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid new signer")); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_recoverySubjectTemplates.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_recoverySubjectTemplates.t.sol deleted file mode 100644 index db7a925c..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_recoverySubjectTemplates.t.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_recoveryCommandTemplates is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testRecoveryCommandTemplates() public { - skipIfZkSync(); - - setUp(); - string[][] memory res = recoveryController.recoveryCommandTemplates(); - assertEq(res[0][0], "Set"); - assertEq(res[0][1], "the"); - assertEq(res[0][2], "new"); - assertEq(res[0][3], "signer"); - assertEq(res[0][4], "of"); - assertEq(res[0][5], "{ethAddr}"); - assertEq(res[0][6], "to"); - assertEq(res[0][7], "{ethAddr}"); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_rejectRecovery.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_rejectRecovery.t.sol deleted file mode 100644 index d11b52c3..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_rejectRecovery.t.sol +++ /dev/null @@ -1,267 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryForRejectRecoveryTest_rejectRecovery is - StructHelper -{ - constructor() {} - - function setUp() public override { - super.setUp(); - } - - /** - * Set up functions - */ - function requestGuardian() public { - setUp(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - requestGuardian(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - - console.log("guardian", guardian); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - address recoveredAccount = recoveryController - .extractRecoveredAccountFromAcceptanceCommand( - emailAuthMsg.commandParams, - templateIdx - ); - address computedGuardian = recoveryController.computeEmailAuthAddress( - recoveredAccount, - emailAuthMsg.proof.accountSalt - ); - console.log("computed guardian", computedGuardian); - uint templateId = recoveryController.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED - ); - } - - function handleRecovery() public { - handleAcceptance(); - - assertEq(simpleWallet.owner(), deployer); - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryController.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryController.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testRejectRecovery() public { - skipIfZkSync(); - - vm.warp(block.timestamp + 3 days); - - handleRecovery(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.warp(0); - - vm.startPrank(address(simpleWallet)); - recoveryController.rejectRecovery(); - vm.stopPrank(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - } - - function testExpectRevertRejectRecoveryRecoveryNotInProgress() public { - skipIfZkSync(); - - handleAcceptance(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - vm.startPrank(deployer); - vm.expectRevert(bytes("recovery not in progress")); - recoveryController.rejectRecovery(); - vm.stopPrank(); - } - - function testExpectRevertRejectRecovery() public { - skipIfZkSync(); - - vm.warp(block.timestamp + 1 days); - - handleRecovery(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(address(simpleWallet)); - vm.warp(block.timestamp + 4 days); - vm.expectRevert(bytes("timelock expired")); - recoveryController.rejectRecovery(); - vm.stopPrank(); - } - - function testExpectRevertRejectRecoveryOwnableUnauthorizedAccount() public { - skipIfZkSync(); - - handleRecovery(); - - assertEq(recoveryController.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryController.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryController.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(deployer); - vm.expectRevert("recovery not in progress"); - recoveryController.rejectRecovery(); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_requestGuardian.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_requestGuardian.t.sol deleted file mode 100644 index a0a99734..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_requestGuardian.t.sol +++ /dev/null @@ -1,111 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_requestGuardian is StructHelper { - using stdStorage for StdStorage; - - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testExpectRevertRequestGuardianRecoveryInProgress() public { - skipIfZkSync(); - - setUp(); - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - - // Simulate recovery in progress - stdstore - .target(address(recoveryController)) - .sig("isRecovering(address)") - .with_key(address(deployer)) - .checked_write(true); - - vm.expectRevert(bytes("recovery in progress")); - recoveryController.requestGuardian(address(0x123)); // Try to request a new guardian - vm.stopPrank(); - } - - function testExpectRevertRequestGuardianInvalidGuardian() public { - skipIfZkSync(); - - setUp(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - vm.expectRevert(bytes("invalid guardian")); - recoveryController.requestGuardian(address(0x0)); - vm.stopPrank(); - } - - function testExpectRevertRequestGuardianGuardianStatusMustBeNone() public { - skipIfZkSync(); - - setUp(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.expectRevert(bytes("guardian status must be NONE")); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - } - - function testRequestGuardian() public { - skipIfZkSync(); - - setUp(); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } - - function testMultipleGuardianRequests() public { - skipIfZkSync(); - - address anotherGuardian = vm.addr(9); - setUp(); - vm.startPrank(deployer); - recoveryController.requestGuardian(guardian); - recoveryController.requestGuardian(anotherGuardian); // Assuming anotherGuardian is defined - vm.stopPrank(); - - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - require( - recoveryController.guardians(anotherGuardian) == - RecoveryController.GuardianStatus.REQUESTED - ); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_transfer.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_transfer.t.sol deleted file mode 100644 index 460700a3..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_transfer.t.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_transfer is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testTransfer() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(receiver.balance, 0 ether); - - vm.startPrank(deployer); - simpleWallet.transfer(receiver, 1 ether); - vm.stopPrank(); - - assertEq(address(simpleWallet).balance, 0 ether); - assertEq(receiver.balance, 1 ether); - } - - function testExpectRevertTransferOnlyOwner() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(receiver.balance, 0 ether); - - vm.startPrank(receiver); - vm.expectRevert( - abi.encodeWithSelector( - OwnableUpgradeable.OwnableUnauthorizedAccount.selector, - receiver - ) - ); - simpleWallet.transfer(receiver, 1 ether); - vm.stopPrank(); - } - - function testExpectRevertTransferOnlyOwnerInsufficientBalance() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(receiver.balance, 0 ether); - - vm.startPrank(deployer); - assertEq(receiver.balance, 0 ether); - vm.expectRevert(bytes("insufficient balance")); - simpleWallet.transfer(receiver, 2 ether); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_withdraw.t.sol b/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_withdraw.t.sol deleted file mode 100644 index 4eefa103..00000000 --- a/packages/contracts/test/EmailAccountRecovery/EmailAccountRecovery_withdraw.t.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryTest_withdraw is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testWithdraw() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(deployer.balance, 0 ether); - - vm.startPrank(deployer); - simpleWallet.withdraw(1 ether); - vm.stopPrank(); - - assertEq(address(simpleWallet).balance, 0 ether); - assertEq(deployer.balance, 1 ether); - } - - function testExpectRevertWithdrawOnlyOwner() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(deployer.balance, 0 ether); - - vm.startPrank(receiver); - vm.expectRevert( - abi.encodeWithSelector( - OwnableUpgradeable.OwnableUnauthorizedAccount.selector, - address(receiver) - ) - ); - simpleWallet.withdraw(1 ether); - vm.stopPrank(); - } - - function testExpectRevertWithdrawInsufficientBalance() public { - skipIfZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - assertEq(deployer.balance, 0 ether); - - vm.startPrank(deployer); - vm.expectRevert(bytes("insufficient balance")); - simpleWallet.withdraw(10 ether); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_completeRecovery.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_completeRecovery.t.sol deleted file mode 100644 index 181c3f51..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_completeRecovery.t.sol +++ /dev/null @@ -1,265 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_completeRecovery is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - setUp(); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.ACCEPTED - ); - } - - function handleRecovery() public { - handleAcceptance(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - false - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - true - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testCompleteRecovery() public { - skipIfNotZkSync(); - - handleRecovery(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - true - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(someRelayer); - vm.warp(block.timestamp + 4 days); - recoveryControllerZKSync.completeRecovery( - address(simpleWallet), - new bytes(0) - ); - vm.stopPrank(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - false - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - 0 - ); - assertEq(simpleWallet.owner(), newSigner); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - } - - function testExpectRevertCompleteRecoveryRecoveryNotInProgress() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - false - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - vm.startPrank(someRelayer); - vm.warp(block.timestamp + 4 days); - vm.expectRevert(bytes("recovery not in progress")); - bytes memory recoveryCalldata; - recoveryControllerZKSync.completeRecovery( - address(simpleWallet), - recoveryCalldata - ); - - vm.stopPrank(); - } - - function testExpectRevertCompleteRecovery() public { - vm.warp(block.timestamp + 3 days); - - handleRecovery(); - - assertEq( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - true - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.warp(0); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("timelock not expired")); - bytes memory recoveryCalldata; - recoveryControllerZKSync.completeRecovery( - address(simpleWallet), - recoveryCalldata - ); - - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleAcceptance.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleAcceptance.t.sol deleted file mode 100644 index fa88af64..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleAcceptance.t.sol +++ /dev/null @@ -1,218 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_handleAcceptance is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - skipIfNotZkSync(); - - setUp(); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - } - - function testHandleAcceptance() public { - skipIfNotZkSync(); - - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.ACCEPTED - ); - } - - // Can not test recovery in progress using handleAcceptance - // Can not test invalid guardian using handleAcceptance - - function testExpectRevertHandleAcceptanceGuardianStatusMustBeRequested() - public - { - skipIfNotZkSync(); - - requestGuardian(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - emailAuthMsg.proof.accountSalt = 0x0; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian status must be REQUESTED")); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidTemplateIndex() public { - skipIfNotZkSync(); - - requestGuardian(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 1; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template index")); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidcommandParams() public { - skipIfNotZkSync(); - - requestGuardian(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](2); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - commandParamsForAcceptance[1] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleAcceptanceInvalidWalletAddressInEmail() - public - { - skipIfNotZkSync(); - - requestGuardian(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid account in email")); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleRecovery.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleRecovery.t.sol deleted file mode 100644 index 288b234f..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_handleRecovery.t.sol +++ /dev/null @@ -1,433 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_handleRecovery is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function requestGuardian() public { - setUp(); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - skipIfNotZkSync(); - - requestGuardian(); - - console.log("guardian", guardian); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.ACCEPTED - ); - } - - function testHandleRecovery() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), true); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testExpectRevertHandleRecoveryGuardianIsNotDeployed() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - emailAuthMsg.proof.accountSalt = 0x0; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian is not deployed")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidTemplateId() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template id")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - // Can not test recovery in progress using handleRecovery - // Can not test invalid guardian using handleRecovery - - function testExpectRevertHandleRecoveryGuardianStatusMustBeAccepted() - public - { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - emailAuthMsg.proof.accountSalt = 0x0; - - // vm.mockCall( - // address(simpleWallet.emailAuthImplementationAddr()), - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - // // Deploy mock guardian, that status is NONE - // address mockCallAddress; - // if(block.chainid == 300) { - // mockCallAddress = address(0x889170C6bEe9053626f8460A9875d22Cf6DE0782); - // } else { - // mockCallAddress = address(0x2Cfb66029975B1c8881adaa3b79c5Caa4FEB84B5); - // } - // vm.mockCall( - // mockCallAddress, - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("guardian is not deployed")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidTemplateIndex() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 1; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid template index")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - function testExpectRevertHandleRecoveryInvalidcommandParams() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](3); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - commandParamsForRecovery[1] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid command params")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } - - // function testExpectRevertHandleRecoveryInvalidGuardianInEmail() public { - // handleAcceptance(); - - // assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - // assertEq( - // recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - // 0 - // ); - // assertEq(simpleWallet.owner(), deployer); - // assertEq( - // recoveryControllerZKSync.newSignerCandidateOfAccount(address(simpleWallet)), - // address(0x0) - // ); - // uint templateIdx = 0; - - // EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - // uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId(templateIdx); - // emailAuthMsg.templateId = templateId; - // bytes[] memory commandParamsForRecovery = new bytes[](2); - // commandParamsForRecovery[0] = abi.encode(address(0x0)); - // commandParamsForRecovery[1] = abi.encode(newSigner); - // emailAuthMsg.commandParams = commandParamsForRecovery; - - // vm.mockCall( - // address(recoveryControllerZKSync.emailAuthImplementationAddr()), - // abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - // abi.encode(0x0) - // ); - - // vm.startPrank(someRelayer); - // vm.expectRevert(bytes("invalid guardian in email")); - // recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - // vm.stopPrank(); - // } - - function testExpectRevertHandleRecoveryInvalidNewSigner() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(address(0x0)); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - vm.expectRevert(bytes("invalid new signer")); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_rejectRecovery.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_rejectRecovery.t.sol deleted file mode 100644 index e17c900e..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_rejectRecovery.t.sol +++ /dev/null @@ -1,265 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_rejectRecovery is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - /** - * Set up functions - */ - function requestGuardian() public { - setUp(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - } - - function handleAcceptance() public { - requestGuardian(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - - console.log("guardian", guardian); - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - emailAuthMsg.commandParams = commandParamsForAcceptance; - address recoveredAccount = recoveryControllerZKSync - .extractRecoveredAccountFromAcceptanceCommand( - emailAuthMsg.commandParams, - templateIdx - ); - address computedGuardian = recoveryControllerZKSync.computeEmailAuthAddress( - recoveredAccount, - emailAuthMsg.proof.accountSalt - ); - console.log("computed guardian", computedGuardian); - uint templateId = recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - // acceptGuardian is internal, we call handleAcceptance, which calls acceptGuardian internally. - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.ACCEPTED - ); - } - - function handleRecovery() public { - handleAcceptance(); - - assertEq(simpleWallet.owner(), deployer); - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - uint templateIdx = 0; - - EmailAuthMsg memory emailAuthMsg = buildEmailAuthMsg(); - uint templateId = recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ); - emailAuthMsg.templateId = templateId; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(simpleWallet); - commandParamsForRecovery[1] = abi.encode(newSigner); - emailAuthMsg.commandParams = commandParamsForRecovery; - - vm.mockCall( - address(recoveryControllerZKSync.emailAuthImplementationAddr()), - abi.encodeWithSelector(EmailAuth.authEmail.selector, emailAuthMsg), - abi.encode(0x0) - ); - - vm.startPrank(someRelayer); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - vm.stopPrank(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), true); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - } - - function testRejectRecovery() public { - skipIfNotZkSync(); - - vm.warp(block.timestamp + 3 days); - - handleRecovery(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.warp(0); - - vm.startPrank(address(simpleWallet)); - recoveryControllerZKSync.rejectRecovery(); - vm.stopPrank(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - } - - function testExpectRevertRejectRecoveryRecoveryNotInProgress() public { - skipIfNotZkSync(); - - handleAcceptance(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), false); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - 0 - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - address(0x0) - ); - - vm.startPrank(deployer); - vm.expectRevert(bytes("recovery not in progress")); - recoveryControllerZKSync.rejectRecovery(); - vm.stopPrank(); - } - - function testExpectRevertRejectRecovery() public { - skipIfNotZkSync(); - - vm.warp(block.timestamp + 1 days); - - handleRecovery(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(address(simpleWallet)); - vm.warp(block.timestamp + 4 days); - vm.expectRevert(bytes("timelock expired")); - recoveryControllerZKSync.rejectRecovery(); - vm.stopPrank(); - } - - function testExpectRevertRejectRecoveryOwnableUnauthorizedAccount() public { - skipIfNotZkSync(); - - handleRecovery(); - - assertEq(recoveryControllerZKSync.isRecovering(address(simpleWallet)), true); - assertEq( - recoveryControllerZKSync.currentTimelockOfAccount(address(simpleWallet)), - block.timestamp + - recoveryControllerZKSync.timelockPeriodOfAccount( - address(simpleWallet) - ) - ); - assertEq(simpleWallet.owner(), deployer); - assertEq( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ), - newSigner - ); - - vm.startPrank(deployer); - vm.expectRevert("recovery not in progress"); - recoveryControllerZKSync.rejectRecovery(); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_requestGuardian.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_requestGuardian.t.sol deleted file mode 100644 index 1dbe837b..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_requestGuardian.t.sol +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_requestGuardian is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testRequestGuardian() public { - skipIfNotZkSync(); - - setUp(); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED - ); - } - - function testExpectRevertRequestGuardianInvalidGuardian() public { - skipIfNotZkSync(); - - setUp(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - vm.expectRevert(bytes("invalid guardian")); - recoveryControllerZKSync.requestGuardian(address(0x0)); - vm.stopPrank(); - } - - function testExpectRevertRequestGuardianGuardianStatusMustBeNone() public { - skipIfNotZkSync(); - - setUp(); - - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.NONE - ); - - vm.startPrank(deployer); - recoveryControllerZKSync.requestGuardian(guardian); - vm.expectRevert(bytes("guardian status must be NONE")); - recoveryControllerZKSync.requestGuardian(guardian); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_transfer.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_transfer.t.sol deleted file mode 100644 index 5b9440b1..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_transfer.t.sol +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_transfer is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testTransfer() public { - skipIfNotZkSync(); - - setUp(); - - vm.deal(address(simpleWallet), 1 ether); - assertEq(address(simpleWallet).balance, 1 ether); - - vm.deal(receiver, 0 ether); - assertEq(receiver.balance, 0 ether); - vm.startPrank(deployer); - simpleWallet.transfer(receiver, 1 ether); - vm.stopPrank(); - - assertEq(address(simpleWallet).balance, 0 ether); - assertEq(receiver.balance, 1 ether); - } - - function testExpectRevertTransferOnlyOwner() public { - skipIfNotZkSync(); - - setUp(); - - vm.deal(address(simpleWallet), 1 ether); - assertEq(address(simpleWallet).balance, 1 ether); - - vm.deal(receiver, 0 ether); - assertEq(receiver.balance, 0 ether); - - vm.startPrank(receiver); - vm.expectRevert( - abi.encodeWithSelector( - OwnableUpgradeable.OwnableUnauthorizedAccount.selector, - receiver - ) - ); - simpleWallet.transfer(receiver, 1 ether); - vm.stopPrank(); - } - - function testExpectRevertTransferOnlyOwnerInsufficientBalance() public { - skipIfNotZkSync(); - - setUp(); - vm.deal(address(simpleWallet), 1 ether); - assertEq(address(simpleWallet).balance, 1 ether); - - vm.deal(receiver, 0 ether); - assertEq(receiver.balance, 0 ether); - - vm.startPrank(deployer); - vm.expectRevert(bytes("insufficient balance")); - simpleWallet.transfer(receiver, 2 ether); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_withdraw.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_withdraw.t.sol deleted file mode 100644 index 18decdc2..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZKSync_withdraw.t.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_withdraw is StructHelper { - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testWithdraw() public { - skipIfNotZkSync(); - - setUp(); - - vm.deal(address(simpleWallet), 1 ether); - assertEq(address(simpleWallet).balance, 1 ether); - - vm.deal(deployer, 0 ether); - - vm.startPrank(deployer); - simpleWallet.withdraw(1 ether); - vm.stopPrank(); - - assertEq(address(simpleWallet).balance, 0 ether); - assertEq(deployer.balance, 1 ether); - } - - function testExpectRevertWithdrawOnlyOwner() public { - skipIfNotZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - - vm.startPrank(receiver); - vm.expectRevert( - abi.encodeWithSelector( - OwnableUpgradeable.OwnableUnauthorizedAccount.selector, - address(receiver) - ) - ); - simpleWallet.withdraw(1 ether); - vm.stopPrank(); - } - - function testExpectRevertWithdrawInsufficientBalance() public { - skipIfNotZkSync(); - - setUp(); - - assertEq(address(simpleWallet).balance, 1 ether); - - vm.startPrank(deployer); - vm.expectRevert(bytes("insufficient balance")); - simpleWallet.withdraw(10 ether); - vm.stopPrank(); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_acceptanceCommandTemplates.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_acceptanceCommandTemplates.t.sol deleted file mode 100644 index 81d9a67c..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_acceptanceCommandTemplates.t.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryControllerZKSync} from "../helpers/RecoveryControllerZKSync.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_acceptanceCommandTemplates is - StructHelper -{ - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testAcceptanceCommandTemplates() public { - skipIfNotZkSync(); - - setUp(); - string[][] memory res = recoveryController.acceptanceCommandTemplates(); - assertEq(res[0][0], "Accept"); - assertEq(res[0][1], "guardian"); - assertEq(res[0][2], "request"); - assertEq(res[0][3], "for"); - assertEq(res[0][4], "{ethAddr}"); - } -} diff --git a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_recoveryCommandTemplates.t.sol b/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_recoveryCommandTemplates.t.sol deleted file mode 100644 index 62271e43..00000000 --- a/packages/contracts/test/EmailAccountRecoveryZkSync/EmailAccountRecoveryZkSync_recoveryCommandTemplates.t.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import {EmailAuth, EmailAuthMsg} from "../../src/EmailAuth.sol"; -import {RecoveryController} from "../helpers/RecoveryController.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; -import {SimpleWallet} from "../helpers/SimpleWallet.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -contract EmailAccountRecoveryZKSyncTest_recoveryCommandTemplates is - StructHelper -{ - constructor() {} - - function setUp() public override { - super.setUp(); - } - - function testRecoveryCommandTemplates() public { - skipIfNotZkSync(); - - setUp(); - string[][] memory res = recoveryController.recoveryCommandTemplates(); - assertEq(res[0][0], "Set"); - assertEq(res[0][1], "the"); - assertEq(res[0][2], "new"); - assertEq(res[0][3], "signer"); - assertEq(res[0][4], "of"); - assertEq(res[0][5], "{ethAddr}"); - assertEq(res[0][6], "to"); - assertEq(res[0][7], "{ethAddr}"); - } -} diff --git a/packages/contracts/test/Integration.t.sol b/packages/contracts/test/Integration.t.sol deleted file mode 100644 index 174804fe..00000000 --- a/packages/contracts/test/Integration.t.sol +++ /dev/null @@ -1,387 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import "@zk-email/contracts/DKIMRegistry.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "../src/EmailAuth.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "./helpers/SimpleWallet.sol"; -import "./helpers/RecoveryController.sol"; -import "forge-std/console.sol"; -import "../src/utils/ZKSyncCreate2Factory.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; - -contract IntegrationTest is Test { - using Strings for *; - using console for *; - - EmailAuth emailAuth; - Verifier verifier; - UserOverrideableDKIMRegistry dkim; - - RecoveryController recoveryController; - SimpleWallet simpleWallet; - - address deployer = vm.addr(1); - address receiver = vm.addr(2); - address guardian = vm.addr(3); - address relayer = deployer; - - bytes32 accountSalt; - string selector = "12345"; - string domainName = "gmail.com"; - bytes32 publicKeyHash = - 0x0ea9c777dc7110e5a9e89b13f0cfc540e3845ba120b2b6dc24024d61488d4788; - // uint256 startTimestamp = 1729512214; - uint256 recoveryTimelock = 5 days; - uint256 setTimeDelay = 3 days; - - function setUp() public { - vm.createSelectFork("https://mainnet.base.org"); - - // vm.warp(startTimestamp); - - vm.startPrank(deployer); - address signer = deployer; - - // Create DKIM registry - UserOverrideableDKIMRegistry overrideableDkimImpl = new UserOverrideableDKIMRegistry(); - { - ERC1967Proxy overrideableDkimProxy = new ERC1967Proxy( - address(overrideableDkimImpl), - abi.encodeCall( - overrideableDkimImpl.initialize, - (msg.sender, signer, setTimeDelay) - ) - ); - dkim = UserOverrideableDKIMRegistry(address(overrideableDkimProxy)); - } - { - string memory signedMsg = dkim.computeSignedMsg( - dkim.SET_PREFIX(), - domainName, - publicKeyHash - ); - bytes32 digest = MessageHashUtils.toEthSignedMessageHash( - bytes(signedMsg) - ); - (uint8 v, bytes32 r, bytes32 s) = vm.sign(1, digest); - bytes memory signature = abi.encodePacked(r, s, v); - dkim.setDKIMPublicKeyHash( - domainName, - publicKeyHash, - signer, - signature - ); - vm.warp(block.timestamp + setTimeDelay + 1); - } - - // Create Verifier - { - Verifier verifierImpl = new Verifier(); - Groth16Verifier groth16Verifier = new Groth16Verifier(); - ERC1967Proxy verifierProxy = new ERC1967Proxy( - address(verifierImpl), - abi.encodeCall( - verifierImpl.initialize, - (msg.sender, address(groth16Verifier)) - ) - ); - verifier = Verifier(address(verifierProxy)); - } - - // Create EmailAuth - EmailAuth emailAuthImpl = new EmailAuth(); - console.log("emailAuthImpl"); - console.logAddress(address(emailAuthImpl)); - - // Create zkSync Factory - ZKSyncCreate2Factory factoryImpl = new ZKSyncCreate2Factory(); - console.log("factoryImpl"); - console.logAddress(address(factoryImpl)); - - // Create RecoveryController as EmailAccountRecovery implementation - RecoveryController recoveryControllerImpl = new RecoveryController(); - ERC1967Proxy recoveryControllerProxy = new ERC1967Proxy( - address(recoveryControllerImpl), - abi.encodeCall( - recoveryControllerImpl.initialize, - ( - signer, - address(verifier), - address(dkim), - address(emailAuthImpl) - ) - ) - ); - recoveryController = RecoveryController( - payable(address(recoveryControllerProxy)) - ); - - // Create SimpleWallet as EmailAccountRecovery implementation - SimpleWallet simpleWalletImpl = new SimpleWallet(); - ERC1967Proxy simpleWalletProxy = new ERC1967Proxy( - address(simpleWalletImpl), - abi.encodeCall( - simpleWalletImpl.initialize, - (signer, address(recoveryController)) - ) - ); - simpleWallet = SimpleWallet(payable(address(simpleWalletProxy))); - // console.log( - // "emailAuthImplementation", - // simpleWallet.emailAuthImplementation() - // ); - vm.stopPrank(); - vm.startPrank(address(simpleWallet)); - recoveryController.configureTimelockPeriod(recoveryTimelock); - vm.stopPrank(); - } - - function testIntegration_Account_Recovery() public { - console.log("testIntegration_Account_Recovery"); - - bytes32 accountCode = 0x1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54; - uint templateIdx = 0; - - vm.startPrank(relayer); - vm.deal(address(relayer), 1 ether); - - console.log("SimpleWallet is at ", address(simpleWallet)); - assertEq( - address(simpleWallet), - 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 - ); - address simpleWalletOwner = simpleWallet.owner(); - - // Verify the email proof for acceptance - string[] memory inputGenerationInput = new string[](3); - inputGenerationInput[0] = string.concat( - vm.projectRoot(), - "/test/bin/accept.sh" - ); - inputGenerationInput[1] = string.concat( - vm.projectRoot(), - "/test/emails/", - block.chainid.toString(), - "/accept.eml" - ); - inputGenerationInput[2] = uint256(accountCode).toHexString(32); - vm.ffi(inputGenerationInput); - - string memory publicInputFile = vm.readFile( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_public.json" - ) - ); - string[] memory pubSignals = abi.decode( - vm.parseJson(publicInputFile), - (string[]) - ); - - EmailProof memory emailProof; - emailProof.domainName = "gmail.com"; - emailProof.publicKeyHash = bytes32(vm.parseUint(pubSignals[9])); - emailProof.timestamp = vm.parseUint(pubSignals[11]); - emailProof - .maskedCommand = "Accept guardian request for 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1"; - emailProof.emailNullifier = bytes32(vm.parseUint(pubSignals[10])); - emailProof.accountSalt = bytes32(vm.parseUint(pubSignals[32])); - accountSalt = emailProof.accountSalt; - emailProof.isCodeExist = vm.parseUint(pubSignals[33]) == 1; - emailProof.proof = proofToBytes( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_proof.json" - ) - ); - - console.log("dkim public key hash: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[9]))); - console.log("email nullifier: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[10]))); - console.log("timestamp: ", vm.parseUint(pubSignals[11])); - console.log("account salt: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[32]))); - console.log("is code exist: ", vm.parseUint(pubSignals[33])); - - // Call Request guardian -> GuardianStatus.REQUESTED - guardian = recoveryController.computeEmailAuthAddress( - address(simpleWallet), - accountSalt - ); - recoveryController.requestGuardian(guardian); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.REQUESTED, - "GuardianStatus should be REQUESTED" - ); - - // Call handleAcceptance -> GuardianStatus.ACCEPTED - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - EmailAuthMsg memory emailAuthMsg = EmailAuthMsg({ - templateId: recoveryController.computeAcceptanceTemplateId( - templateIdx - ), - commandParams: commandParamsForAcceptance, - skippedCommandPrefix: 0, - proof: emailProof - }); - recoveryController.handleAcceptance(emailAuthMsg, templateIdx); - require( - recoveryController.guardians(guardian) == - RecoveryController.GuardianStatus.ACCEPTED, - "GuardianStatus should be ACCEPTED" - ); - - // Verify the email proof for recovery - inputGenerationInput = new string[](3); - inputGenerationInput[0] = string.concat( - vm.projectRoot(), - "/test/bin/recovery.sh" - ); - inputGenerationInput[1] = string.concat( - vm.projectRoot(), - "/test/emails/", - block.chainid.toString(), - "/recovery.eml" - ); - inputGenerationInput[2] = uint256(accountCode).toHexString(32); - vm.ffi(inputGenerationInput); - - publicInputFile = vm.readFile( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_public.json" - ) - ); - pubSignals = abi.decode(vm.parseJson(publicInputFile), (string[])); - - // EmailProof memory emailProof; - emailProof.domainName = "gmail.com"; - emailProof.publicKeyHash = bytes32(vm.parseUint(pubSignals[9])); - emailProof.timestamp = vm.parseUint(pubSignals[11]); - emailProof - .maskedCommand = "Set the new signer of 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 to 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720"; - emailProof.emailNullifier = bytes32(vm.parseUint(pubSignals[10])); - emailProof.accountSalt = bytes32(vm.parseUint(pubSignals[32])); - require( - emailProof.accountSalt == accountSalt, - "accountSalt should be the same" - ); - emailProof.isCodeExist = vm.parseUint(pubSignals[33]) == 1; - emailProof.proof = proofToBytes( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_proof.json" - ) - ); - - console.log("dkim public key hash: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[9]))); - console.log("email nullifier: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[10]))); - console.log("timestamp: ", vm.parseUint(pubSignals[11])); - console.log("account salt: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[32]))); - console.log("is code exist: ", vm.parseUint(pubSignals[33])); - - // Call handleRecovery -> isRecovering = true; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(address(simpleWallet)); - commandParamsForRecovery[1] = abi.encode( - address(0xa0Ee7A142d267C1f36714E4a8F75612F20a79720) - ); - emailAuthMsg = EmailAuthMsg({ - templateId: recoveryController.computeRecoveryTemplateId( - templateIdx - ), - commandParams: commandParamsForRecovery, - skippedCommandPrefix: 0, - proof: emailProof - }); - recoveryController.handleRecovery(emailAuthMsg, templateIdx); - require( - recoveryController.isRecovering(address(simpleWallet)), - "isRecovering should be set" - ); - require( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ) == 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720, - "newSignerCandidate should be set" - ); - require( - recoveryController.currentTimelockOfAccount(address(simpleWallet)) > - 0, - "timelock should be set" - ); - require( - simpleWallet.owner() == simpleWalletOwner, - "simpleWallet owner should be old one" - ); - - // Call completeRecovery - vm.warp(block.timestamp + recoveryTimelock + 1); - recoveryController.completeRecovery( - address(simpleWallet), - new bytes(0) - ); - console.log("simpleWallet owner: ", simpleWallet.owner()); - require( - !recoveryController.isRecovering(address(simpleWallet)), - "isRecovering should be reset" - ); - require( - recoveryController.newSignerCandidateOfAccount( - address(simpleWallet) - ) == address(0), - "newSignerCandidate should be reset" - ); - require( - recoveryController.currentTimelockOfAccount( - address(simpleWallet) - ) == 0, - "timelock should be reset" - ); - require( - simpleWallet.owner() == 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720, - "simpleWallet owner should be new one" - ); - vm.stopPrank(); - } - - function proofToBytes( - string memory proofPath - ) internal view returns (bytes memory) { - string memory proofFile = vm.readFile(proofPath); - string[] memory pi_a = abi.decode( - vm.parseJson(proofFile, ".pi_a"), - (string[]) - ); - uint256[2] memory pA = [vm.parseUint(pi_a[0]), vm.parseUint(pi_a[1])]; - string[][] memory pi_b = abi.decode( - vm.parseJson(proofFile, ".pi_b"), - (string[][]) - ); - uint256[2][2] memory pB = [ - [vm.parseUint(pi_b[0][1]), vm.parseUint(pi_b[0][0])], - [vm.parseUint(pi_b[1][1]), vm.parseUint(pi_b[1][0])] - ]; - string[] memory pi_c = abi.decode( - vm.parseJson(proofFile, ".pi_c"), - (string[]) - ); - uint256[2] memory pC = [vm.parseUint(pi_c[0]), vm.parseUint(pi_c[1])]; - bytes memory proof = abi.encode(pA, pB, pC); - return proof; - } -} diff --git a/packages/contracts/test/IntegrationZKSync.t.sol b/packages/contracts/test/IntegrationZKSync.t.sol deleted file mode 100644 index 778463c1..00000000 --- a/packages/contracts/test/IntegrationZKSync.t.sol +++ /dev/null @@ -1,390 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import "@zk-email/contracts/DKIMRegistry.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "../src/EmailAuth.sol"; -import "../src/utils/Verifier.sol"; -import "../src/utils/Groth16Verifier.sol"; -import "./helpers/SimpleWallet.sol"; -import "./helpers/RecoveryControllerZKSync.sol"; -import "forge-std/console.sol"; -import "../src/utils/ZKSyncCreate2Factory.sol"; -import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; - -contract IntegrationZKSyncTest is Test { - using Strings for *; - using console for *; - - EmailAuth emailAuth; - Verifier verifier; - UserOverrideableDKIMRegistry dkim; - - RecoveryControllerZKSync recoveryControllerZKSync; - SimpleWallet simpleWallet; - - address deployer = vm.addr(1); - address receiver = vm.addr(2); - address guardian = vm.addr(3); - address relayer = deployer; - - bytes32 accountSalt; - string selector = "12345"; - string domainName = "gmail.com"; - bytes32 publicKeyHash = - 0x0ea9c777dc7110e5a9e89b13f0cfc540e3845ba120b2b6dc24024d61488d4788; - // uint256 startTimestamp = 1723443691; // September 11, 2024, 17:34:51 UTC - uint256 recoveryTimelock = 5 days; - uint256 setTimeDelay = 3 days; - - bytes32 public proxyBytecodeHash = - vm.envOr("PROXY_BYTECODE_HASH", bytes32(0)); - - function setUp() public { - vm.createSelectFork("http://127.0.0.1:8011"); - - vm.startPrank(deployer); - address signer = deployer; - - // Create DKIM registry - UserOverrideableDKIMRegistry overrideableDkimImpl = new UserOverrideableDKIMRegistry(); - { - ERC1967Proxy overrideableDkimProxy = new ERC1967Proxy( - address(overrideableDkimImpl), - abi.encodeCall( - overrideableDkimImpl.initialize, - (msg.sender, signer, setTimeDelay) - ) - ); - dkim = UserOverrideableDKIMRegistry(address(overrideableDkimProxy)); - } - { - string memory signedMsg = dkim.computeSignedMsg( - dkim.SET_PREFIX(), - domainName, - publicKeyHash - ); - bytes32 digest = MessageHashUtils.toEthSignedMessageHash( - bytes(signedMsg) - ); - (uint8 v, bytes32 r, bytes32 s) = vm.sign(1, digest); - bytes memory signature = abi.encodePacked(r, s, v); - dkim.setDKIMPublicKeyHash( - domainName, - publicKeyHash, - signer, - signature - ); - vm.warp(block.timestamp + setTimeDelay + 1); - } - - // Create Verifier - { - Verifier verifierImpl = new Verifier(); - Groth16Verifier groth16Verifier = new Groth16Verifier(); - ERC1967Proxy verifierProxy = new ERC1967Proxy( - address(verifierImpl), - abi.encodeCall( - verifierImpl.initialize, - (msg.sender, address(groth16Verifier)) - ) - ); - verifier = Verifier(address(verifierProxy)); - } - - // Create EmailAuth - EmailAuth emailAuthImpl = new EmailAuth(); - console.log("emailAuthImpl"); - console.logAddress(address(emailAuthImpl)); - - // Create zkSync Factory - ZKSyncCreate2Factory factoryImpl = new ZKSyncCreate2Factory(); - console.log("factoryImpl"); - console.logAddress(address(factoryImpl)); - - // Create RecoveryController as EmailAccountRecovery implementation - RecoveryControllerZKSync recoveryControllerZKSyncImpl = new RecoveryControllerZKSync(); - ERC1967Proxy recoveryControllerZKSyncProxy = new ERC1967Proxy( - address(recoveryControllerZKSyncImpl), - abi.encodeCall( - recoveryControllerZKSyncImpl.initialize, - ( - signer, - address(verifier), - address(dkim), - address(emailAuthImpl), - address(factoryImpl), - proxyBytecodeHash - ) - ) - ); - recoveryControllerZKSync = RecoveryControllerZKSync( - payable(address(recoveryControllerZKSyncProxy)) - ); - - // Create SimpleWallet as EmailAccountRecovery implementation - SimpleWallet simpleWalletImpl = new SimpleWallet(); - ERC1967Proxy simpleWalletProxy = new ERC1967Proxy( - address(simpleWalletImpl), - abi.encodeCall( - simpleWalletImpl.initialize, - (signer, address(recoveryControllerZKSync)) - ) - ); - simpleWallet = SimpleWallet(payable(address(simpleWalletProxy))); - vm.stopPrank(); - vm.startPrank(address(simpleWallet)); - recoveryControllerZKSync.configureTimelockPeriod(recoveryTimelock); - vm.stopPrank(); - } - - function testIntegration_Account_Recovery_ZkSync() public { - console.log("testIntegration_Account_Recovery_ZKSync"); - - bytes32 accountCode = 0x1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54; - uint templateIdx = 0; - - vm.startPrank(relayer); - vm.deal(address(relayer), 1 ether); - - console.log("SimpleWallet is at ", address(simpleWallet)); - assertEq( - address(simpleWallet), - 0xc9a403a0f75924677Dc0b011Da7eD8dD902063A6 - ); - address simpleWalletOwner = simpleWallet.owner(); - - // Verify the email proof for acceptance - string[] memory inputGenerationInput = new string[](3); - inputGenerationInput[0] = string.concat( - vm.projectRoot(), - "/test/bin/accept.sh" - ); - inputGenerationInput[1] = string.concat( - vm.projectRoot(), - "/test/emails/", - block.chainid.toString(), - "/accept.eml" - ); - inputGenerationInput[2] = uint256(accountCode).toHexString(32); - vm.ffi(inputGenerationInput); - - string memory publicInputFile = vm.readFile( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_public.json" - ) - ); - string[] memory pubSignals = abi.decode( - vm.parseJson(publicInputFile), - (string[]) - ); - - EmailProof memory emailProof; - emailProof.domainName = "gmail.com"; - emailProof.publicKeyHash = bytes32(vm.parseUint(pubSignals[9])); - emailProof.timestamp = vm.parseUint(pubSignals[11]); - emailProof - .maskedCommand = "Accept guardian request for 0xc9a403a0f75924677Dc0b011Da7eD8dD902063A6"; - emailProof.emailNullifier = bytes32(vm.parseUint(pubSignals[10])); - emailProof.accountSalt = bytes32(vm.parseUint(pubSignals[32])); - accountSalt = emailProof.accountSalt; - emailProof.isCodeExist = vm.parseUint(pubSignals[33]) == 1; - emailProof.proof = proofToBytes( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_proof.json" - ) - ); - - console.log("dkim public key hash: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[9]))); - console.log("email nullifier: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[10]))); - console.log("timestamp: ", vm.parseUint(pubSignals[11])); - console.log("account salt: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[32]))); - console.log("is code exist: ", vm.parseUint(pubSignals[33])); - - // Call Request guardian -> GuardianStatus.REQUESTED - guardian = recoveryControllerZKSync.computeEmailAuthAddress( - address(simpleWallet), - accountSalt - ); - recoveryControllerZKSync.requestGuardian(guardian); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.REQUESTED, - "GuardianStatus should be REQUESTED" - ); - - // Call handleAcceptance -> GuardianStatus.ACCEPTED - bytes[] memory commandParamsForAcceptance = new bytes[](1); - commandParamsForAcceptance[0] = abi.encode(address(simpleWallet)); - EmailAuthMsg memory emailAuthMsg = EmailAuthMsg({ - templateId: recoveryControllerZKSync.computeAcceptanceTemplateId( - templateIdx - ), - commandParams: commandParamsForAcceptance, - skippedCommandPrefix: 0, - proof: emailProof - }); - recoveryControllerZKSync.handleAcceptance(emailAuthMsg, templateIdx); - require( - recoveryControllerZKSync.guardians(guardian) == - RecoveryControllerZKSync.GuardianStatus.ACCEPTED, - "GuardianStatus should be ACCEPTED" - ); - - // Verify the email proof for recovery - inputGenerationInput = new string[](3); - inputGenerationInput[0] = string.concat( - vm.projectRoot(), - "/test/bin/recovery.sh" - ); - inputGenerationInput[1] = string.concat( - vm.projectRoot(), - "/test/emails/", - block.chainid.toString(), - "/recovery.eml" - ); - inputGenerationInput[2] = uint256(accountCode).toHexString(32); - vm.ffi(inputGenerationInput); - - publicInputFile = vm.readFile( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_public.json" - ) - ); - pubSignals = abi.decode(vm.parseJson(publicInputFile), (string[])); - - // EmailProof memory emailProof; - emailProof.domainName = "gmail.com"; - emailProof.publicKeyHash = bytes32(vm.parseUint(pubSignals[9])); - emailProof.timestamp = vm.parseUint(pubSignals[11]); - - // 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 is account 9 - emailProof - .maskedCommand = "Set the new signer of 0xC9A403A0F75924677DC0B011DA7ED8DD902063A6 to 0xA0EE7A142D267C1F36714E4A8F75612F20A79720"; - - emailProof.emailNullifier = bytes32(vm.parseUint(pubSignals[10])); - emailProof.accountSalt = bytes32(vm.parseUint(pubSignals[32])); - require( - emailProof.accountSalt == accountSalt, - "accountSalt should be the same" - ); - emailProof.isCodeExist = vm.parseUint(pubSignals[33]) == 1; - emailProof.proof = proofToBytes( - string.concat( - vm.projectRoot(), - "/test/build_integration/email_auth_proof.json" - ) - ); - - console.log("dkim public key hash: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[9]))); - console.log("email nullifier: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[10]))); - console.log("timestamp: ", vm.parseUint(pubSignals[11])); - console.log("account salt: "); - console.logBytes32(bytes32(vm.parseUint(pubSignals[32]))); - console.log("is code exist: ", vm.parseUint(pubSignals[33])); - - // Call handleRecovery -> isRecovering = true; - bytes[] memory commandParamsForRecovery = new bytes[](2); - commandParamsForRecovery[0] = abi.encode(address(simpleWallet)); - commandParamsForRecovery[1] = abi.encode( - address(0xa0Ee7A142d267C1f36714E4a8F75612F20a79720) - ); - emailAuthMsg = EmailAuthMsg({ - templateId: recoveryControllerZKSync.computeRecoveryTemplateId( - templateIdx - ), - commandParams: commandParamsForRecovery, - skippedCommandPrefix: 0, - proof: emailProof - }); - recoveryControllerZKSync.handleRecovery(emailAuthMsg, templateIdx); - require( - recoveryControllerZKSync.isRecovering(address(simpleWallet)), - "isRecovering should be set" - ); - require( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ) == 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720, - "newSignerCandidate should be set" - ); - require( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ) > 0, - "timelock should be set" - ); - require( - simpleWallet.owner() == simpleWalletOwner, - "simpleWallet owner should be old one" - ); - - // Call completeRecovery - vm.warp(block.timestamp + recoveryTimelock + 1); - recoveryControllerZKSync.completeRecovery( - address(simpleWallet), - new bytes(0) - ); - console.log("simpleWallet owner: ", simpleWallet.owner()); - require( - !recoveryControllerZKSync.isRecovering(address(simpleWallet)), - "isRecovering should be reset" - ); - require( - recoveryControllerZKSync.newSignerCandidateOfAccount( - address(simpleWallet) - ) == address(0), - "newSignerCandidate should be reset" - ); - require( - recoveryControllerZKSync.currentTimelockOfAccount( - address(simpleWallet) - ) == 0, - "timelock should be reset" - ); - require( - simpleWallet.owner() == 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720, - "simpleWallet owner should be new one" - ); - vm.stopPrank(); - } - - function proofToBytes( - string memory proofPath - ) internal view returns (bytes memory) { - string memory proofFile = vm.readFile(proofPath); - string[] memory pi_a = abi.decode( - vm.parseJson(proofFile, ".pi_a"), - (string[]) - ); - uint256[2] memory pA = [vm.parseUint(pi_a[0]), vm.parseUint(pi_a[1])]; - string[][] memory pi_b = abi.decode( - vm.parseJson(proofFile, ".pi_b"), - (string[][]) - ); - uint256[2][2] memory pB = [ - [vm.parseUint(pi_b[0][1]), vm.parseUint(pi_b[0][0])], - [vm.parseUint(pi_b[1][1]), vm.parseUint(pi_b[1][0])] - ]; - string[] memory pi_c = abi.decode( - vm.parseJson(proofFile, ".pi_c"), - (string[]) - ); - uint256[2] memory pC = [vm.parseUint(pi_c[0]), vm.parseUint(pi_c[1])]; - bytes memory proof = abi.encode(pA, pB, pC); - return proof; - } -} diff --git a/packages/contracts/test/bin/accept.sh b/packages/contracts/test/bin/accept.sh deleted file mode 100755 index a952045a..00000000 --- a/packages/contracts/test/bin/accept.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -EMAIL_FILE_PATH=$1 -ACCOUNT_CODE=$2 - -SCRIPT_DIR=$(cd $(dirname $0); pwd) -WORKSPACE_DIR="${SCRIPT_DIR}/../../" -INPUT_FILE="${SCRIPT_DIR}/../build_integration/accept_input.json" -yarn workspace @zk-email/ether-email-auth-circom gen-input \ - --email-file $EMAIL_FILE_PATH \ - --account-code $ACCOUNT_CODE \ - --input-file $INPUT_FILE \ - --prove -exit 0 \ No newline at end of file diff --git a/packages/contracts/test/bin/recovery.sh b/packages/contracts/test/bin/recovery.sh deleted file mode 100755 index d212762b..00000000 --- a/packages/contracts/test/bin/recovery.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -EMAIL_FILE_PATH=$1 -ACCOUNT_CODE=$2 - -SCRIPT_DIR=$(cd $(dirname $0); pwd) -WORKSPACE_DIR="${SCRIPT_DIR}/../../" -INPUT_FILE="${SCRIPT_DIR}/../build_integration/recovery_input.json" -yarn workspace @zk-email/ether-email-auth-circom gen-input \ - --email-file $EMAIL_FILE_PATH \ - --account-code $ACCOUNT_CODE \ - --input-file $INPUT_FILE \ - --prove -exit 0 \ No newline at end of file diff --git a/packages/contracts/test/emails/300/accept.eml b/packages/contracts/test/emails/300/accept.eml deleted file mode 100644 index f1f54312..00000000 --- a/packages/contracts/test/emails/300/accept.eml +++ /dev/null @@ -1,127 +0,0 @@ -Delivered-To: emaiwallet.alice@gmail.com -Received: by 2002:a05:6f02:50a:b0:77:b002:4a0a with SMTP id 10csp354010rch; - Sat, 26 Oct 2024 03:05:59 -0700 (PDT) -X-Received: by 2002:a05:690c:f0a:b0:6e5:e163:e001 with SMTP id 00721157ae682-6e9d89948d7mr20744637b3.8.1729937158848; - Sat, 26 Oct 2024 03:05:58 -0700 (PDT) -ARC-Seal: i=1; a=rsa-sha256; t=1729937158; cv=none; - d=google.com; s=arc-20240605; - b=V+s/ezo2b7ImjTgbTg7Zn4NZGP7dpxEzMP6NHfpJgeM5eoKiqyhxZJcQKPPd7Ct+nG - +wgNvOq231Qge1xBUUEZ9K81biYH7JS0qezqyPtaSLjYdiEfjc4SwAXaA0p7VBzttVzK - X2Mgpaog+tSb1M+srZh2HlZy7pg45HW7QIrgAQaIOb7ZHFSLNKxHo5fzdJ1Bfg1RZtm9 - ty1fzQ93vOv/KItVyGuwnTRyBTRnRAjhFqUcSbBeiGBtFq4qErmbr7g4AN+D+mbeo7im - fQpQiLDKoxmd6LW+gzuJ0i8jwnZwzklt1Uf5KcHSZF5EYyL3oPGHYm5jk4zCcb7c5xOs - Oyug== -ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :dkim-signature; - bh=LcnAcLtVZuqCU5Jjo9juA2FtHn9o1ru3lHN2dDAZHyQ=; - fh=piqzy4ujdlR+MUXqs15gF7XdlDw2mZShl76veKMclKc=; - b=KGQeCwcswgap53GgtByhGE7GWPSclz7ldctfnGEHdTXb4JfKVakTIWP1q14PyMR0Rj - NKjzZMmdj4hubyg+HpROG3zM3vaNLoEx0W7HQLzdf64PLCIX6a4rTX5vFGWbrwI8AghZ - JOcVRbrmIAN7GsA6G3jw5AZhEieXKKY7MTS1An21JVCilM9FwQx1m/xvrn3Yn49lAyV0 - mkdTKtM84OobusgbvYdwNdgJhWJAA7Ojj9rvlamhZ/b/FSlcdZWg5E53ro5XbQbP7tk/ - YwkeFaamdq3mmBMlLRdBf9ryLLEXe4RjiE1dcTYW5fIG2gxJ6gGABCk00op8my4+N5y4 - TKeQ==; - dara=google.com -ARC-Authentication-Results: i=1; mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=BkoenyZF; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -Return-Path: -Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) - by mx.google.com with SMTPS id 00721157ae682-6e9c6c82315sor21482737b3.16.2024.10.26.03.05.58 - for - (Google Transport Security); - Sat, 26 Oct 2024 03:05:58 -0700 (PDT) -Received-SPF: pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; -Authentication-Results: mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=BkoenyZF; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1729937158; x=1730541958; dara=google.com; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :from:to:cc:subject:date:message-id:reply-to; - bh=LcnAcLtVZuqCU5Jjo9juA2FtHn9o1ru3lHN2dDAZHyQ=; - b=BkoenyZFtCC1AWPIkGh46Ati7NWpgurTPlq3ESfFP0ZDcs83AL0cHJFsMVqGjh9qTw - /o1XN7MyXPxp+uXoQLNTn4Jm8UeAHyb6nqi9sBoN8G6ig27PFK19k3dz/GOADY+Q8N25 - 8Hlibj2wEZpcs3GfVthIKj3hs6xtjsoGUH8N/5cUmIrxbNwqXHaLA16Qw+X+v3cgWbjr - aBkQXippGF6hEFzv+N5gvqi2tqIjlZjPJUXY7YsFUd54Q9Jrk6MUs41VcJ9QUgrPUgmo - 5JsFtGADlekRlrVYQPnnIEZoL4iMkHGeNKtMZtyK+OzGSAQTBZaDZGyDE95p90TTEhv6 - SihQ== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1729937158; x=1730541958; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; - bh=LcnAcLtVZuqCU5Jjo9juA2FtHn9o1ru3lHN2dDAZHyQ=; - b=eAPJHebo0zQ7SF5YGsnvBHYGw7QnvdRO227vsMxOBl2DfRdrp/c0mL4Xjkhh2EKRnc - sXQYHHcwRnN5+jvnTww4v/2sJ+4LhwcoAv3BYS5LrzBHszoLDoXVEvGKg1Qz+lBljh+z - BA1DQdtJPCfN4zo2vpCn3/mClU2vpe9OwbwxZSgx5sqEBcfixcTbhNts379E4K/VFxry - bzOERLdeppOrtF9JKcaMSdIR2/tk7dC+Fw6658E2iCMT1cBFmF1uYg8MVebl7LYva+id - lRpAxtA/WR0zsPB1w2i/c4SfS+9Vf5Li4ZRtVsKMbT8X49nCXTq+V1mOhD2J8JBVAO2h - JahA== -X-Gm-Message-State: AOJu0YzhUHrbcil+369Y3Hb5BJK4BjmYqUBhWB2RDkrgNhbITLbYZ8pW - IRRJ/wukR87f8II7jfOdmWMokhXKjcBMz3VBYhGr8ITG5Jd0vd6b/WEPtXrKVOFzR0Ba+7ma3Ds - qd/8HHNJZUHttpACM5UoEu3LXZphNCp++ -X-Google-Smtp-Source: AGHT+IEThO03WP97va0PLQUTgwmsc9kADVY29b6jjytxjnFqkpKSPJbM5ZB+mmxGo/TLXFc7PsXUETLPq/jPgm1rdK8= -X-Received: by 2002:a05:690c:2841:b0:6e2:12e5:35a2 with SMTP id - 00721157ae682-6e9d8994b2bmr18478697b3.4.1729937158162; Sat, 26 Oct 2024 - 03:05:58 -0700 (PDT) -MIME-Version: 1.0 -References: <671cbe5d.630a0220.e20db.9df1@mx.google.com> -In-Reply-To: <671cbe5d.630a0220.e20db.9df1@mx.google.com> -From: Sora Suegami -Date: Sat, 26 Oct 2024 19:05:47 +0900 -Message-ID: -Subject: Re: [Reply Needed] Accept Email -To: Alice -Content-Type: multipart/alternative; boundary="000000000000cbd16e06255e610a" - ---000000000000cbd16e06255e610a -Content-Type: text/plain; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -On Sat, Oct 26, 2024 at 7:03=E2=80=AFPM Alice = -wrote: - -> Hello! -> -> This is a test email with a basic HTML body. -> Accept guardian request for 0xc9a403a0f75924677Dc0b011Da7eD8dD902063A6 -> Code 1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54 -> -> *Thank you!* -> - - ---=20 ---- -Sent with Gmail for Sidekick Browser - ---000000000000cbd16e06255e610a -Content-Type: text/html; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -


On Sat, Oct 26, 2024 at 7:03=E2=80=AFPM Alice <emaiwallet.alice@gmail.com>= -; wrote:
- =20 -
-

Hello!

-

This is a test email with a basic HTML body.

-
Accept guar= -dian request for 0xc9a403a0f75924677Dc0b011Da7eD8dD902063A6 Code 1162ebff40= -918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54
-

Thank you!

-
- =20 -


--
---
Sent with Gmail for Sidekick Browser
- ---000000000000cbd16e06255e610a-- diff --git a/packages/contracts/test/emails/300/recovery.eml b/packages/contracts/test/emails/300/recovery.eml deleted file mode 100644 index 95f86d6d..00000000 --- a/packages/contracts/test/emails/300/recovery.eml +++ /dev/null @@ -1,127 +0,0 @@ -Delivered-To: emaiwallet.alice@gmail.com -Received: by 2002:a05:6f02:50a:b0:77:b002:4a0a with SMTP id 10csp354626rch; - Sat, 26 Oct 2024 03:07:26 -0700 (PDT) -X-Received: by 2002:a05:690c:2506:b0:66a:ba89:d671 with SMTP id 00721157ae682-6e9d8ab9902mr24442997b3.35.1729937241694; - Sat, 26 Oct 2024 03:07:21 -0700 (PDT) -ARC-Seal: i=1; a=rsa-sha256; t=1729937241; cv=none; - d=google.com; s=arc-20240605; - b=GwbT273POG3bJMybtOyGOxRKvNg3hDG73yX6fiqwW7ZTulvjV1VmVsJT8Su/C81nt8 - g5Y+Pd6ciEI3XB33uBj0U9dZORj7Q3+XYJkOtS9i0tRB+BbMqZvguOkKf1YKDbuURizc - k2i0/We80m3uhamnCxZYSqQ8EuFiiRUiUmVwZOHuDO4ca5BFp8lBqnmzSJg4wpxuo92z - RG+Tu+5AItNWzhI4jbGWBAlM6ncX/pEsDQ4R8sE7u3BRyyOdxeideWEkZyp74MvukHkd - sfIuHKo9wt1wkBwXyy3zLXynjC7kxBqLIobwAWvuVJUMQA0sXUkgKA78wXMzsAJM+cLk - 1j+Q== -ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :dkim-signature; - bh=AqaLmXmHu6qu1K4WXdGaGJwLt+9pUk+m7VL8Dj0OUko=; - fh=piqzy4ujdlR+MUXqs15gF7XdlDw2mZShl76veKMclKc=; - b=NZYDgVZv7zWrKfYNKXfGjEFnLn6GYr7xP+AzjeT4t9MW9KLp3ND6r1reDjPsShofEi - Mswx8/uEvm6riBR3k0r2rl2QfQhqaSBF/oljT1MUL+mBNYb2evZJqEs+YLAWvkKr6OMF - YfytDhRqBRnw8ifLAhP4yyF7pOf93QpDaeRHuRuyahEn5iuuFp9/oqPzwCpOZwpYhCWm - WgGbiAQvyLvoDLNNnSKdAK+/BsP7boRcKAgkreIaedXe/sVScFCpq4o9/9nJXow9SKHJ - ipYiS3Ws/xFubbN3shcUha/lt1L5C983RDFE4gkJ/+4h0L/zy2oot0HLcGmOv4hCnqJM - IaHA==; - dara=google.com -ARC-Authentication-Results: i=1; mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=YMnW3Xsh; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -Return-Path: -Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) - by mx.google.com with SMTPS id 00721157ae682-6e9c6ba4534sor20900587b3.2.2024.10.26.03.07.21 - for - (Google Transport Security); - Sat, 26 Oct 2024 03:07:21 -0700 (PDT) -Received-SPF: pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; -Authentication-Results: mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=YMnW3Xsh; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1729937241; x=1730542041; dara=google.com; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :from:to:cc:subject:date:message-id:reply-to; - bh=AqaLmXmHu6qu1K4WXdGaGJwLt+9pUk+m7VL8Dj0OUko=; - b=YMnW3XshPWwKeGWphgkGbD8JIicy5669KnQbsGdDn5tvOT9DCLnJ4E41vTWTfiV71t - jZbNxF5l9Fw0WPeeaqcH0qCGlGKwrjGAPhIxONKjrL3j7bj2c5Wpv79khu3wpOLw658X - u9S8iIeNmAgiZJg0EpXUEi/tjKohQC1Ag8GmEriyc4wv4PML1SR4An2dpVqjLakZLsXP - 7yt/oW3cKhhnwabMCoPa3KmWq6VKyQ4Scqhq2adZhMMY84eKi6jNAwRfofjfcI7HbloA - B3iZJ55aAVwCs8oUWpwnypLLNLZLDZz4UbIUoB4d1EvURBxlVhUL1lEJE3PxOWpr1GW1 - DNvQ== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1729937241; x=1730542041; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; - bh=AqaLmXmHu6qu1K4WXdGaGJwLt+9pUk+m7VL8Dj0OUko=; - b=dQOKocIpFawpPLKCIU9HSiNq0cnMrUbwZH78ngMbLDkodVHb6iEdnC6BhBaZUyu6HH - H7Wpd7LVj9EpihF9MVhXrXWweW6j3Bp6M+yjXeLBH+DyUFfo8HRLUhxiNF94FHdUH5Oe - mzk9kPMCTzhYpHcf6BrCvHTWrWfU4peDRMrZdtQ+5rG3vmQ1J/JRJZnwd4ThXHZinWwh - 4mMKbLkQgFwE9RUrVGwkf0blegByFGDsQk14m96WSQo8Pb+psiq7sI/Q4dZ/e5kGOCvc - M+6qYR13Hv76Wf5BHDFjWA7QawvqU/v/lCWghwOf7+M4ZMC1iZWHo+HR5glEETBJedsq - YJwA== -X-Gm-Message-State: AOJu0YympUjJfX6WafJYGf7XPsa/P8kvPzM2JD9WJk6SNDJgvdGN/nSW - Xy9eV0GGNjOlafo1D+1B7FmuXn7kdW5RWoPtnRW/MENjRol/2/lfiJxVxiLtnXRh5n2H026S/2d - uZTNqezLOxC3qJi3+JVbCwNoa8V3aKzmT -X-Google-Smtp-Source: AGHT+IE9UXqIayoYdOuQsZUVsrqKSz2rsxJSnIkESJNWRoxXLQyOz0goCgAQyN1U6Vhzx+3It0NpIfY1k4DVpiIdtAY= -X-Received: by 2002:a05:690c:668b:b0:6e3:2864:c6b3 with SMTP id - 00721157ae682-6e9d8afc8admr20369567b3.37.1729937240981; Sat, 26 Oct 2024 - 03:07:20 -0700 (PDT) -MIME-Version: 1.0 -References: <671cbf40.170a0220.1c1735.8ab8@mx.google.com> -In-Reply-To: <671cbf40.170a0220.1c1735.8ab8@mx.google.com> -From: Sora Suegami -Date: Sat, 26 Oct 2024 19:07:09 +0900 -Message-ID: -Subject: Re: [Reply Needed] Recovery Email -To: Alice -Content-Type: multipart/alternative; boundary="000000000000bb89cf06255e664d" - ---000000000000bb89cf06255e664d -Content-Type: text/plain; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -On Sat, Oct 26, 2024 at 7:06=E2=80=AFPM Alice = -wrote: - -> Hello! -> -> This is a test email with a basic HTML body. -> Set the new signer of 0xC9A403A0F75924677DC0B011DA7ED8DD902063A6 to -> 0xA0EE7A142D267C1F36714E4A8F75612F20A79720 -> -> *Thank you!* -> - - ---=20 ---- -Sent with Gmail for Sidekick Browser - ---000000000000bb89cf06255e664d -Content-Type: text/html; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -


On Sat, Oct 26, 2024 at 7:06=E2=80=AFPM Alice <emaiwallet.alice@gmail.com>= -; wrote:
- =20 -
-

Hello!

-

This is a test email with a basic HTML body.

-
Set the new s= -igner of 0xC9A403A0F75924677DC0B011DA7ED8DD902063A6 to 0xA0EE7A142D267C1F36= -714E4A8F75612F20A79720
-

Thank you!

-
- =20 -


--
---
Sent with Gmail for Sidekick Browser
- ---000000000000bb89cf06255e664d-- diff --git a/packages/contracts/test/emails/8453/accept.eml b/packages/contracts/test/emails/8453/accept.eml deleted file mode 100644 index 8082498d..00000000 --- a/packages/contracts/test/emails/8453/accept.eml +++ /dev/null @@ -1,127 +0,0 @@ -Delivered-To: emaiwallet.alice@gmail.com -Received: by 2002:a05:6f02:6f6:b0:77:b002:4a0a with SMTP id f54csp330097rce; - Fri, 1 Nov 2024 03:02:42 -0700 (PDT) -X-Received: by 2002:a05:690c:9c0f:b0:6de:a3:a7ca with SMTP id 00721157ae682-6e9d8acb4a9mr277187697b3.32.1730455361946; - Fri, 01 Nov 2024 03:02:41 -0700 (PDT) -ARC-Seal: i=1; a=rsa-sha256; t=1730455361; cv=none; - d=google.com; s=arc-20240605; - b=UT9PJ1kGlcXGGEjGgXHBTkf3N9y5J8rWimEVNdGzZiZmpVCfI68ja3sRSK0iq/RThp - GCf+AIXLL5dQ3hUPd0CNRozTqryNmoLndgpiuOHlb3HhllSaDO/KLYjSFr0G8CbRekGh - bEhlknRr6uZ/sOqOjHRAcBU7QZRpUNW341HUqBvLxx4tmL2HwfzJZmoI05ZWT70Bp4Js - IsjTQXwMtWF4KEsMyyAuVGlu/V9y+eq+TifqOxIgdQCIEs2TpBf+eHgnVbayXbsh3waU - o6QDbcvYd1CNcepgxWXppjn67GhMOAApSLhfM7q7uy3bo4L8Lld8DPGfDQ5ICvgzrVMh - rLbA== -ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :dkim-signature; - bh=KyF9d1a+n4fYTSkZQNoUYaw6sykzzH9Y53ENgK0zkoA=; - fh=piqzy4ujdlR+MUXqs15gF7XdlDw2mZShl76veKMclKc=; - b=k9wqht/tAObn9SnYH6WEwoMkKhD9yjZJj5HoQHrPnr6sZq3pJKQPfDOoyg3oiMz+Jg - oV/UDi3smJW4zgyev86/o+RCoFpOICeJ4CbXOMRqGXzOuSddTQD2Bj/3LWmxoKr8QdFh - 5S82Jf1DIAGmOS6NEnxBc5tOKSyXL9MbiXyCZ7b40XIs+yRwPV2ZXBzPj8ydJoW5ScYe - alOQl+oKGJ3GBK+vHIoklFOl8CKKcs05PG0HH4btGMziCtMb/VA5RqYLuZ2Dg9T2q0PZ - G+m78daUJySJFqL5AIpQNWHadNsXubSv8GYchlaUIvP0xfKTTyGKdvnjkQ2GCJ50kIV4 - L9hw==; - dara=google.com -ARC-Authentication-Results: i=1; mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=CQfLn7Bw; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -Return-Path: -Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) - by mx.google.com with SMTPS id 00721157ae682-6ea55b3ca7csor26603827b3.7.2024.11.01.03.02.41 - for - (Google Transport Security); - Fri, 01 Nov 2024 03:02:41 -0700 (PDT) -Received-SPF: pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; -Authentication-Results: mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=CQfLn7Bw; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1730455361; x=1731060161; dara=google.com; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :from:to:cc:subject:date:message-id:reply-to; - bh=KyF9d1a+n4fYTSkZQNoUYaw6sykzzH9Y53ENgK0zkoA=; - b=CQfLn7BwyPRSED9uryHffAUv/H5b1LMI7Yirj7BYBEg6csGx8WqGecX8QUpKRcc+EU - ikEohKU88TXkt5CjQlgjCssP3NScZApqRdq929Q2ztH+ZCorbsZDoV2qsrl5XVlRHaTu - qqQKnzv8VaUGFaRFE/v6l4hlsQj9yOFCEPdj3atWpBR60sl9QzZlbITXMsRUJAj3kO+a - 9kv6KhItPyO6u3JL+ma/NYSgcftaSEN0cRBW9xQjzygGAEzERjkAF72GReMDdf0t1ir2 - wkbCRvzlTd/KhrjjKAnO3FbKoC4knvpQJzf8Qekq2VLpgnIF1T1KTbPLIqhtbrX6l4AV - sIsw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1730455361; x=1731060161; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; - bh=KyF9d1a+n4fYTSkZQNoUYaw6sykzzH9Y53ENgK0zkoA=; - b=O5YLktCAErj8Kc1pveGTSZ/+22ADKlhS84tBCBlPYG9JV6QIOlJlPrMezX8jpO4Opd - x80n8uS1LtJLBQfWAap1zLxIZk9Q3v9N4CYK011TfnJ+ZXtlM0uiorX2pSvVBbiXtYnP - hPYEB1b22RMg3auErPPf/ndWgXIIV3DmdkElXXWrczt9YjKAVi5IAfAuR4TdUJ7FQrbE - tuC6wC806UzYaIidDByZF3JJUeZJkkI0bpiennbpMSmtJWnT6U84DFae7rBKCGcJOb2r - RNb1VY3HYuPQnR18zvVK2x12M7EyYZy+dFVgeR+2CeTTEPdnNG+V8rsHF1fCJgJAgjFz - BTHA== -X-Gm-Message-State: AOJu0Yycx94I/O2Lm7bU41w1OyXLtrVTntxgrqYKFAr6Q0BdW/2mS5WT - 1rAnV+X4oijRr+5xVc0hiJfeOgfYzU+s/WCjUj+t+kuD9FYK7N100AdaXhy5/OLTe2mFcbzDvVs - qW2qMQ127i23xQViSFMd+0VpkUB6qFlyt -X-Google-Smtp-Source: AGHT+IF2B+yIY7gaQxHWawqKLaW9hPUSYUTmXS2OkBkr/IxO58SRqSK9ryWyrMNcXzBftKSKWUiCu3tJ3I8blbNSwlg= -X-Received: by 2002:a05:690c:318e:b0:6e6:45b:5d0 with SMTP id - 00721157ae682-6e9d8b55218mr147141597b3.45.1730455361170; Fri, 01 Nov 2024 - 03:02:41 -0700 (PDT) -MIME-Version: 1.0 -References: <6724a727.170a0220.1bb60.8eff@mx.google.com> -In-Reply-To: <6724a727.170a0220.1bb60.8eff@mx.google.com> -From: Sora Suegami -Date: Fri, 1 Nov 2024 19:02:28 +0900 -Message-ID: -Subject: Re: [Reply Needed] Accept Email -To: Alice -Content-Type: multipart/alternative; boundary="0000000000001a344d0625d70920" - ---0000000000001a344d0625d70920 -Content-Type: text/plain; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -On Fri, Nov 1, 2024 at 7:02=E2=80=AFPM Alice w= -rote: - -> Hello! -> -> This is a test email with a basic HTML body. -> Accept guardian request for 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 -> Code 1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54 -> -> *Thank you!* -> - - ---=20 ---- -Sent with Gmail for Sidekick Browser - ---0000000000001a344d0625d70920 -Content-Type: text/html; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -


On Fri, Nov 1, 2024 at 7:02=E2=80=AFPM Alice <emaiwallet.alice@gmail.com>= - wrote:
- =20 -
-

Hello!

-

This is a test email with a basic HTML body.

-
Accept guard= -ian request for 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 Code 1162ebff409= -18afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54
-

Thank you!

-
- =20 -


--
---
Sent with Gmail for Sidekick Browser
- ---0000000000001a344d0625d70920-- diff --git a/packages/contracts/test/emails/8453/recovery.eml b/packages/contracts/test/emails/8453/recovery.eml deleted file mode 100644 index abfd73f9..00000000 --- a/packages/contracts/test/emails/8453/recovery.eml +++ /dev/null @@ -1,127 +0,0 @@ -Delivered-To: emaiwallet.alice@gmail.com -Received: by 2002:a05:6f02:6f6:b0:77:b002:4a0a with SMTP id f54csp331236rce; - Fri, 1 Nov 2024 03:04:29 -0700 (PDT) -X-Received: by 2002:a05:690c:708d:b0:6ea:2ac4:9df6 with SMTP id 00721157ae682-6ea64ab2f86mr32916447b3.3.1730455469506; - Fri, 01 Nov 2024 03:04:29 -0700 (PDT) -ARC-Seal: i=1; a=rsa-sha256; t=1730455469; cv=none; - d=google.com; s=arc-20240605; - b=kXXzlAXeS6ht9X8mgWup1C2zoTqFH6beoAJik2VmQRjfaVsBW8WFXsDlAX0UEwITGs - 3F5neaBnwHjWrQv+RphDJ/CthdXRLqUl/HAI+TpmBDOkgNlZjz5OwHpWKMkoHUbgX+9k - hFQIrJknl4JB7dAds6P4No3E/cwlHDKxgey2GZWwWToEC+EKsC5ejgjZaw0XRYnL8j5p - 4669mxwnH5C/ye/eJ9B6KS+qr7MBw1VuZIr5TOXbvZG/3xcsTGFiZ9KN4VMx+q557BRd - N/WuNGOsHQHEHUEBne1+HPtGUJ/vTX6v/WcWaOsMX4qMpgIeIWl5Siqo2HO/aJ/xF0Mp - zlKw== -ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :dkim-signature; - bh=qfP3fcgGLM6DKMMm9CJ3H+Hz60AolkxUOYYkf2x1EQo=; - fh=piqzy4ujdlR+MUXqs15gF7XdlDw2mZShl76veKMclKc=; - b=JJ1Exgudtr8gwlXqq1dOMfZRcMLlEbEeAf08c2kXTMMyzAw6RBNh+Gafm4jt8fspEB - 0LhjkC1QvP0vAQCOqESbq7Xa2K5vkEdMQcXLRpUYyh+gEn3BYPCmbiCT9Ox1a7emxlFO - sbF5zQ8Q2fVGXTm1BQtSsHb+gLIVDxuQLYtmGYLzc4zrJ8KVwwV880mv2SAIunFi3zzz - h1KXV6shHPf2frj7AsZyoRaln7Uz3pH3Evbn1EDY4H6V3xpbaBQOiQER/2/DhVHGKgGm - figBUs9bsGv/g/o6nLtTVLi8KRk/6ijpx4gqIc3/VDzPLuNiZXTFteB11NdP+Z5QQr0N - HsMg==; - dara=google.com -ARC-Authentication-Results: i=1; mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=HdCCbFgP; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -Return-Path: -Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) - by mx.google.com with SMTPS id 00721157ae682-6ea55fa703dsor28180747b3.13.2024.11.01.03.04.29 - for - (Google Transport Security); - Fri, 01 Nov 2024 03:04:29 -0700 (PDT) -Received-SPF: pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; -Authentication-Results: mx.google.com; - dkim=pass header.i=@gmail.com header.s=20230601 header.b=HdCCbFgP; - spf=pass (google.com: domain of suegamisora@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=suegamisora@gmail.com; - dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; - dara=pass header.i=@gmail.com -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1730455469; x=1731060269; dara=google.com; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :from:to:cc:subject:date:message-id:reply-to; - bh=qfP3fcgGLM6DKMMm9CJ3H+Hz60AolkxUOYYkf2x1EQo=; - b=HdCCbFgP+MMDhws3gnsyQSJOiFOYiXT/LqI/sziklrZgwppoCUxuCQaXYoaStJOklZ - HNLypVL9XqYizfqEF4EwQSGE+EcnCVMYInx+dL6n2sv93pLiQYGggwoL3O+tEiZOdrT9 - xfRqcGSTWSHjykf+8Ja6E4evTb6htclHcmJLEWPG38bCX19iAUQA1/ncIIclCHJoXZi3 - smKpSm4pQjAohGyq6uuGws4JUlNziPHdpU+POx/726KtxZ2qGsBxn5fm1JT4TY41ddHv - w88ptrwnEvUP4hR+3kbLsn6NBwlxzBDT1ocBhZ/WsvNBQlt+pZtwiG61LDF4peK6Xvk0 - jNjA== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1730455469; x=1731060269; - h=to:subject:message-id:date:from:in-reply-to:references:mime-version - :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; - bh=qfP3fcgGLM6DKMMm9CJ3H+Hz60AolkxUOYYkf2x1EQo=; - b=u9PJ5BMFezervz47BOTSfhnxe0gKbmbbbjjjN8IM60fquCnkKOOFmk1tP4fes+iDev - 3q59+i51jg2HGu5S3yt+xA+bNSjKI231/jcxHYa+03HV2v14PZUZIvy3pptBPUvE69NB - Q7raPLNH2NoW3azZbXDvcT3pXtLJzPF9rn/h0NfjTehbai4NXZShA7sBf8OYWOMSNiyb - nKqQmeJsYlxBTWQaAoTEG5OLQzhyP9DWqUCAGpxORXSDo4p+siiMKXWl2hUhVHT68+e/ - LPgD4d0emoAeJY4driZGx1SbfYiLMpyQP7CMWQCrsCNnUDlATO36Cs90kOwVAnjP0M8W - hqfw== -X-Gm-Message-State: AOJu0YzLSJ1kJRnegVjBkilYs3ZAsCLhVihVYNDOIm9c9nruTAzSsfNU - tOKgiTONti0dufWvLMEebJJxktAEoeVppFp4w5Zz/xrNmBSsWSAEcJIoEbuWcCJoEywFN6RnB0D - pqWD/78nb6xC55VTEbQvzdkfpGFNU+3mU -X-Google-Smtp-Source: AGHT+IH+lF2f38lLJ+LMdVr86b9JpC1RoVG2y1BzooyNEtphr3e3lQt3UzM9u3dslLl6S8OD2I6vAN6P8rauQYV1zpY= -X-Received: by 2002:a05:690c:7482:b0:6ea:3e6d:2b01 with SMTP id - 00721157ae682-6ea64b2b6femr32405347b3.19.1730455468746; Fri, 01 Nov 2024 - 03:04:28 -0700 (PDT) -MIME-Version: 1.0 -References: <6724a77c.a70a0220.fcd92.a9ea@mx.google.com> -In-Reply-To: <6724a77c.a70a0220.fcd92.a9ea@mx.google.com> -From: Sora Suegami -Date: Fri, 1 Nov 2024 19:04:11 +0900 -Message-ID: -Subject: Re: [Reply Needed] Recovery Email -To: Alice -Content-Type: multipart/alternative; boundary="00000000000083afb90625d70fee" - ---00000000000083afb90625d70fee -Content-Type: text/plain; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -On Fri, Nov 1, 2024 at 7:03=E2=80=AFPM Alice w= -rote: - -> Hello! -> -> This is a test email with a basic HTML body. -> Set the new signer of 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 to -> 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 -> -> *Thank you!* -> - - ---=20 ---- -Sent with Gmail for Sidekick Browser - ---00000000000083afb90625d70fee -Content-Type: text/html; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -


On Fri, Nov 1, 2024 at 7:03=E2=80=AFPM Alice <emaiwallet.alice@gmail.com>= - wrote:
- =20 -
-

Hello!

-

This is a test email with a basic HTML body.

-
Set the new = -signer of 0xa3A6f0FDd72Ae9936C44cE36151CB4DB3E9949d1 to 0xa0Ee7A142d267C1f3= -6714E4a8F75612F20a79720
-

Thank you!

-
- =20 -


--
---
Sent with Gmail for Sidekick Browser
- ---00000000000083afb90625d70fee-- diff --git a/packages/contracts/test/helpers/DeploymentHelper.sol b/packages/contracts/test/helpers/DeploymentHelper.sol index 4d421a7b..fb102b24 100644 --- a/packages/contracts/test/helpers/DeploymentHelper.sol +++ b/packages/contracts/test/helpers/DeploymentHelper.sol @@ -10,16 +10,9 @@ import {Verifier, EmailProof} from "../../src/utils/Verifier.sol"; import {Groth16Verifier} from "../../src/utils/Groth16Verifier.sol"; import {ECDSAOwnedDKIMRegistry} from "../../src/utils/ECDSAOwnedDKIMRegistry.sol"; import {UserOverrideableDKIMRegistry} from "@zk-email/contracts/UserOverrideableDKIMRegistry.sol"; -import {SimpleWallet} from "./SimpleWallet.sol"; -import {RecoveryController, EmailAccountRecovery} from "./RecoveryController.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -// // FOR_ZKSYNC:START -// import {ZKSyncCreate2Factory} from "../../src/utils/ZKSyncCreate2Factory.sol"; -// import {RecoveryControllerZKSync, EmailAccountRecoveryZKSync} from "./RecoveryControllerZKSync.sol"; -// // FOR_ZKSYNC:END - contract DeploymentHelper is Test { using ECDSA for *; @@ -27,13 +20,6 @@ contract DeploymentHelper is Test { Verifier verifier; ECDSAOwnedDKIMRegistry dkim; UserOverrideableDKIMRegistry overrideableDkimImpl; - RecoveryController recoveryController; - SimpleWallet simpleWalletImpl; - SimpleWallet simpleWallet; - - // // FOR_ZKSYNC:START - // RecoveryControllerZKSync recoveryControllerZKSync; - // // FOR_ZKSYNC:END address deployer = vm.addr(1); address receiver = vm.addr(2); @@ -138,75 +124,6 @@ contract DeploymentHelper is Test { commandTemplate = ["Send", "{decimals}", "ETH", "to", "{ethAddr}"]; newCommandTemplate = ["Send", "{decimals}", "USDC", "to", "{ethAddr}"]; - // Create RecoveryController as EmailAccountRecovery implementation - RecoveryController recoveryControllerImpl = new RecoveryController(); - ERC1967Proxy recoveryControllerProxy = new ERC1967Proxy( - address(recoveryControllerImpl), - abi.encodeCall( - recoveryControllerImpl.initialize, - ( - signer, - address(verifier), - address(dkim), - address(emailAuthImpl) - ) - ) - ); - recoveryController = RecoveryController( - payable(address(recoveryControllerProxy)) - ); - - // Create SimpleWallet - simpleWalletImpl = new SimpleWallet(); - address recoveryControllerAddress = address(recoveryController); - - // // FOR_ZKSYNC:START - // // Create zkSync Factory implementation - // if (isZkSync()) { - // ZKSyncCreate2Factory factoryImpl = new ZKSyncCreate2Factory(); - // // Create RecoveryControllerZKSync as EmailAccountRecovery implementation - // RecoveryControllerZKSync recoveryControllerZKSyncImpl = new RecoveryControllerZKSync(); - // ERC1967Proxy recoveryControllerZKSyncProxy = new ERC1967Proxy( - // address(recoveryControllerZKSyncImpl), - // abi.encodeCall( - // recoveryControllerZKSyncImpl.initialize, - // ( - // signer, - // address(verifier), - // address(dkim), - // address(emailAuthImpl), - // address(factoryImpl), - // proxyBytecodeHash - // ) - // ) - // ); - // recoveryControllerZKSync = RecoveryControllerZKSync( - // payable(address(recoveryControllerZKSyncProxy)) - // ); - // recoveryControllerAddress = address(recoveryControllerZKSync); - // } - // // FOR_ZKSYNC:END - - ERC1967Proxy simpleWalletProxy = new ERC1967Proxy( - address(simpleWalletImpl), - abi.encodeCall( - simpleWalletImpl.initialize, - (signer, recoveryControllerAddress) - ) - ); - simpleWallet = SimpleWallet(payable(address(simpleWalletProxy))); - vm.deal(address(simpleWallet), 1 ether); - - // Set guardian address - guardian = EmailAccountRecovery(address(recoveryController)) - .computeEmailAuthAddress(address(simpleWallet), accountSalt); - // // FOR_ZKSYNC:START - // if (isZkSync()) { - // guardian = EmailAccountRecoveryZKSync(address(recoveryControllerZKSync)) - // .computeEmailAuthAddress(address(simpleWallet), accountSalt); - // } - // // FOR_ZKSYNC:END - vm.stopPrank(); } diff --git a/packages/contracts/test/helpers/RecoveryController.sol b/packages/contracts/test/helpers/RecoveryController.sol deleted file mode 100644 index a73e5b7e..00000000 --- a/packages/contracts/test/helpers/RecoveryController.sol +++ /dev/null @@ -1,184 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {EmailAccountRecovery} from "../../src/EmailAccountRecovery.sol"; -import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {SimpleWallet} from "./SimpleWallet.sol"; -import "forge-std/console.sol"; - -contract RecoveryController is OwnableUpgradeable, EmailAccountRecovery { - enum GuardianStatus { - NONE, - REQUESTED, - ACCEPTED - } - uint public constant DEFAULT_TIMELOCK_PERIOD = 3 days; - - mapping(address => bool) public isActivatedOfAccount; - mapping(address => bool) public isRecovering; - mapping(address => address) public newSignerCandidateOfAccount; - mapping(address => GuardianStatus) public guardians; - mapping(address => uint) public timelockPeriodOfAccount; - mapping(address => uint) public currentTimelockOfAccount; - - constructor() {} - - function initialize( - address _initialOwner, - address _verifier, - address _dkim, - address _emailAuthImplementation - ) public initializer { - __Ownable_init(_initialOwner); - verifierAddr = _verifier; - dkimAddr = _dkim; - emailAuthImplementationAddr = _emailAuthImplementation; - } - - function isActivated( - address recoveredAccount - ) public view override returns (bool) { - return isActivatedOfAccount[recoveredAccount]; - } - - function acceptanceCommandTemplates() - public - pure - override - returns (string[][] memory) - { - string[][] memory templates = new string[][](1); - templates[0] = new string[](5); - templates[0][0] = "Accept"; - templates[0][1] = "guardian"; - templates[0][2] = "request"; - templates[0][3] = "for"; - templates[0][4] = "{ethAddr}"; - return templates; - } - - function recoveryCommandTemplates() - public - pure - override - returns (string[][] memory) - { - string[][] memory templates = new string[][](1); - templates[0] = new string[](8); - templates[0][0] = "Set"; - templates[0][1] = "the"; - templates[0][2] = "new"; - templates[0][3] = "signer"; - templates[0][4] = "of"; - templates[0][5] = "{ethAddr}"; - templates[0][6] = "to"; - templates[0][7] = "{ethAddr}"; - return templates; - } - - function extractRecoveredAccountFromAcceptanceCommand( - bytes[] memory commandParams, - uint templateIdx - ) public pure override returns (address) { - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 1, "invalid command params"); - return abi.decode(commandParams[0], (address)); - } - - function extractRecoveredAccountFromRecoveryCommand( - bytes[] memory commandParams, - uint templateIdx - ) public pure override returns (address) { - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 2, "invalid command params"); - return abi.decode(commandParams[0], (address)); - } - - function requestGuardian(address guardian) public { - address account = msg.sender; - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - require( - guardians[guardian] == GuardianStatus.NONE, - "guardian status must be NONE" - ); - if (!isActivatedOfAccount[account]) { - isActivatedOfAccount[account] = true; - } - guardians[guardian] = GuardianStatus.REQUESTED; - } - - function configureTimelockPeriod(uint period) public { - timelockPeriodOfAccount[msg.sender] = period; - } - - function acceptGuardian( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 - ) internal override { - address account = abi.decode(commandParams[0], (address)); - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - - require( - guardians[guardian] == GuardianStatus.REQUESTED, - "guardian status must be REQUESTED" - ); - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 1, "invalid command params"); - guardians[guardian] = GuardianStatus.ACCEPTED; - } - - function processRecovery( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 - ) internal override { - address account = abi.decode(commandParams[0], (address)); - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - require( - guardians[guardian] == GuardianStatus.ACCEPTED, - "guardian status must be ACCEPTED" - ); - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 2, "invalid command params"); - address newSignerInEmail = abi.decode(commandParams[1], (address)); - require(newSignerInEmail != address(0), "invalid new signer"); - isRecovering[account] = true; - newSignerCandidateOfAccount[account] = newSignerInEmail; - currentTimelockOfAccount[account] = - block.timestamp + - timelockPeriodOfAccount[account]; - } - - function rejectRecovery() public { - address account = msg.sender; - require(isRecovering[account], "recovery not in progress"); - require( - currentTimelockOfAccount[account] > block.timestamp, - "timelock expired" - ); - isRecovering[account] = false; - newSignerCandidateOfAccount[account] = address(0); - currentTimelockOfAccount[account] = 0; - } - - function completeRecovery(address account, bytes memory) public override { - require(account != address(0), "invalid account"); - require(isRecovering[account], "recovery not in progress"); - require( - currentTimelockOfAccount[account] <= block.timestamp, - "timelock not expired" - ); - address newSigner = newSignerCandidateOfAccount[account]; - isRecovering[account] = false; - currentTimelockOfAccount[account] = 0; - newSignerCandidateOfAccount[account] = address(0); - SimpleWallet(payable(account)).changeOwner(newSigner); - } -} diff --git a/packages/contracts/test/helpers/RecoveryControllerZKSync.sol b/packages/contracts/test/helpers/RecoveryControllerZKSync.sol deleted file mode 100644 index 9f7714d9..00000000 --- a/packages/contracts/test/helpers/RecoveryControllerZKSync.sol +++ /dev/null @@ -1,196 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {EmailAccountRecoveryZKSync} from "../../src/EmailAccountRecoveryZKSync.sol"; -import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {SimpleWallet} from "./SimpleWallet.sol"; - -contract RecoveryControllerZKSync is - OwnableUpgradeable, - EmailAccountRecoveryZKSync -{ - enum GuardianStatus { - NONE, - REQUESTED, - ACCEPTED - } - uint public constant DEFAULT_TIMELOCK_PERIOD = 3 days; - - mapping(address => bool) public isActivatedOfAccount; - mapping(address => bool) public isRecovering; - mapping(address => address) public newSignerCandidateOfAccount; - mapping(address => GuardianStatus) public guardians; - mapping(address => uint) public timelockPeriodOfAccount; - mapping(address => uint) public currentTimelockOfAccount; - - // modifier onlyNotRecoveringOwner() { - // require(msg.sender == owner(), "only owner"); - // require(!isRecovering, "recovery in progress"); - // _; - // } - - constructor() {} - - function initialize( - address _initialOwner, - address _verifier, - address _dkim, - address _emailAuthImplementation, - address _factory, - bytes32 _proxyBytecodeHash - ) public initializer { - __Ownable_init(_initialOwner); - verifierAddr = _verifier; - dkimAddr = _dkim; - emailAuthImplementationAddr = _emailAuthImplementation; - factoryAddr = _factory; - proxyBytecodeHash = _proxyBytecodeHash; - } - - function isActivated( - address recoveredAccount - ) public view override returns (bool) { - return isActivatedOfAccount[recoveredAccount]; - } - - function acceptanceCommandTemplates() - public - pure - override - returns (string[][] memory) - { - string[][] memory templates = new string[][](1); - templates[0] = new string[](5); - templates[0][0] = "Accept"; - templates[0][1] = "guardian"; - templates[0][2] = "request"; - templates[0][3] = "for"; - templates[0][4] = "{ethAddr}"; - return templates; - } - - function recoveryCommandTemplates() - public - pure - override - returns (string[][] memory) - { - string[][] memory templates = new string[][](1); - templates[0] = new string[](8); - templates[0][0] = "Set"; - templates[0][1] = "the"; - templates[0][2] = "new"; - templates[0][3] = "signer"; - templates[0][4] = "of"; - templates[0][5] = "{ethAddr}"; - templates[0][6] = "to"; - templates[0][7] = "{ethAddr}"; - return templates; - } - - function extractRecoveredAccountFromAcceptanceCommand( - bytes[] memory commandParams, - uint templateIdx - ) public pure override returns (address) { - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 1, "invalid command params"); - return abi.decode(commandParams[0], (address)); - } - - function extractRecoveredAccountFromRecoveryCommand( - bytes[] memory commandParams, - uint templateIdx - ) public pure override returns (address) { - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 2, "invalid command params"); - return abi.decode(commandParams[0], (address)); - } - - function requestGuardian(address guardian) public { - address account = msg.sender; - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - require( - guardians[guardian] == GuardianStatus.NONE, - "guardian status must be NONE" - ); - if (!isActivatedOfAccount[account]) { - isActivatedOfAccount[account] = true; - } - guardians[guardian] = GuardianStatus.REQUESTED; - } - - function configureTimelockPeriod(uint period) public { - timelockPeriodOfAccount[msg.sender] = period; - } - - function acceptGuardian( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 - ) internal override { - address account = abi.decode(commandParams[0], (address)); - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - - require( - guardians[guardian] == GuardianStatus.REQUESTED, - "guardian status must be REQUESTED" - ); - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 1, "invalid command params"); - guardians[guardian] = GuardianStatus.ACCEPTED; - } - - function processRecovery( - address guardian, - uint templateIdx, - bytes[] memory commandParams, - bytes32 - ) internal override { - address account = abi.decode(commandParams[0], (address)); - require(!isRecovering[account], "recovery in progress"); - require(guardian != address(0), "invalid guardian"); - require( - guardians[guardian] == GuardianStatus.ACCEPTED, - "guardian status must be ACCEPTED" - ); - require(templateIdx == 0, "invalid template index"); - require(commandParams.length == 2, "invalid command params"); - address newSignerInEmail = abi.decode(commandParams[1], (address)); - require(newSignerInEmail != address(0), "invalid new signer"); - isRecovering[account] = true; - newSignerCandidateOfAccount[account] = newSignerInEmail; - currentTimelockOfAccount[account] = - block.timestamp + - timelockPeriodOfAccount[account]; - } - - function rejectRecovery() public { - address account = msg.sender; - require(isRecovering[account], "recovery not in progress"); - require( - currentTimelockOfAccount[account] > block.timestamp, - "timelock expired" - ); - isRecovering[account] = false; - newSignerCandidateOfAccount[account] = address(0); - currentTimelockOfAccount[account] = 0; - } - - function completeRecovery(address account, bytes memory) public override { - require(account != address(0), "invalid account"); - require(isRecovering[account], "recovery not in progress"); - require( - currentTimelockOfAccount[account] <= block.timestamp, - "timelock not expired" - ); - address newSigner = newSignerCandidateOfAccount[account]; - isRecovering[account] = false; - currentTimelockOfAccount[account] = 0; - newSignerCandidateOfAccount[account] = address(0); - SimpleWallet(payable(account)).changeOwner(newSigner); - } -} diff --git a/packages/contracts/test/helpers/SimpleWallet.sol b/packages/contracts/test/helpers/SimpleWallet.sol deleted file mode 100644 index 2e0be982..00000000 --- a/packages/contracts/test/helpers/SimpleWallet.sol +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {RecoveryController} from "./RecoveryController.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -contract SimpleWallet is OwnableUpgradeable, IERC1271 { - using ECDSA for *; - - enum GuardianStatus { - NONE, - REQUESTED, - ACCEPTED - } - - /// @notice Fallback function to receive ETH - fallback() external payable {} - - /// @notice Function to receive ETH - receive() external payable {} - - address public recoveryController; - - constructor() {} - - function initialize( - address _initialOwner, - address _recoveryController - ) public initializer { - __Ownable_init(_initialOwner); - recoveryController = _recoveryController; - RecoveryController(_recoveryController).configureTimelockPeriod( - RecoveryController(_recoveryController).DEFAULT_TIMELOCK_PERIOD() - ); - } - - function transfer(address to, uint256 amount) public onlyOwner { - require(address(this).balance >= amount, "insufficient balance"); - Address.sendValue(payable(to), amount); - } - - function withdraw(uint256 amount) public onlyOwner { - transfer(msg.sender, amount); - } - - function changeOwner(address newOwner) public { - require( - msg.sender == owner() || msg.sender == recoveryController, - "only owner or recovery controller" - ); - _transferOwnership(newOwner); - } - - function requestGuardian(address guardian) public { - require(msg.sender == owner(), "only owner"); - RecoveryController(recoveryController).requestGuardian(guardian); - } - - /** - * @notice Verifies that the signer is the owner of the signing contract. - */ - function isValidSignature( - bytes32 _hash, - bytes calldata _signature - ) external view override returns (bytes4) { - // Validate signatures - if (_hash.recover(_signature) == owner()) { - return 0x1626ba7e; - } else { - return 0xffffffff; - } - } -} diff --git a/packages/contracts/test/script/ChangeOwnersScript.t.sol b/packages/contracts/test/script/ChangeOwnersScript.t.sol deleted file mode 100644 index 13743a1f..00000000 --- a/packages/contracts/test/script/ChangeOwnersScript.t.sol +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; - -import {Deploy} from "../../script/DeployRecoveryController.s.sol"; -import {ChangeOwners} from "../../script/ChangeOwners.s.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; - -contract ChangeOwnersScriptTest is StructHelper { - function setUp() public override { - resetEnviromentVariables(); - super.setUp(); - vm.setEnv( - "PRIVATE_KEY", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - ); - vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0"); - vm.setEnv( - "INITIAL_OWNER", - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - ); - vm.setEnv("NEW_OWNER", "0xa1bec2dd161d6bbcc91ec32aa44d9333e2a864c0"); - } - - function test_run() public { - skipIfZkSync(); - - Deploy deploy = new Deploy(); - deploy.run(); - vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e"); - vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508"); - vm.setEnv( - "EMAIL_AUTH_IMPL", - "0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0" - ); - vm.setEnv( - "RECOVERY_CONTROLLER", - "0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487" - ); - deploy.deployECDSAOwnedDKIMRegistry( - vm.envAddress("INITIAL_OWNER"), - vm.envAddress("DKIM_SIGNER") - ); - vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3"); - ChangeOwners changeOwners = new ChangeOwners(); - changeOwners.run(); - address verifier = vm.envAddress("VERIFIER"); - address ecdsaDkimAddr = vm.envAddress("ECDSA_DKIM"); - address dkim = vm.envAddress("DKIM"); - assertEq( - OwnableUpgradeable(verifier).owner(), - vm.envAddress("NEW_OWNER") - ); - assertEq( - OwnableUpgradeable(ecdsaDkimAddr).owner(), - vm.envAddress("NEW_OWNER") - ); - assertEq(OwnableUpgradeable(dkim).owner(), vm.envAddress("NEW_OWNER")); - } -} diff --git a/packages/contracts/test/script/ChangeSignerInECDSAOwnedDKIMRegistryScript.t.sol b/packages/contracts/test/script/ChangeSignerInECDSAOwnedDKIMRegistryScript.t.sol deleted file mode 100644 index 89cb3b2a..00000000 --- a/packages/contracts/test/script/ChangeSignerInECDSAOwnedDKIMRegistryScript.t.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; - -import {Deploy} from "../../script/DeployRecoveryController.s.sol"; -import {ChangeSigner} from "../../script/ChangeSignerInECDSAOwnedDKIMRegistry.s.sol"; -import {ECDSAOwnedDKIMRegistry} from "../../src/utils/ECDSAOwnedDKIMRegistry.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; - -contract ChangeSignerInECDSAOwnedDKIMRegistryScriptTest is StructHelper { - function setUp() public override { - resetEnviromentVariables(); - super.setUp(); - vm.setEnv( - "PRIVATE_KEY", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - ); - vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0"); - vm.setEnv( - "INITIAL_OWNER", - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - ); - vm.setEnv("NEW_SIGNER", "0xa1bec2dd161d6bbcc91ec32aa44d9333e2a864c0"); - } - - function test_run() public { - skipIfZkSync(); - - Deploy deploy = new Deploy(); - deploy.run(); - vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e"); - vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508"); - vm.setEnv( - "EMAIL_AUTH_IMPL", - "0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0" - ); - vm.setEnv( - "RECOVERY_CONTROLLER", - "0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487" - ); - deploy.deployECDSAOwnedDKIMRegistry( - vm.addr(vm.envUint("PRIVATE_KEY")), - vm.envAddress("DKIM_SIGNER") - ); - vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3"); - ChangeSigner changeSigner = new ChangeSigner(); - changeSigner.run(); - address ecdsaDkimAddr = vm.envAddress("ECDSA_DKIM"); - ECDSAOwnedDKIMRegistry ecdsaDkim = ECDSAOwnedDKIMRegistry( - ecdsaDkimAddr - ); - assertEq(ecdsaDkim.signer(), vm.envAddress("NEW_SIGNER")); - } -} diff --git a/packages/contracts/test/script/DeployRecoveryControllerScript.t.sol b/packages/contracts/test/script/DeployRecoveryControllerScript.t.sol deleted file mode 100644 index e220d94b..00000000 --- a/packages/contracts/test/script/DeployRecoveryControllerScript.t.sol +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; - -import {Deploy} from "../../script/DeployRecoveryController.s.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; - -contract DeployRecoveryControllerScriptTest is StructHelper { - function setUp() public override { - resetEnviromentVariables(); - super.setUp(); - vm.setEnv( - "PRIVATE_KEY", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - ); - vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0"); - vm.setEnv( - "INITIAL_OWNER", - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - ); - } - - function test_run() public { - skipIfZkSync(); - - Deploy deploy = new Deploy(); - deploy.run(); - vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e"); - vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508"); - vm.setEnv( - "EMAIL_AUTH_IMPL", - "0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0" - ); - vm.setEnv( - "RECOVERY_CONTROLLER", - "0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487" - ); - vm.setEnv( - "SIMPLE_WALLET", - "0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52" - ); - deploy.deployECDSAOwnedDKIMRegistry( - vm.addr(vm.envUint("PRIVATE_KEY")), - vm.envAddress("DKIM_SIGNER") - ); - vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3"); - require( - vm.envAddress("ECDSA_DKIM") != address(0), - "ECDSA_DKIM is not set" - ); - require(vm.envAddress("VERIFIER") != address(0), "VERIFIER is not set"); - require( - vm.envAddress("EMAIL_AUTH_IMPL") != address(0), - "EMAIL_AUTH_IMPL is not set" - ); - require( - vm.envAddress("RECOVERY_CONTROLLER") != address(0), - "RECOVERY_CONTROLLER is not set" - ); - require( - vm.envAddress("SIMPLE_WALLET") != address(0), - "SIMPLE_WALLET is not set" - ); - } -} diff --git a/packages/contracts/test/script/DeploySimpleWalletScript.t.sol b/packages/contracts/test/script/DeploySimpleWalletScript.t.sol deleted file mode 100644 index 1e4c8cbb..00000000 --- a/packages/contracts/test/script/DeploySimpleWalletScript.t.sol +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; - -import {Deploy} from "../../script/DeployRecoveryController.s.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; - -contract DeploySimpleWalletScriptTest is StructHelper { - function setUp() public override { - resetEnviromentVariables(); - super.setUp(); - vm.setEnv( - "PRIVATE_KEY", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - ); - vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0"); - vm.setEnv("INITIAL_OWNER", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"); - - vm.setEnv("DKIM", vm.toString(address(dkim))); - vm.setEnv("VERIFIER", vm.toString(address(verifier))); - vm.setEnv("EMAIL_AUTH_IMPL", vm.toString(address(emailAuth))); - vm.setEnv("SIMPLE_WALLET_IMPL", vm.toString(address(simpleWalletImpl))); - } - - function test_run() public { - skipIfZkSync(); - - Deploy deploy = new Deploy(); - deploy.run(); - } - - function test_run_no_dkim() public { - skipIfZkSync(); - - vm.setEnv("DKIM", vm.toString(address(0))); - Deploy deploy = new Deploy(); - deploy.run(); - } - - function test_run_no_verifier() public { - skipIfZkSync(); - - vm.setEnv("VERIFIER", vm.toString(address(0))); - Deploy deploy = new Deploy(); - deploy.run(); - } - - function test_run_no_email_auth() public { - skipIfZkSync(); - - vm.setEnv("EMAIL_AUTH_IMPL", vm.toString(address(0))); - Deploy deploy = new Deploy(); - deploy.run(); - } - - function test_run_no_simple_wallet() public { - skipIfZkSync(); - - vm.setEnv("SIMPLE_WALLET_IMPL", vm.toString(address(0))); - Deploy deploy = new Deploy(); - deploy.run(); - } -} diff --git a/packages/contracts/test/script/RenounceOwnersScript.t.sol b/packages/contracts/test/script/RenounceOwnersScript.t.sol deleted file mode 100644 index 1bf9dcd0..00000000 --- a/packages/contracts/test/script/RenounceOwnersScript.t.sol +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "forge-std/Test.sol"; -import "forge-std/console.sol"; - -import {Deploy} from "../../script/DeployRecoveryController.s.sol"; -import {RenounceOwners} from "../../script/RenounceOwners.s.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {StructHelper} from "../helpers/StructHelper.sol"; - -contract RenounceOwnersScriptTest is StructHelper { - function setUp() public override { - resetEnviromentVariables(); - super.setUp(); - vm.setEnv( - "PRIVATE_KEY", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - ); - vm.setEnv("DKIM_SIGNER", "0x69bec2dd161d6bbcc91ec32aa44d9333ebc864c0"); - vm.setEnv( - "INITIAL_OWNER", - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - ); - } - - function test_run() public { - skipIfZkSync(); - Deploy deploy = new Deploy(); - deploy.run(); - vm.setEnv("DKIM", "0x71C95911E9a5D330f4D621842EC243EE1343292e"); - vm.setEnv("VERIFIER", "0xbCF26943C0197d2eE0E5D05c716Be60cc2761508"); - vm.setEnv( - "EMAIL_AUTH_IMPL", - "0x59F2f1fCfE2474fD5F0b9BA1E73ca90b143Eb8d0" - ); - vm.setEnv( - "RECOVERY_CONTROLLER", - "0x1275D096B9DBf2347bD2a131Fb6BDaB0B4882487" - ); - vm.setEnv( - "SIMPLE_WALLET", - "0x0b48aF34f4c854F5ae1A3D587da471FeA45bAD52" - ); - deploy.deployECDSAOwnedDKIMRegistry( - vm.addr(vm.envUint("PRIVATE_KEY")), - vm.envAddress("DKIM_SIGNER") - ); - vm.setEnv("ECDSA_DKIM", "0x037eDa3aDB1198021A9b2e88C22B464fD38db3f3"); - RenounceOwners renounceOwners = new RenounceOwners(); - renounceOwners.run(); - address verifier = vm.envAddress("VERIFIER"); - address ecdsaDkimAddr = vm.envAddress("ECDSA_DKIM"); - address dkim = vm.envAddress("DKIM"); - assertEq(OwnableUpgradeable(verifier).owner(), address(0)); - assertEq(OwnableUpgradeable(ecdsaDkimAddr).owner(), address(0)); - assertEq(OwnableUpgradeable(dkim).owner(), address(0)); - } -} diff --git a/packages/prover/modal_server.py b/packages/prover/modal_server.py index b28e1a4b..ecf1fb62 100644 --- a/packages/prover/modal_server.py +++ b/packages/prover/modal_server.py @@ -6,7 +6,7 @@ from google.cloud.logging_v2.handlers import setup_logging from google.oauth2 import service_account -app = modal.App("email-auth-prover-v1.5.4") +app = modal.App("email-tx-builder-prover-v1.5.4") image = modal.Image.from_dockerfile("Dockerfile") diff --git a/packages/relayer/.env.example b/packages/relayer/.env.example deleted file mode 100644 index 60deb675..00000000 --- a/packages/relayer/.env.example +++ /dev/null @@ -1,24 +0,0 @@ -EMAIL_ACCOUNT_RECOVERY_VERSION_ID=1 # Version ID of the email account recovery. -PRIVATE_KEY="" # Private key for Relayer's account. -CHAIN_RPC_PROVIDER=http://127.0.0.1:8545 -CHAIN_RPC_EXPLORER= -CHAIN_ID=11155111 # Chain ID of the testnet. - -SMTP_SERVER= - -PROVER_ADDRESS="https://zkemail--email-auth-prover-v1-5-0-flask-app.modal.run" - -DATABASE_URL= "postgres://test@localhost/emailauth_test" -RELAYER_EMAIL_ADDR= -WEB_SERVER_ADDRESS="127.0.0.1:4500" -EMAIL_TEMPLATES_PATH= #Path to email templates, e.g. ./packages/relayer/eml_templates/ -REGEX_JSON_DIR_PATH= - -DKIM_CANISTER_ID="fxmww-qiaaa-aaaaj-azu7a-cai" -WALLET_CANISTER_ID= -PEM_PATH="./.ic.pem" -IC_REPLICA_URL="https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=fxmww-qiaaa-aaaaj-azu7a-cai" - -JSON_LOGGER=false - -ERROR_EMAIL_ADDR="error@example.com" \ No newline at end of file diff --git a/packages/relayer/.sqlx/query-4097c486517af7c203aedf19c79a27c94af3e79af391351d7f54832536b656c3.json b/packages/relayer/.sqlx/query-4097c486517af7c203aedf19c79a27c94af3e79af391351d7f54832536b656c3.json new file mode 100644 index 00000000..e9341785 --- /dev/null +++ b/packages/relayer/.sqlx/query-4097c486517af7c203aedf19c79a27c94af3e79af391351d7f54832536b656c3.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO requests (email_tx_auth) VALUES ($1) RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Jsonb" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4097c486517af7c203aedf19c79a27c94af3e79af391351d7f54832536b656c3" +} diff --git a/packages/relayer/.sqlx/query-51babdcefaa164b8d2498552e2924c83c6394dc0c6ae546f72a5cb08c2fa5485.json b/packages/relayer/.sqlx/query-51babdcefaa164b8d2498552e2924c83c6394dc0c6ae546f72a5cb08c2fa5485.json new file mode 100644 index 00000000..62aecde6 --- /dev/null +++ b/packages/relayer/.sqlx/query-51babdcefaa164b8d2498552e2924c83c6394dc0c6ae546f72a5cb08c2fa5485.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE requests SET status = $1 WHERE id = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + { + "Custom": { + "name": "status_enum", + "kind": { + "Enum": [ + "Request received", + "Email sent", + "Email response received", + "Proving", + "Performing on chain transaction", + "Finished" + ] + } + } + }, + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "51babdcefaa164b8d2498552e2924c83c6394dc0c6ae546f72a5cb08c2fa5485" +} diff --git a/packages/relayer/.sqlx/query-7aefad132b94f2d7cc3baf2e9cf9ee83b772ea1e914666757da17235fc27fa4c.json b/packages/relayer/.sqlx/query-7aefad132b94f2d7cc3baf2e9cf9ee83b772ea1e914666757da17235fc27fa4c.json new file mode 100644 index 00000000..1a49fe16 --- /dev/null +++ b/packages/relayer/.sqlx/query-7aefad132b94f2d7cc3baf2e9cf9ee83b772ea1e914666757da17235fc27fa4c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO email_auth_messages (request_id, response) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "7aefad132b94f2d7cc3baf2e9cf9ee83b772ea1e914666757da17235fc27fa4c" +} diff --git a/packages/relayer/.sqlx/query-87f63ec8051ab2fcd3fc963b1f3e0ec9d94a412ad0afd53e96c2c42d5c52ef36.json b/packages/relayer/.sqlx/query-87f63ec8051ab2fcd3fc963b1f3e0ec9d94a412ad0afd53e96c2c42d5c52ef36.json new file mode 100644 index 00000000..2e7c020e --- /dev/null +++ b/packages/relayer/.sqlx/query-87f63ec8051ab2fcd3fc963b1f3e0ec9d94a412ad0afd53e96c2c42d5c52ef36.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT response FROM email_auth_messages WHERE request_id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "response", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "87f63ec8051ab2fcd3fc963b1f3e0ec9d94a412ad0afd53e96c2c42d5c52ef36" +} diff --git a/packages/relayer/.sqlx/query-a8157c6e1edb1f3467740df878063d4727b69fac81fbe51b28c1fce828de51ea.json b/packages/relayer/.sqlx/query-a8157c6e1edb1f3467740df878063d4727b69fac81fbe51b28c1fce828de51ea.json new file mode 100644 index 00000000..ba4efa1b --- /dev/null +++ b/packages/relayer/.sqlx/query-a8157c6e1edb1f3467740df878063d4727b69fac81fbe51b28c1fce828de51ea.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO expected_replies (message_id, request_id) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "a8157c6e1edb1f3467740df878063d4727b69fac81fbe51b28c1fce828de51ea" +} diff --git a/packages/relayer/.sqlx/query-e884c0a99d266e857015603cdd7f29bfd5adf815dfcc1e2159c61276f262831e.json b/packages/relayer/.sqlx/query-e884c0a99d266e857015603cdd7f29bfd5adf815dfcc1e2159c61276f262831e.json new file mode 100644 index 00000000..678375ac --- /dev/null +++ b/packages/relayer/.sqlx/query-e884c0a99d266e857015603cdd7f29bfd5adf815dfcc1e2159c61276f262831e.json @@ -0,0 +1,54 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT \n id, \n status as \"status: RequestStatus\", \n updated_at::timestamp as \"updated_at: NaiveDateTime\",\n email_tx_auth as \"email_tx_auth: Json\"\n FROM requests \n WHERE id = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "status: RequestStatus", + "type_info": { + "Custom": { + "name": "status_enum", + "kind": { + "Enum": [ + "Request received", + "Email sent", + "Email response received", + "Proving", + "Performing on chain transaction", + "Finished" + ] + } + } + } + }, + { + "ordinal": 2, + "name": "updated_at: NaiveDateTime", + "type_info": "Timestamp" + }, + { + "ordinal": 3, + "name": "email_tx_auth: Json", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + null, + false + ] + }, + "hash": "e884c0a99d266e857015603cdd7f29bfd5adf815dfcc1e2159c61276f262831e" +} diff --git a/packages/relayer/Cargo.lock b/packages/relayer/Cargo.lock new file mode 100644 index 00000000..69b1b3d4 --- /dev/null +++ b/packages/relayer/Cargo.lock @@ -0,0 +1,5142 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "axum" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq 0.3.1", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2", + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +dependencies = [ + "serde", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfdkim" +version = "0.3.3" +source = "git+https://github.com/zkemail/dkim.git#3b1cfd75e2afad12fbc1e8ece50e93e51415118b" +dependencies = [ + "base64 0.21.7", + "chrono", + "console_error_panic_hook", + "ed25519-dalek", + "futures", + "getrandom", + "indexmap 1.9.3", + "js-sys", + "mailparse", + "nom", + "quick-error 2.0.1", + "regex", + "rsa", + "serde_json", + "sha-1", + "sha2", + "slog", + "trust-dns-resolver", + "wasm-bindgen", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "charset" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f927b07c74ba84c7e5fe4db2baeb3e996ab2688992e39ac68ce3220a677c7e" +dependencies = [ + "base64 0.22.1", + "encoding_rs", +] + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.6", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "coins-bip32" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" +dependencies = [ + "bs58", + "coins-core", + "digest", + "hmac", + "k256", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "coins-bip39" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" +dependencies = [ + "bitvec", + "coins-bip32", + "hmac", + "once_cell", + "pbkdf2 0.12.2", + "rand", + "sha2", + "thiserror", +] + +[[package]] +name = "coins-core" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" +dependencies = [ + "base64 0.21.7", + "bech32", + "bs58", + "digest", + "generic-array", + "hex", + "ripemd", + "serde", + "serde_derive", + "sha2", + "sha3", + "thiserror", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "const-hex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +dependencies = [ + "serde", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enr" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +dependencies = [ + "base64 0.21.7", + "bytes", + "hex", + "k256", + "log", + "rand", + "rlp", + "serde", + "sha3", + "zeroize", +] + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "eth-keystore" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +dependencies = [ + "aes", + "ctr", + "digest", + "hex", + "hmac", + "pbkdf2 0.11.0", + "rand", + "scrypt", + "serde", + "serde_json", + "sha2", + "sha3", + "thiserror", + "uuid 0.8.2", +] + +[[package]] +name = "ethabi" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types", + "hex", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3", + "thiserror", + "uint", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types", + "scale-info", + "uint", +] + +[[package]] +name = "ethers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" +dependencies = [ + "ethers-addressbook", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-middleware", + "ethers-providers", + "ethers-signers", + "ethers-solc", +] + +[[package]] +name = "ethers-addressbook" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" +dependencies = [ + "ethers-core", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "ethers-contract" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" +dependencies = [ + "const-hex", + "ethers-contract-abigen", + "ethers-contract-derive", + "ethers-core", + "ethers-providers", + "futures-util", + "once_cell", + "pin-project", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "ethers-contract-abigen" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" +dependencies = [ + "Inflector", + "const-hex", + "dunce", + "ethers-core", + "ethers-etherscan", + "eyre", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "reqwest", + "serde", + "serde_json", + "syn 2.0.79", + "toml", + "walkdir", +] + +[[package]] +name = "ethers-contract-derive" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" +dependencies = [ + "Inflector", + "const-hex", + "ethers-contract-abigen", + "ethers-core", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.79", +] + +[[package]] +name = "ethers-core" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" +dependencies = [ + "arrayvec", + "bytes", + "cargo_metadata", + "chrono", + "const-hex", + "elliptic-curve", + "ethabi", + "generic-array", + "k256", + "num_enum", + "once_cell", + "open-fastrlp", + "rand", + "rlp", + "serde", + "serde_json", + "strum", + "syn 2.0.79", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "ethers-etherscan" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" +dependencies = [ + "chrono", + "ethers-core", + "reqwest", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-middleware" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" +dependencies = [ + "async-trait", + "auto_impl", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-providers", + "ethers-signers", + "futures-channel", + "futures-locks", + "futures-util", + "instant", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", + "url", +] + +[[package]] +name = "ethers-providers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" +dependencies = [ + "async-trait", + "auto_impl", + "base64 0.21.7", + "bytes", + "const-hex", + "enr", + "ethers-core", + "futures-core", + "futures-timer", + "futures-util", + "hashers", + "http 0.2.12", + "instant", + "jsonwebtoken", + "once_cell", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-tungstenite", + "tracing", + "tracing-futures", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "ws_stream_wasm", +] + +[[package]] +name = "ethers-signers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" +dependencies = [ + "async-trait", + "coins-bip32", + "coins-bip39", + "const-hex", + "elliptic-curve", + "eth-keystore", + "ethers-core", + "rand", + "sha2", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-solc" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" +dependencies = [ + "cfg-if", + "const-hex", + "dirs", + "dunce", + "ethers-core", + "glob", + "home", + "md-5", + "num_cpus", + "once_cell", + "path-slash", + "rayon", + "regex", + "semver 1.0.23", + "serde", + "serde_json", + "solang-parser", + "svm-rs", + "thiserror", + "tiny-keccak", + "tokio", + "tracing", + "walkdir", + "yansi", +] + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fancy-regex" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-rotate" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3ed82142801f5b1363f7d463963d114db80f467e860b1cd82228eaebc627a0" +dependencies = [ + "chrono", + "flate2", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-locks" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" +dependencies = [ + "futures-channel", + "futures-task", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.6.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "halo2curves" +version = "0.7.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves.git#8771fe5a5d54fc03e74dbc8915db5dad3ab46a83" +dependencies = [ + "blake2", + "digest", + "ff", + "group", + "halo2derive", + "lazy_static", + "num-bigint", + "num-integer", + "num-traits", + "pairing", + "pasta_curves", + "paste", + "rand", + "rand_core", + "rayon", + "sha2", + "static_assertions", + "subtle", + "unroll", +] + +[[package]] +name = "halo2derive" +version = "0.1.0" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves.git#8771fe5a5d54fc03e74dbc8915db5dad3ab46a83" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + +[[package]] +name = "hashers" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +dependencies = [ + "fxhash", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "hmac-sha256" +version = "1.1.7" +source = "git+https://github.com/zkemail/rust-hmac-sha256.git#e98ae695d2600c98b57de4b1ad1e0bfb7895f458" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +dependencies = [ + "equivalent", + "hashbrown 0.15.0", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonwebtoken" +version = "8.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +dependencies = [ + "base64 0.21.7", + "pem", + "ring 0.16.20", + "serde", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lalrpop" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools 0.11.0", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", + "walkdir", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] + +[[package]] +name = "libc" +version = "0.2.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libloading" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "mailparse" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da03d5980411a724e8aaf7b61a7b5e386ec55a7fb49ee3d0ff79efc7e5e7c7e" +dependencies = [ + "charset", + "data-encoding", + "quoted_printable", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minicov" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "neon" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28e15415261d880aed48122e917a45e87bb82cf0260bb6db48bbab44b7464373" +dependencies = [ + "neon-build", + "neon-macros", + "neon-runtime", + "semver 0.9.0", + "smallvec", +] + +[[package]] +name = "neon-build" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bac98a702e71804af3dacfde41edde4a16076a7bbe889ae61e56e18c5b1c811" + +[[package]] +name = "neon-macros" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7288eac8b54af7913c60e0eb0e2a7683020dffa342ab3fd15e28f035ba897cf" +dependencies = [ + "quote", + "syn 1.0.109", + "syn-mid", +] + +[[package]] +name = "neon-runtime" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4676720fa8bb32c64c3d9f49c47a47289239ec46b4bdb66d0913cc512cb0daca" +dependencies = [ + "cfg-if", + "libloading", + "smallvec", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "serde", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "blake2b_simd", + "ff", + "group", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.6.0", +] + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "poseidon-rs" +version = "1.0.0" +source = "git+https://github.com/zkemail/poseidon-rs.git#fe5ce2634c27326219d4faf75beb73b40a0beb7d" +dependencies = [ + "getrandom", + "halo2curves", + "once_cell", + "serde", + "thiserror", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.79", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bitflags 2.6.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "quoted_printable" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "640c9bd8497b02465aeef5375144c26062e0dcd5939dfcbb0f5db76cb8c17c73" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "relayer" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "chrono", + "relayer-utils", + "serde", + "serde_json", + "slog", + "sqlx", + "tokio", + "tower-http", + "uuid 1.10.0", +] + +[[package]] +name = "relayer-utils" +version = "0.3.7" +source = "git+https://github.com/zkemail/relayer-utils.git?branch=main#5764f93c4e803cba39c0f06f8ced0cab1d229a25" +dependencies = [ + "anyhow", + "base64 0.21.7", + "cfdkim", + "ethers", + "file-rotate", + "halo2curves", + "hex", + "hmac-sha256", + "itertools 0.10.5", + "lazy_static", + "neon", + "num-bigint", + "num-traits", + "once_cell", + "poseidon-rs", + "rand_core", + "regex", + "rsa", + "serde", + "serde_json", + "slog", + "slog-async", + "slog-json", + "slog-term", + "tokio", + "zk-regex-apis", +] + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error 1.2.3", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rlp-derive", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "serde", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.23", +] + +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scale-info" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +dependencies = [ + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac", + "pbkdf2 0.11.0", + "salsa20", + "sha2", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror", + "time", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slog" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" + +[[package]] +name = "slog-async" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c8038f898a2c79507940990f05386455b3a317d8f18d4caea7cbc3d5096b84" +dependencies = [ + "crossbeam-channel", + "slog", + "take_mut", + "thread_local", +] + +[[package]] +name = "slog-json" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1e53f61af1e3c8b852eef0a9dee29008f55d6dd63794f3f12cef786cf0f219" +dependencies = [ + "serde", + "serde_json", + "slog", + "time", +] + +[[package]] +name = "slog-term" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e022d0b998abfe5c3782c1f03551a596269450ccd677ea51c56f8b214610e8" +dependencies = [ + "is-terminal", + "slog", + "term", + "thread_local", + "time", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "solang-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" +dependencies = [ + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "phf", + "thiserror", + "unicode-xid", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlformat" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" +dependencies = [ + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" +dependencies = [ + "atoi", + "byteorder", + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.14.5", + "hashlink", + "hex", + "indexmap 2.6.0", + "log", + "memchr", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.79", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" +dependencies = [ + "dotenvy", + "either", + "heck 0.5.0", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.79", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", +] + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.79", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "svm-rs" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" +dependencies = [ + "dirs", + "fs2", + "hex", + "once_cell", + "reqwest", + "semver 1.0.23", + "serde", + "serde_json", + "sha2", + "thiserror", + "url", + "zip", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-mid" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea305d57546cc8cd04feb14b62ec84bf17f50e3f7b12560d7bfa9265f39d9ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots", +] + +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap 2.6.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" +dependencies = [ + "bitflags 2.6.0", + "bytes", + "http 1.1.0", + "pin-project-lite", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 0.2.12", + "httparse", + "log", + "rand", + "rustls", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-bidi" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "unroll" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna 0.5.0", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "serde", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "minicov", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "whoami" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall", + "wasite", +] + +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "ws_stream_wasm" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "log", + "pharos", + "rustc_version", + "send_wrapper 0.6.0", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq 0.1.5", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zk-regex-apis" +version = "2.1.1" +source = "git+https://github.com/zkemail/zk-regex.git#531575345558ba938675d725bd54df45c866ef74" +dependencies = [ + "fancy-regex", + "itertools 0.13.0", + "js-sys", + "serde", + "serde-wasm-bindgen", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-test", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/packages/relayer/Cargo.toml b/packages/relayer/Cargo.toml index e6119111..a4da343c 100644 --- a/packages/relayer/Cargo.toml +++ b/packages/relayer/Cargo.toml @@ -1,65 +1,40 @@ [package] -name = "relayer" -version = "1.0.3" +name = "email-tx-builder-relayer" +version = "0.1.0" edition = "2021" [dependencies] -tower-http = { version = "0.4", git = "https://github.com/tower-rs/tower-http.git", features = [ - "cors", -], rev = "f33c3e038dc85b8d064541e915d501f9c9e6a6b4" } -tokio = { version = "1.0", features = ["full"] } -sled = "0.34.2" -anyhow = "1.0.75" -dotenv = "0.15.0" -oauth2 = "4.3.0" -async-imap = { version = "0.9.1", default-features = false, features = [ - "runtime-tokio", -] } -async-native-tls = { version = "0.5.0", default-features = false, features = [ - "runtime-tokio", -] } -serde = { version = "1.0", features = ["derive"] } -webbrowser = "0.8.11" -serde_json = "1.0.68" -tiny_http = "0.12.0" -lettre = { version = "0.10.4", features = ["tokio1", "tokio1-native-tls"] } -ethers = { version = "2.0.10", features = ["abigen"] } -relayer-utils = { version = "0.4.2", git = "https://github.com/zkemail/relayer-utils.git" } -futures = "0.3.28" -sqlx = { version = "=0.7.3", features = [ +anyhow = "1.0.89" +axum = "0.7.7" +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" +sqlx = { version = "0.8.2", features = [ "postgres", "runtime-tokio", - "tls-native-tls", + "migrate", + "uuid", + "time", + "chrono", + "bigdecimal", ] } -regex = "1.10.2" -axum = "0.6.20" -rand = "0.8.5" -reqwest = "0.11.22" -num-bigint = { version = "0.4", features = ["rand"] } -num-traits = "0.2.16" -hex = "0.4.3" -chrono = "0.4.38" -ff = { version = "0.13.0", default-features = false, features = ["std"] } -async-trait = "0.1.36" -handlebars = "4.4.0" -graphql_client = { version = "0.13.0", features = ["reqwest"] } -lazy_static = "1.4" +bigdecimal = "0.3.1" +tokio = { version = "1.40.0", features = ["full"] } +tower-http = { version = "0.6.1", features = ["cors"] } +relayer-utils = { git = "https://github.com/zkemail/relayer-utils.git", branch = "main" } slog = { version = "2.7.0", features = [ "max_level_trace", "release_max_level_warn", ] } -slog-async = "2.8.0" -slog-term = "2.9.0" -slog-json = "2.6.1" -file-rotate = "0.7.5" -base64 = "0.21.7" -uuid = "1.8.0" -http = "1.1.0" +uuid = { version = "1.10.0", features = ["serde", "v4"] } +chrono = { version = "0.4.38", features = ["serde"] } +ethers = "2.0.14" +reqwest = { version = "0.12.8", features = ["json"] } +handlebars = "6.1.0" +regex = "1.11.0" ic-agent = { version = "0.37.1", features = ["pem", "reqwest"] } ic-utils = "0.37.0" candid = "0.10.10" -thiserror = "1.0.63" -rustc-hex = "2.1.0" +lazy_static = "1.5.0" [build-dependencies] -ethers = "2.0.10" +ethers = "2.0.14" diff --git a/packages/relayer/README.md b/packages/relayer/README.md index b89967b1..09f51c6b 100644 --- a/packages/relayer/README.md +++ b/packages/relayer/README.md @@ -1,232 +1,33 @@ -This is a Relayer server implementation in Rust for email-based account recovery. +# Generic Relayer -## How to Run the Relayer -You can run the relayer either on your local environments or cloud instances (we are using GCP). -### Local -1. Clone the repo, https://github.com/zkemail/ether-email-auth. -2. Install dependencies. - 1. `cd ether-email-auth` and run `yarn`. -3. If you have not deployed common contracts, build contract artifacts and deploy required contracts. - 1. `cd packages/contracts` and run `forge build`. - 2. Set the env file in `packages/contracts/.env`, an example env file is as follows, +## Build - ```jsx - LOCALHOST_RPC_URL=http://127.0.0.1:8545 - SEPOLIA_RPC_URL=https://sepolia.base.org - MAINNET_RPC_URL=https://mainnet.base.org +make sure to build the contracts before building the relayer - PRIVATE_KEY="" - CHAIN_ID=84532 - RPC_URL="https://sepolia.base.org" - SIGNER=0x6293a80bf4bd3fff995a0cab74cbf281d922da02 # Signer for the dkim oracle on IC (Don't change this) - ETHERSCAN_API_KEY= - # CHAIN_NAME="base_sepolia" - ``` - 3. Run `forge script script/DeployCommons.s.sol:Deploy -vvvv --rpc-url $RPC_URL --broadcast` to get `ECDSAOwnedDKIMRegistry`, `Verifier`, `EmailAuth implementation` and `SimpleWallet implementation`. -4. Install PostgreSQL and create a database. - 1. `psql -U -d postgres` to login to administrative PostgreSQL user. Replace **``** with the administrative PostgreSQL user (commonly **`postgres`**). - 2. Create a new user, `CREATE USER my_new_user WITH PASSWORD 'my_secure_password';`, `ALTER USER my_new_user CREATEDB;`. - 3. Exit `psql` and now create a new database, `psql -U new_user -d postgres` followed by `CREATE DATABASE my_new_database;`. -5. Run the prover. - 1. `cd packages/prover` and `python local.py`, let this run async. -6. Run the relayer. - 1. `cd packages/relayer`. - 2. Set the env file, an example env file is as follows, - ```jsx - EMAIL_ACCOUNT_RECOVERY_VERSION_ID=1 # Address of the deployed wallet contract. - PRIVATE_KEY= # Private key for Relayer's account. - CHAIN_RPC_PROVIDER=https://sepolia.base.org - CHAIN_RPC_EXPLORER=https://sepolia.basescan.org - CHAIN_ID=84532 # Chain ID of the testnet. +``` +cd ../contracts +yarn && yarn build +``` - # IMAP + SMTP (Settings will be provided by your email provider) - IMAP_DOMAIN_NAME=imap.gmail.com - IMAP_PORT=993 - AUTH_TYPE=password - SMTP_DOMAIN_NAME=smtp.gmail.com - LOGIN_ID= # IMAP login id - usually your email address. - LOGIN_PASSWORD="" # IMAP password - usually your email password. +cd back into the relayer and build it - PROVER_ADDRESS="http://localhost:8080" # Address of the prover. +``` +cargo build +``` - DATABASE_URL= "postgres://new_user:my_secure_password@localhost/my_new_database" - WEB_SERVER_ADDRESS="127.0.0.1:4500" - EMAIL_TEMPLATES_PATH= # Absolute path to packages/relayer/eml_templates +## Setup the local development environment - CANISTER_ID="q7eci-dyaaa-aaaak-qdbia-cai" - PEM_PATH="./.ic.pem" - IC_REPLICA_URL="https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=q7eci-dyaaa-aaaak-qdbia-cai" - ERROR_EMAIL_ADDR="" # System user email address receiving error notification for user - JSON_LOGGER=false - ``` - 3. Generate the `.ic.pem` file and password. - - Create the `.ic.pem` file using OpenSSL: - ```sh - openssl genpkey -algorithm RSA -out .ic.pem -aes-256-cbc -pass pass:your_password - ``` - - If you need a password, you can generate a random password using: - ```sh - openssl rand -base64 32 - ``` -7. You should have your entire setup up and running! +cd into the root directory and run -NOTE: You need to turn on IMAP on the email id you’d be using for the relayer. +``` +docker compose up --build +``` -#### Appendix: If you use your own gmail for the relayer +This will build the docker images for the node, bundler, scanner, smtp, and imap services. -If you intend to use a Gmail address, you need to configure your Google account and Gmail as follows: +## Applying the migrations -##### Enable IMAP: - -Gmail -> See all settings -> Forwarding and POP/IMAP -> IMAP access -> Enable IMAP. - -Note that from June 2024, IMAP will be enabled by default. - -##### Enable two-factor authentication for your Google account: - -Refer to the following help link. - -[Google 2FA Setup](https://support.google.com/accounts/answer/185839?hl=en&co=GENIE.Platform%3DDesktop) - -##### Create an app password: - -Refer to the following help link. If you do not see the 'App passwords' option, try searching for 'app pass' in the search box to select it. - -[Google App Passwords](https://support.google.com/accounts/answer/185833?hl=en) - -### Production on GCP -1. Install `kubectl` on your system (https://kubernetes.io/docs/tasks/tools/) -2. Setup k8s config of `zkemail` cluster on GKE, -`gcloud container clusters get-credentials zkemail --region us-central1 --project (your_project_name)` -3. One time steps (already done) - 1. Create a static IP (https://cloud.google.com/vpc/docs/reserve-static-external-ip-address#gcloud) - 2. Map the static IP with a domain from Google Domain - 3. Create a `Managed Certificate` by applying `kubernetes/managed-cert.yml` (update the domain accordingly) -4. (Optional) Delete `db.yml` , `ingress.yml` and `relayer.yml` if applied already -5. (Optional) Build the Relayer’s Docker image and publish it. -6. Set the config in the respective manifests (Here, you can set the image of the relayer in `relayer.yml` , latest image already present in the config.) -7. Apply `db.yml` -8. Apply `relayer.yml` , ssh into the pod and run `nohup cargo run &` , this step should be done under a min to pass the liveness check. -9. Apply `ingress.yml` - -## Specification -### Database -It has the following tables in the DB. -- `credentials`: a table to store an account code for each pair of the wallet address and the guardian's email address. - - `account_code TEXT PRIMARY KEY` - - `account_eth_addr TEXT NOT NULL` - - `guardian_email_addr TEXT NOT NULL` - - `is_set BOOLEAN NOT NULL DEFAULT FALSE` - -- `requests`: a table to store requests from the caller of REST APIs. - - `request_id BIGINT PRIMARY KEY` - - `account_eth_addr TEXT, NOT NULL` - - `controller_eth_addr TEXT NOT NULL` - - `guardian_email_addr TEXT NOT NULL` - - `is_for_recovery BOOLEAN NOT NULL DEFAULT FALSE` - - `template_idx INT NOT NULL` - - `is_processed BOOLEAN NOT NULL DEFAULT FALSE` - - `is_success BOOLEAN` - - `email_nullifier TEXT` - - `account_salt TEXT` - -### REST APIs -It exposes the following REST APIs. - -- `GET requestStatus` - 1. Receive `request_id`. - 2. Retrieve a record with `request_id` from the `requests` table. If such a record does not exist, return 0. - 3. If `is_processed` is false, return 1. Otherwise, return 2, `is_success`, `email_nullifier`, `account_salt`. - -- `POST getAccountSalt` - 1. Receive `account_code` and `email_addr`. - 2. Compute `account_salt` from the given `account_code` and `email_addr`. - 3. Return `account_salt`. - -- `POST acceptanceRequest` - 1. Receive `controller_eth_addr`, `guardian_email_addr`, `account_code`, `template_idx`, and `subject`. - 2. Let `subject_template` be the `template_idx`-th template in `acceptanceSubjectTemplates()` of `controller_eth_addr`. - 3. If `subject` does not match with `subject_template` return a 400 response. Let `subject_params` be the parsed values. - 4. Extract `account_eth_addr` from the given `subject` by following `subject_template`. - 5. If the contract of `account_eth_addr` is not deployed, return a 400 response. - 4. If a record with `account_code` exists in the `credentials` table, return a 400 response. - 6. Randomly generate a `request_id`. If a record with `request_id` exists in the `requests` table, regenerate a new `request_id`. - 7. If a record with `account_eth_addr`, `guardian_email_addr` and `is_set=true` exists in the `credentials` table, - 1. Insert `(request_id, account_eth_addr, controller_eth_addr, guardian_email_addr, false, template_idx, false)` into the `requests` table. - 2. Send `guardian_email_addr` an error email to say that `account_eth_addr` tries to set you to a guardian, which is rejected since you are already its guardian. - 3. Return a 200 response along with `request_id` and `subject_params` **to prevent a malicious client user from learning if the pair of the `account_eth_addr` and the `guardian_email_addr` is already set or not.** - 8. Insert `(account_code, account_eth_addr, controller_eth_addr, guardian_email_addr, false)` into the `credentials` table. - 9. Insert `(request_id, account_eth_addr, controller_eth_addr, guardian_email_addr, false, template_idx)` into the `requests` table. - 10. Send an email as follows. - - To: `guardian_email_addr` - - Subject: if the domain of `guardian_email_addr` signs the To field, `subject`. Otherwise, `subject + " Code " + hex(account_code)"`. - - Reply-to: `relayer_email_addr_before_domain + "+code" + hex(account_code) + "@" + relayer_email_addr_domain`. - - Body: Any message, but it MUST contain `"#" + digit(request_id)`. - 11. Return a 200 response along with `request_id` and `subject_params`. - -- `POST recoveryRequest` - 1. Receive `controller_eth_addr`, `guardian_email_addr`, `template_idx`, and `subject`. - 2. Let `subject_template` be the `template_idx`-th template in `recoverySubjectTemplates()` of `account_eth_addr`. - 3. If the `subject` does not match with `subject_template` return a 400 response. Let `subject_params` be the parsed values. - 4. Extract `account_eth_addr` from the given `subject` by following `subject_template`. - 5. If the contract of `account_eth_addr` is not deployed, return a 400 response. - 6. Randomly generate a `request_id`. If a record with `request_id` exists in the `requests` table, regenerate a new `request_id`. - 7. If a record with `account_eth_addr`, `guardian_email_addr`, and `is_set=true` exists in the `credentials` table, - 1. Insert `(request_id, account_eth_addr, controller_eth_addr, guardian_email_addr, true, template_idx, false)` into the `requests` table. - 2. Send an email as follows. - - To: `guardian_email_addr` - - Subject: if the domain of `guardian_email_addr` signs the To field, `subject`. Otherwise, `subject + " Code " + hex(account_code)"`. - - Reply-to: `relayer_email_addr_before_domain ~~+ "+code" + hex(account_code)~~ + "@" + relayer_email_addr_domain`. - - Body: Any message, but it MUST contain `"#" + digit(request_id)`. - 3. Return a 200 response along with `request_id` and `subject_params`. - 7. If a record with `account_eth_addr`, `guardian_email_addr`, and `is_set=false` exists in the `credentials` table, - 1. Insert `(request_id, account_eth_addr, guardian_email_addr, true, template_idx, false)` into the `requests` table. - 2. Send an email as follows. - - To: `guardian_email_addr` - - Subject: A message to say that `account_eth_addr` requests your account recovery, but you have not approved being its guardian. - 3. Return a 200 response along with `request_id` and `subject_params`. - 8. If a record with `account_eth_addr`, `guardian_email_addr` does not exist in the `credentials` table, - 1. Insert `(request_id, account_eth_addr, guardian_email_addr, true, template_idx, false)` into the `requests` table. - 2. Send an email as follows. - - To: `guardian_email_addr` - - Subject: if the domain of `guardian_email_addr` signs the To field, `subject`. Otherwise, `subject + " Code "`. - - Reply-to: `relayer_email_addr_before_domain + "@" + relayer_email_addr_domain`. - - Body: Any message, but it MUST contain `"#" + digit(request_id)`. Also, the message asks the guardian to reply to this email **with the guardian’s account code after `" Code "` in the subject.** - 3. Return a 200 response along with `request_id` and `subject_params`. - -- `POST completeRequest` - 1. Receive `account_eth_addr`, `controller_eth_addr`, and `complete_calldata`. - 2. If the contract of `acciybt_eth_addr` is not deployed, return a 400 response. - 3. Call the `completeRecovery` function in the contract of `controller_eth_addr` with passing `account_eth_addr` and `complete_calldata`. - 4. If the transaction fails, return a 400 response. Otherwise, return a 200 response. - -### Handling Email -When receiving a new email, the relayer handles it as follows. -1. Extract `guardian_email_addr` from the From field, `raw_subject` from the Subject field, and `"#" + digit(request_id)` from the email body. -2. If no record with `request_id` exists in the `requests` table, send `guardian_email_addr` an email to tell that the given `request_id` does not exist. -3. If the invitation code for `account_code` exists in the email header, - 1. If a record with `account_code` exists in the `credentials` table, assert that `guardian_email_addr` is the same as the extracted one. - 2. If no record with `account_code` exists in the `credentials` table, assert that the `EmailAuth` contract whose address corresponds to `account_code` and `guardian_email_addr` is already deployed. Also, insert `(account_code, account_eth_addr, guardian_email_addr, true)` into the `credentials` table, where `account_eth_addr` is the owner of that deployed `EmailAuth` contract. Note that this step is for a guardian who sends an email to a new relayer due to the old relayer’s censorship. -4. Let `email_domain` be a domain of `guardian_email_addr`. -5. Fetch a public key of `email_domain` from DNS and compute its `public_key_hash`. -6. Let `dkim` be the output of `dkim()` of `account_eth_addr`. -7. If `DKIM(dkim).isDKIMPublicKeyHashValid(email_domain, public_key_hash)` is false, call the DKIM oracle and update the `dkim` contract. -8. If `is_for_recovery` is false, - 1. Let `subject_template` be the `template_idx`-th template in `acceptanceSubjectTemplates()` of `controller_eth_addr`. - 2. If `subject` does not match with `subject_template`, send `guardian_email_addr` an error email. - 3. Parse `subject` to get `subject_params` and `skiped_subject_prefix`. - 4. Let `templateId` be `keccak256(EMAIL_ACCOUNT_RECOVERY_VERSION_ID, "ACCEPTANCE", templateIdx)`. - 5. Generate a proof for the circuit and construct `email_proof`. - 6. Construct `email_auth_msg` and call `EmailAccountRecovery(controller_eth_addr).handleAcceptance(email_auth_msg, template_idx)`. - 7. If the transaction fails, send `guardian_email_addr` an error email and update a record with `request_id` in the `requests` table to `(is_processed=true, is_success=false, email_nullifier=email_proof.email_nullifier, account_salt=email_proof.email_nullifier, is_code_exist=email_proof.is_code_exist)`. - 8. Update a record with `account_code` in the `credentials` table to `is_set=true`. - 9. Send `guardian_email_addr` a success email and update a record with `request_id` in the `requests` table to `(is_processed=true, is_success=true, email_nullifier=email_proof.email_nullifier, account_salt=email_proof.email_nullifier, is_code_exist=email_proof.is_code_exist)`. -9. If `is_for_recovery` is true, - 1. Let `subject_template` be the `template_idx`-th template in `recoverySubjectTemplates()` of `controller_eth_addr`. - 2. If `subject` does not match with `subject_template`, send `guardian_email_addr` an error email. - 3. Parse `subject` to get `subject_params` and `skiped_subject_prefix`. - 4. Let `templateId` be `keccak256(EMAIL_ACCOUNT_RECOVERY_VERSION_ID, "RECOVERY", templateIdx)`. - 5. Generate a proof for the circuit and construct `email_proof`. - 6. Construct `email_auth_msg` and call `EmailAccountRecovery(controller_eth_addr).handleRecovery(email_auth_msg, template_idx)`. - 7. If the transaction fails, send `guardian_email_addr` an error email and update a record with `request_id` in the `requests` table to `(is_processed=true, is_success=false, email_nullifier=email_proof.email_nullifier, account_salt=email_proof.account_salt, is_code_exist=email_proof.is_code_exist)`. - 8. Send `guardian_email_addr` a success email and update a record with `request_id` in the `requests` table to `(is_processed=true, is_success=true, email_nullifier=email_proof.email_nullifier, account_salt=email_proof.email_nullifier, is_code_exist=email_proof.is_code_exist)`. +``` +cd packages/relayer +DATABASE_URL=postgres://relayer:relayer_password@localhost:5432/relayer sqlx migrate run +``` diff --git a/packages/relayer/build.rs b/packages/relayer/build.rs index f01e2d0e..b7a749b3 100644 --- a/packages/relayer/build.rs +++ b/packages/relayer/build.rs @@ -28,13 +28,4 @@ fn main() { .unwrap() .write_to_file("./src/abis/user_overridable_dkim_registry.rs") .unwrap(); - Abigen::new( - "EmailAccountRecovery", - "../contracts/artifacts/EmailAccountRecovery.sol/EmailAccountRecovery.json", - ) - .unwrap() - .generate() - .unwrap() - .write_to_file("./src/abis/email_account_recovery.rs") - .unwrap(); } diff --git a/packages/relayer/config.example.json b/packages/relayer/config.example.json new file mode 100644 index 00000000..527dbd78 --- /dev/null +++ b/packages/relayer/config.example.json @@ -0,0 +1,34 @@ +{ + "port": 8000, + "databaseUrl": "postgres://relayer:relayer_password@db:5432/relayer", + "smtpUrl": "http://smtp_server_1:3000", + "proverUrl": "https://zkemail--email-auth-prover-v1-5-4-flask-app.modal.run", + "alchemyApiKey": "", + "path": { + "pem": "./.ic.pem", + "emailTemplates": "./email_templates" + }, + "icp": { + "dkim_canisterId": "fxmww-qiaaa-aaaaj-azu7a-cai", + "wallet_canisterId": "", + "icReplicaUrl": "https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=fxmww-qiaaa-aaaaj-azu7a-cai" + }, + "chains": { + "baseSepolia": { + "privateKey": "", + "rpcUrl": "https://sepolia.base.org", + "chainId": 84532 + }, + "sepolia": { + "privateKey": "", + "rpcUrl": "https://rpc.sepolia.org", + "chainId": 11155111 + }, + "anvil": { + "privateKey": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", + "rpcUrl": "node:8545", + "chainId": 1337 + } + }, + "jsonLogger": false +} \ No newline at end of file diff --git a/packages/relayer/eml_templates/acknowledgement.html b/packages/relayer/email_templates/acknowledgement_template.html similarity index 85% rename from packages/relayer/eml_templates/acknowledgement.html rename to packages/relayer/email_templates/acknowledgement_template.html index 6c720aa7..4f11ae78 100644 --- a/packages/relayer/eml_templates/acknowledgement.html +++ b/packages/relayer/email_templates/acknowledgement_template.html @@ -90,20 +90,48 @@ margin: 0 auto; padding: 0; " + cellspacing="0" + cellpadding="0" > - + + + +
+ + + + + +
+ Z logo + + K logo +
+
@@ -111,13 +139,14 @@ width="100%" style=" background-color: white; + z-index: 100; padding: 2rem 1rem; border: 1px solid #dddddd; " > - - Hi, {{userEmailAddr}}! + + Hi, @@ -142,7 +171,11 @@ background-size: cover; height: 4.5rem; border-radius: 0 0 8px 8px; + padding: 0; + margin: 0; " + cellspacing="0" + cellpadding="0" > @@ -200,7 +233,7 @@