diff --git a/Cargo.lock b/Cargo.lock index c98d177987688..68f6280ad7f3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,6 +75,37 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "alloy-dyn-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b954c58532b0b327fa0cc7ce7d1a6b5a1554639620d99d812e27443cb486c7" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "arbitrary", + "const-hex", + "derive_arbitrary", + "itoa", + "proptest", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fe46acf61ad5bd7a5c21839bb2526358382fb8a6526f7ba393bdf593e2ae43f" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + [[package]] name = "alloy-primitives" version = "0.3.3" @@ -82,14 +113,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e416903084d3392ebd32d94735c395d6709415b76c7728e594d3f996f2b03e65" dependencies = [ "alloy-rlp", + "arbitrary", "bytes", "cfg-if", "const-hex", + "derive_arbitrary", "derive_more", "getrandom 0.2.10", "hex-literal", "itoa", "proptest", + "proptest-derive", "ruint", "serde", "tiny-keccak", @@ -113,11 +147,44 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa5bb468bc7c46e0c5074d418f575262ff79451242e5ac1380121ed4e23c4fd" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] +[[package]] +name = "alloy-sol-macro" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7720130c58db647103587b0c39aad4e669eea261e256040301d6c7983fdbb461" +dependencies = [ + "dunce", + "heck", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.37", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "627a32998aee7a7eedd351e9b6d4cacef9426935219a3a61befa332db1be5ca3" + +[[package]] +name = "alloy-sol-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa7c9a4354b1ff9f1c85adf22802af046e20e4bb55e19b9dc6ca8cbc6f7f4e5" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + [[package]] name = "ammonia" version = "3.3.0" @@ -304,6 +371,12 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "arbitrary" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" + [[package]] name = "ariadne" version = "0.2.0" @@ -314,6 +387,130 @@ dependencies = [ "yansi 0.5.1", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "array-init" version = "0.0.4" @@ -353,8 +550,8 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -364,8 +561,8 @@ version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -377,7 +574,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -399,8 +596,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" dependencies = [ "proc-macro-error", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -676,7 +873,7 @@ checksum = "fb9ac64500cc83ce4b9f8dafa78186aa008c8dea77a09b94cd307fd0cd5022a8" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -723,7 +920,7 @@ dependencies = [ "rpassword", "rusoto_core", "rusoto_kms", - "semver", + "semver 1.0.18", "serde", "serde_json", "tempfile", @@ -776,7 +973,7 @@ dependencies = [ "reqwest", "revm", "rustyline", - "semver", + "semver 1.0.18", "serde", "serde_json", "serial_test", @@ -889,8 +1086,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -1387,6 +1584,28 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" +dependencies = [ + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.37", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1394,9 +1613,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2", - "quote", - "rustc_version", + "proc-macro2 1.0.67", + "quote 1.0.33", + "rustc_version 0.4.0", "syn 1.0.109", ] @@ -1617,8 +1836,8 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -1811,8 +2030,8 @@ dependencies = [ "ethers-etherscan", "eyre", "prettyplease", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "regex", "reqwest", "serde", @@ -1831,8 +2050,8 @@ dependencies = [ "const-hex", "ethers-contract-abigen", "ethers-core", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "serde_json", "syn 2.0.37", ] @@ -1863,7 +2082,7 @@ dependencies = [ "tempfile", "thiserror", "tiny-keccak", - "unicode-xid", + "unicode-xid 0.2.4", ] [[package]] @@ -1874,7 +2093,7 @@ dependencies = [ "ethers-core", "ethers-solc", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -1964,7 +2183,7 @@ dependencies = [ "rand 0.8.5", "rusoto_core", "rusoto_kms", - "semver", + "semver 1.0.18", "sha2 0.10.7", "spki", "thiserror", @@ -1993,7 +2212,7 @@ dependencies = [ "rand 0.8.5", "rayon", "regex", - "semver", + "semver 1.0.18", "serde", "serde_json", "sha2 0.10.7", @@ -2060,8 +2279,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4caf31122bfc780557fdcd80897e95f12cc4d7217f8ac6b9d150df828a38ee8" dependencies = [ "bytes", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -2211,7 +2430,7 @@ dependencies = [ "rayon", "regex", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "serial_test", @@ -2363,7 +2582,7 @@ dependencies = [ "once_cell", "regex", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "tempfile", @@ -2395,7 +2614,7 @@ dependencies = [ "regex", "reqwest", "revm-primitives", - "semver", + "semver 1.0.18", "serde", "serde_json", "serde_regex", @@ -2425,6 +2644,7 @@ dependencies = [ name = "foundry-evm" version = "0.2.0" dependencies = [ + "alloy-dyn-abi", "alloy-primitives", "auto_impl", "bytes", @@ -2445,7 +2665,7 @@ dependencies = [ "parking_lot", "proptest", "revm", - "semver", + "semver 1.0.18", "serde", "serde_json", "tempfile", @@ -2471,8 +2691,8 @@ dependencies = [ name = "foundry-macros-impl" version = "0.2.0" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -2498,6 +2718,7 @@ dependencies = [ name = "foundry-utils" version = "0.2.0" dependencies = [ + "alloy-dyn-abi", "alloy-primitives", "const-hex", "dunce", @@ -2623,8 +2844,8 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -3183,8 +3404,8 @@ dependencies = [ "log", "mac", "markup5ever", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -3401,8 +3622,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -3663,7 +3884,7 @@ dependencies = [ "string_cache", "term", "tiny-keccak", - "unicode-xid", + "unicode-xid 0.2.4", ] [[package]] @@ -3930,8 +4151,8 @@ version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4197,8 +4418,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4264,8 +4485,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" dependencies = [ "bytes", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -4301,8 +4522,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4372,8 +4593,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -4411,7 +4632,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.67", "syn 1.0.109", "synstructure", ] @@ -4501,9 +4722,9 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f0f13dac8069c139e8300a6510e3f4143ecf5259c60b116a9b271b4ca0d54" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.67", "proc-macro2-diagnostics", - "quote", + "quote 1.0.33", "syn 2.0.37", ] @@ -4551,8 +4772,8 @@ checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4584,7 +4805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -4654,8 +4875,8 @@ checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator 0.11.2", "phf_shared 0.11.2", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4692,8 +4913,8 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -4787,7 +5008,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.67", "syn 2.0.37", ] @@ -4822,8 +5043,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", "version_check", ] @@ -4834,11 +5055,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "version_check", ] +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.67" @@ -4854,8 +5084,8 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", "version_check", "yansi 1.0.0-rc.1", @@ -4892,6 +5122,17 @@ dependencies = [ "unarray", ] +[[package]] +name = "proptest-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + [[package]] name = "protobuf" version = "3.2.0" @@ -4929,13 +5170,22 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + [[package]] name = "quote" version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.67", ] [[package]] @@ -5309,8 +5559,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -5342,8 +5592,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95294d6e3a6192f3aabf91c38f56505a625aa495533442744185a36d75a790c4" dependencies = [ "alloy-rlp", + "arbitrary", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "parity-scale-codec", + "primitive-types", "proptest", "rand 0.8.5", + "rlp", "ruint-macro", "serde", "valuable", @@ -5384,7 +5643,7 @@ dependencies = [ "log", "rusoto_credential", "rusoto_signature", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_json", "tokio", @@ -5443,7 +5702,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rusoto_credential", - "rustc_version", + "rustc_version 0.4.0", "serde", "sha2 0.9.9", "tokio", @@ -5461,13 +5720,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.18", ] [[package]] @@ -5646,8 +5914,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -5731,6 +5999,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.18" @@ -5740,6 +6017,15 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -5778,8 +6064,8 @@ version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -5846,8 +6132,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -6062,7 +6348,7 @@ dependencies = [ "lalrpop-util", "phf 0.11.2", "thiserror", - "unicode-xid", + "unicode-xid 0.2.4", ] [[package]] @@ -6115,8 +6401,8 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ "phf_generator 0.10.0", "phf_shared 0.10.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", ] [[package]] @@ -6147,8 +6433,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "rustversion", "syn 1.0.109", ] @@ -6160,8 +6446,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ "heck", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "rustversion", "syn 2.0.37", ] @@ -6196,7 +6482,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "sha2 0.10.7", @@ -6213,19 +6499,30 @@ checksum = "2271abd7d01895a3e5bfa4b578e32f09155002ce1ec239532e297f82aafad06b" dependencies = [ "build_const", "hex", - "semver", + "semver 1.0.18", "serde_json", "svm-rs", ] +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "unicode-ident", ] @@ -6235,11 +6532,23 @@ version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397f229dc34c7b8231b6ef85502f9ca4e3425b8625e6d403bb74779e6b1917b5" +dependencies = [ + "paste", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.37", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6252,10 +6561,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", - "unicode-xid", + "unicode-xid 0.2.4", ] [[package]] @@ -6346,8 +6655,8 @@ version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -6450,8 +6759,8 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -6712,8 +7021,8 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", ] @@ -6975,6 +7284,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -7139,8 +7454,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", "wasm-bindgen-shared", ] @@ -7163,7 +7478,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote", + "quote 1.0.33", "wasm-bindgen-macro-support", ] @@ -7173,8 +7488,8 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -7483,7 +7798,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", + "rustc_version 0.4.0", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -7523,6 +7838,20 @@ name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.37", +] [[package]] name = "zip" diff --git a/Cargo.toml b/Cargo.toml index faadc171fcfbe..e334b6008f44a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,12 +149,14 @@ ethers-middleware = { git = "https://github.com/gakonst/ethers-rs", default-feat ethers-etherscan = { git = "https://github.com/gakonst/ethers-rs", default-features = false } ethers-solc = { git = "https://github.com/gakonst/ethers-rs", default-features = false } +alloy-primitives = { version = "0.3", default-features = false } +alloy-dyn-abi = { version = "0.3", default-features = false} + chrono = { version = "0.4", default-features = false, features = ["clock", "std"] } hex = { package = "const-hex", version = "1.6", features = ["hex"] } itertools = "0.11" solang-parser = "=0.3.2" -alloy-primitives = { version = "0.3", default-features = false } #[patch."https://github.com/gakonst/ethers-rs"] #ethers = { path = "../ethers-rs/ethers" } diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index a12497faa0481..50455bc787002 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -49,7 +49,8 @@ revm = { workspace = true, default-features = false, features = [ "optional_no_base_fee", ] } -alloy-primitives = { workspace = true, default-features = false, features = ["std", "serde", "getrandom"] } +alloy-primitives = { workspace = true, default-features = false, features = ["std", "serde", "getrandom", "arbitrary", "rlp"] } +alloy-dyn-abi = { workspace = true, default-features = false, features = ["std", "arbitrary"] } # Fuzzer proptest = "1" diff --git a/crates/evm/src/executor/inspector/cheatcodes/env.rs b/crates/evm/src/executor/inspector/cheatcodes/env.rs index 4bdb066e16712..5afa17285ba03 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/env.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/env.rs @@ -11,13 +11,15 @@ use crate::{ }, utils::{b160_to_h160, h160_to_b160, ru256_to_u256, u256_to_ru256}, }; -use alloy_primitives::B256; +use alloy_dyn_abi::DynSolValue; +use alloy_primitives::{Bytes, B256}; use ethers::{ - abi::{self, AbiEncode, RawLog, Token, Tokenizable, Tokenize}, + abi::{self, RawLog, Token, Tokenizable, Tokenize}, signers::{LocalWallet, Signer}, - types::{Address, Bytes, U256}, + types::{Address, U256}, }; use foundry_config::Config; +use foundry_utils::types::ToAlloy; use revm::{ primitives::{Bytecode, SpecId, KECCAK_EMPTY}, Database, EVMData, @@ -398,7 +400,7 @@ pub fn apply( u256_to_ru256(inner.1.into()), data.db, )?; - ru256_to_u256(val).encode().into() + DynSolValue::from(val).encode_single().into() } HEVMCalls::Cool(inner) => cool_account(data, inner.0)?, HEVMCalls::Breakpoint0(inner) => add_breakpoint(state, caller, &inner.0, true)?, @@ -542,7 +544,7 @@ pub fn apply( // we can safely unwrap because `load_account` insert inner.0 to DB. let account = data.journaled_state.state().get(&h160_to_b160(inner.0)).unwrap(); - abi::encode(&[Token::Uint(account.info.nonce.into())]).into() + DynSolValue::from(account.info.nonce).encode_single().into() } // [function getNonce(Wallet)] returns the current nonce of the Wallet's ETH address HEVMCalls::GetNonce0(inner) => { @@ -559,7 +561,7 @@ pub fn apply( // we can safely unwrap because `load_account` insert inner.0 to DB. let account = data.journaled_state.state().get(&h160_to_b160(inner.0.addr)).unwrap(); - abi::encode(&[Token::Uint(account.info.nonce.into())]).into() + DynSolValue::from(account.info.nonce.to_alloy()).encode_single().into() } HEVMCalls::ChainId(inner) => { ensure!(inner.0 <= U256::from(u64::MAX), "Chain ID must be less than 2^64 - 1"); diff --git a/crates/evm/src/executor/inspector/cheatcodes/error.rs b/crates/evm/src/executor/inspector/cheatcodes/error.rs index 5461a9fa6a0bd..5fea6a3517f50 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/error.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/error.rs @@ -1,7 +1,7 @@ use crate::executor::backend::{error::NoCheatcodeAccessError, DatabaseError}; -use ethers::{ - abi::AbiEncode, prelude::k256::ecdsa::signature::Error as SignatureError, types::Bytes, -}; +use alloy_dyn_abi::DynSolValue; +use alloy_primitives::Bytes; +use ethers::prelude::k256::ecdsa::signature::Error as SignatureError; use foundry_common::errors::FsPathError; use foundry_config::UnresolvedEnvVarError; use foundry_utils::error::{encode_error, SolError}; @@ -179,7 +179,7 @@ impl SolError for Error { fn encode_string(&self) -> Bytes { match self { Self::CustomBytes(cow) => cow_to_bytes(cow), - e => e.to_string().encode().into(), + e => DynSolValue::String(e.to_string()).encode_single().into(), } } } diff --git a/crates/evm/src/executor/inspector/cheatcodes/expect.rs b/crates/evm/src/executor/inspector/cheatcodes/expect.rs index 0feb4f8a88323..10f9983de7904 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/expect.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/expect.rs @@ -1,9 +1,10 @@ use super::{bail, ensure, fmt_err, Cheatcodes, Result}; use crate::{abi::HEVMCalls, executor::backend::DatabaseExt, utils::h160_to_b160}; +use alloy_primitives::Bytes; use ethers::{ abi::{AbiDecode, RawLog}, contract::Lazy, - types::{Address, Bytes, H160, U256}, + types::{Address, H160, U256}, }; use foundry_utils::error::{ERROR_PREFIX, REVERT_PREFIX}; use revm::{ @@ -65,8 +66,8 @@ pub fn handle_expect_revert( } // If None, accept any revert - let expected_revert = match expected_revert { - Some(x) => x, + let mut expected_revert = match expected_revert { + Some(x) => x.clone(), None => return success_return!(), }; @@ -78,24 +79,24 @@ pub fn handle_expect_revert( if actual_revert.len() >= 4 && matches!(actual_revert[..4].try_into(), Ok(ERROR_PREFIX | REVERT_PREFIX)) { - if let Ok(bytes) = Bytes::decode(&actual_revert[4..]) { - actual_revert = bytes; + if let Ok(bytes) = ethers::types::Bytes::decode(&actual_revert[4..]) { + actual_revert = bytes.0.into(); } } if actual_revert == *expected_revert { success_return!() } else { - let stringify = |data: &[u8]| { - String::decode(data) + let stringify = |data: &mut Bytes| { + String::decode(data.0.as_ref()) .ok() - .or_else(|| std::str::from_utf8(data).ok().map(ToOwned::to_owned)) + .or_else(|| std::str::from_utf8(data.as_ref()).ok().map(ToOwned::to_owned)) .unwrap_or_else(|| format!("0x{}", hex::encode(data))) }; Err(fmt_err!( "Error != expected error: {} != {}", - stringify(&actual_revert), - stringify(expected_revert), + stringify(&mut actual_revert), + stringify(&mut expected_revert), )) } } @@ -334,7 +335,7 @@ pub fn apply( let result = match call { HEVMCalls::ExpectRevert0(_) => expect_revert(state, None, data.journaled_state.depth()), HEVMCalls::ExpectRevert1(inner) => { - expect_revert(state, Some(inner.0.clone()), data.journaled_state.depth()) + expect_revert(state, Some(inner.0.clone().0.into()), data.journaled_state.depth()) } HEVMCalls::ExpectRevert2(inner) => { expect_revert(state, Some(inner.0.into()), data.journaled_state.depth()) @@ -503,8 +504,11 @@ pub fn apply( data.journaled_state.set_code(h160_to_b160(inner.0), code); } state.mocked_calls.entry(inner.0).or_default().insert( - MockCallDataContext { calldata: inner.1.clone(), value: None }, - MockCallReturnData { data: inner.2.clone(), ret_type: InstructionResult::Return }, + MockCallDataContext { calldata: inner.1.clone().0.into(), value: None }, + MockCallReturnData { + data: inner.2.clone().0.into(), + ret_type: InstructionResult::Return, + }, ); Ok(Bytes::new()) } diff --git a/crates/evm/src/executor/inspector/cheatcodes/ext.rs b/crates/evm/src/executor/inspector/cheatcodes/ext.rs index f61bcbaf6bb70..e19db71af6210 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/ext.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/ext.rs @@ -1,5 +1,6 @@ use super::{bail, ensure, fmt_err, util::MAGIC_SKIP_BYTES, Cheatcodes, Error, Result}; use crate::{abi::HEVMCalls, executor::inspector::cheatcodes::parse}; +use alloy_primitives::Bytes; use ethers::{ abi::{self, AbiEncode, JsonAbi, ParamType, Token}, prelude::artifacts::CompactContractBytecode, @@ -106,9 +107,9 @@ impl ArtifactBytecode { match self { ArtifactBytecode::Hardhat(inner) => Some(inner.bytecode), ArtifactBytecode::Forge(inner) => { - inner.bytecode.and_then(|bytecode| bytecode.object.into_bytes()) + inner.bytecode.and_then(|bytecode| bytecode.object.into_bytes()).map(|b| b.0.into()) } - ArtifactBytecode::Solc(inner) => inner.bytecode(), + ArtifactBytecode::Solc(inner) => inner.bytecode().map(|b| b.0.into()), ArtifactBytecode::Huff(inner) => Some(inner.bytecode), } } @@ -117,9 +118,12 @@ impl ArtifactBytecode { match self { ArtifactBytecode::Hardhat(inner) => Some(inner.deployed_bytecode), ArtifactBytecode::Forge(inner) => inner.deployed_bytecode.and_then(|bytecode| { - bytecode.bytecode.and_then(|bytecode| bytecode.object.into_bytes()) + bytecode + .bytecode + .and_then(|bytecode| bytecode.object.into_bytes()) + .map(|b| b.0.into()) }), - ArtifactBytecode::Solc(inner) => inner.deployed_bytecode(), + ArtifactBytecode::Solc(inner) => inner.deployed_bytecode().map(|b| b.0.into()), ArtifactBytecode::Huff(inner) => Some(inner.runtime), } } @@ -143,7 +147,7 @@ struct HuffArtifact { fn get_code(state: &Cheatcodes, path: &str) -> Result { let bytecode = read_bytecode(state, path)?; if let Some(bin) = bytecode.into_bytecode() { - Ok(bin.encode().into()) + Ok(bin.0.clone().encode().into()) } else { Err(fmt_err!("No bytecode for contract. Is it abstract or unlinked?")) } @@ -153,7 +157,7 @@ fn get_code(state: &Cheatcodes, path: &str) -> Result { fn get_deployed_code(state: &Cheatcodes, path: &str) -> Result { let bytecode = read_bytecode(state, path)?; if let Some(bin) = bytecode.into_deployed_bytecode() { - Ok(bin.encode().into()) + Ok(bin.0.clone().encode().into()) } else { Err(fmt_err!("No deployed bytecode for contract. Is it abstract or unlinked?")) } diff --git a/crates/evm/src/executor/inspector/cheatcodes/fork.rs b/crates/evm/src/executor/inspector/cheatcodes/fork.rs index 766457c988c43..447b04b561743 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/fork.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/fork.rs @@ -6,11 +6,11 @@ use crate::{ }, utils::{h160_to_b160, ru256_to_u256, u256_to_ru256, RuntimeOrHandle}, }; -use alloy_primitives::{B256, U256}; +use alloy_primitives::{Bytes, B256, U256}; use ethers::{ abi::{self, AbiEncode, Token, Tokenizable, Tokenize}, providers::Middleware, - types::{Bytes, Filter, U256 as eU256}, + types::{Filter, U256 as eU256}, }; use foundry_abi::hevm::{EthGetLogsCall, RpcCall}; use foundry_common::ProviderBuilder; diff --git a/crates/evm/src/executor/inspector/cheatcodes/fs.rs b/crates/evm/src/executor/inspector/cheatcodes/fs.rs index 31ed6cc9d42d9..19a85d5f4227a 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/fs.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/fs.rs @@ -1,9 +1,7 @@ use super::{Cheatcodes, Result}; use crate::abi::hevm::{DirEntry, FsMetadata, HEVMCalls}; -use ethers::{ - abi::{self, AbiEncode, Token, Tokenize}, - types::Bytes, -}; +use alloy_primitives::Bytes; +use ethers::abi::{self, AbiEncode, Token, Tokenize}; use foundry_common::fs; use foundry_config::fs_permissions::FsAccessKind; use std::{ diff --git a/crates/evm/src/executor/inspector/cheatcodes/fuzz.rs b/crates/evm/src/executor/inspector/cheatcodes/fuzz.rs index 6ed597d574d49..e833abdb402e2 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/fuzz.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/fuzz.rs @@ -1,6 +1,6 @@ use super::{Error, Result}; use crate::{abi::HEVMCalls, fuzz::error::ASSUME_MAGIC_RETURN_CODE}; -use ethers::types::Bytes; +use alloy_primitives::Bytes; #[instrument(level = "error", name = "fuzz", target = "evm::cheatcodes", skip_all)] pub fn apply(call: &HEVMCalls) -> Option { diff --git a/crates/evm/src/executor/inspector/cheatcodes/mapping.rs b/crates/evm/src/executor/inspector/cheatcodes/mapping.rs index 52eaae37801d5..4d34b5f3373fb 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/mapping.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/mapping.rs @@ -1,8 +1,9 @@ use super::Cheatcodes; use crate::utils::{b160_to_h160, ru256_to_u256}; +use alloy_primitives::Bytes; use ethers::{ abi::{self, Token}, - types::{Address, Bytes, U256}, + types::{Address, U256}, utils::keccak256, }; use revm::{ diff --git a/crates/evm/src/executor/inspector/cheatcodes/mod.rs b/crates/evm/src/executor/inspector/cheatcodes/mod.rs index ba94fbb9704e3..58a85fdda8a73 100644 --- a/crates/evm/src/executor/inspector/cheatcodes/mod.rs +++ b/crates/evm/src/executor/inspector/cheatcodes/mod.rs @@ -12,13 +12,12 @@ use crate::{ }, utils::{b160_to_h160, b256_to_h256, h160_to_b160, ru256_to_u256, u256_to_ru256}, }; -use alloy_primitives::{Address as rAddress, B256}; +use alloy_primitives::{Address as rAddress, Bytes, B256}; use ethers::{ abi::{AbiDecode, AbiEncode, RawLog}, signers::LocalWallet, types::{ - transaction::eip2718::TypedTransaction, Address, Bytes, NameOrAddress, TransactionRequest, - U256, + transaction::eip2718::TypedTransaction, Address, NameOrAddress, TransactionRequest, U256, }, }; use foundry_common::evm::Breakpoints; @@ -611,7 +610,7 @@ impl Inspector for Cheatcodes { // Handle mocked calls if let Some(mocks) = self.mocked_calls.get(&b160_to_h160(call.contract)) { let ctx = MockCallDataContext { - calldata: ethers::types::Bytes::from(call.input.clone().0), + calldata: call.input.clone().0.into(), value: Some(call.transfer.value).map(ru256_to_u256), }; if let Some(mock_retdata) = mocks.get(&ctx) { @@ -792,7 +791,7 @@ impl Inspector for Cheatcodes { false, expected_revert.reason.as_ref(), status, - ethers::types::Bytes(retdata.0), + retdata, ) { Err(error) => { trace!(expected=?expected_revert, ?error, ?status, "Expected revert mismatch"); @@ -1093,7 +1092,7 @@ impl Inspector for Cheatcodes { true, expected_revert.reason.as_ref(), status, - ethers::types::Bytes(retdata.0), + retdata, ) { Ok((address, retdata)) => ( InstructionResult::Return, diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 740adcb86cd62..4240bf42508d3 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -19,6 +19,7 @@ ethers-providers.workspace = true ethers-solc.workspace = true alloy-primitives = { workspace = true, features = ["std"]} +alloy-dyn-abi = { workspace = true, features = ["std"]} eyre = { version = "0.6", default-features = false } futures = "0.3" diff --git a/crates/utils/src/error.rs b/crates/utils/src/error.rs index e92dee054d157..5e0cdad185401 100644 --- a/crates/utils/src/error.rs +++ b/crates/utils/src/error.rs @@ -1,6 +1,7 @@ //! error handling and support -use ethers_core::{abi::AbiEncode, types::Bytes}; +use alloy_dyn_abi::DynSolValue; +use alloy_primitives::Bytes; use std::fmt::Display; /// Solidity revert prefix. @@ -26,11 +27,14 @@ pub trait SolError: std::error::Error { /// /// See also [`AbiEncode`](ethers::abi::AbiEncode) fn encode_string(&self) -> Bytes { - self.to_string().encode().into() + let err = DynSolValue::from(self.to_string()); + err.encode_single().into() } } /// Encodes the given messages as solidity custom error pub fn encode_error(reason: impl Display) -> Bytes { - [ERROR_PREFIX.as_slice(), reason.to_string().encode().as_slice()].concat().into() + [ERROR_PREFIX.as_slice(), DynSolValue::String(reason.to_string()).encode_single().as_slice()] + .concat() + .into() } diff --git a/crates/utils/src/types.rs b/crates/utils/src/types.rs index 61aa86af72084..5f3efb593ead0 100644 --- a/crates/utils/src/types.rs +++ b/crates/utils/src/types.rs @@ -35,6 +35,14 @@ impl ToAlloy for U256 { } } +impl ToAlloy for u64 { + type To = AlloyU256; + + fn to_alloy(self) -> Self::To { + AlloyU256::from(self) + } +} + /// Conversion trait to easily convert from alloy primitive types to ethers-rs types. pub trait ToEthers { type To;