From 2b688ce000a41386589e5be00477fb28c3940d47 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Fri, 29 Nov 2024 17:33:10 +0100 Subject: [PATCH 01/25] build: bump Stylus SDK and alloy versions (cherry picked from commit e539ee931812135f0c1295754140b0bf01417e4f) --- Cargo.lock | 1186 ++++++++++++++++++++------ Cargo.toml | 16 +- examples/erc1155/src/constructor.sol | 4 +- 3 files changed, 925 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5043d0fc0..95c68d77a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,8 +6,8 @@ version = 4 name = "access-control-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -59,6 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -85,20 +86,42 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" dependencies = [ - "alloy-consensus", - "alloy-contract", - "alloy-core", - "alloy-eips", - "alloy-genesis", - "alloy-network", - "alloy-provider", - "alloy-rpc-client", - "alloy-rpc-types", - "alloy-serde", - "alloy-signer", - "alloy-signer-local", - "alloy-transport", - "alloy-transport-http", + "alloy-consensus 0.1.3", + "alloy-contract 0.1.3", + "alloy-core 0.7.6", + "alloy-eips 0.1.3", + "alloy-genesis 0.1.3", + "alloy-network 0.1.3", + "alloy-provider 0.1.3", + "alloy-rpc-client 0.1.3", + "alloy-rpc-types 0.1.3", + "alloy-serde 0.1.3", + "alloy-signer 0.1.3", + "alloy-signer-local 0.1.3", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", +] + +[[package]] +name = "alloy" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44ab65cb6104c389b46df77b7990cab08780f57e41b412b46d6d12baf7e8c716" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-contract 0.7.0", + "alloy-core 0.8.13", + "alloy-eips 0.7.0", + "alloy-genesis 0.7.0", + "alloy-network 0.7.0", + "alloy-provider 0.7.0", + "alloy-rpc-client 0.7.0", + "alloy-rpc-types 0.7.0", + "alloy-serde 0.7.0", + "alloy-signer 0.7.0", + "alloy-signer-local 0.7.0", + "alloy-transport 0.7.0", + "alloy-transport-http 0.7.0", ] [[package]] @@ -117,11 +140,42 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" dependencies = [ - "alloy-eips", - "alloy-primitives", + "alloy-eips 0.1.3", + "alloy-primitives 0.7.6", + "alloy-rlp", + "alloy-serde 0.1.3", + "c-kzg", + "serde", +] + +[[package]] +name = "alloy-consensus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1ff8439834ab71a4b0ecd1a8ff80b3921c87615f158940c3364f399c732786" +dependencies = [ + "alloy-eips 0.7.0", + "alloy-primitives 0.8.13", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.7.0", + "alloy-trie", + "auto_impl", "c-kzg", + "derive_more 1.0.0", + "serde", +] + +[[package]] +name = "alloy-consensus-any" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519a86faaa6729464365a90c04eba68539b6d3a30f426edb4b3dafd78920d42f" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-eips 0.7.0", + "alloy-primitives 0.8.13", + "alloy-rlp", + "alloy-serde 0.7.0", "serde", ] @@ -131,14 +185,34 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c26b7d34cb76f826558e9409a010e25257f7bfb5aa5e3dd0042c564664ae159" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-network", - "alloy-primitives", - "alloy-provider", - "alloy-rpc-types-eth", - "alloy-sol-types", - "alloy-transport", + "alloy-dyn-abi 0.7.6", + "alloy-json-abi 0.7.6", + "alloy-network 0.1.3", + "alloy-primitives 0.7.6", + "alloy-provider 0.1.3", + "alloy-rpc-types-eth 0.1.3", + "alloy-sol-types 0.7.6", + "alloy-transport 0.1.3", + "futures", + "futures-util", + "thiserror", +] + +[[package]] +name = "alloy-contract" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca2b353d8b7f160dc930dfa174557acefece6deab5ecd7e6230d38858579eea" +dependencies = [ + "alloy-dyn-abi 0.8.13", + "alloy-json-abi 0.8.13", + "alloy-network 0.7.0", + "alloy-network-primitives", + "alloy-primitives 0.8.13", + "alloy-provider 0.7.0", + "alloy-rpc-types-eth 0.7.0", + "alloy-sol-types 0.8.13", + "alloy-transport 0.7.0", "futures", "futures-util", "thiserror", @@ -150,10 +224,23 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5af3faff14c12c8b11037e0a093dd157c3702becb8435577a2408534d0758315" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", + "alloy-dyn-abi 0.7.6", + "alloy-json-abi 0.7.6", + "alloy-primitives 0.7.6", + "alloy-sol-types 0.7.6", +] + +[[package]] +name = "alloy-core" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d22df68fa7d9744be0b1a9be3260e9aa089fbf41903ab182328333061ed186" +dependencies = [ + "alloy-dyn-abi 0.8.13", + "alloy-json-abi 0.8.13", + "alloy-primitives 0.8.13", + "alloy-rlp", + "alloy-sol-types 0.8.13", ] [[package]] @@ -162,10 +249,27 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", + "alloy-json-abi 0.7.6", + "alloy-primitives 0.7.6", + "alloy-sol-type-parser 0.7.6", + "alloy-sol-types 0.7.6", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow 0.6.13", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf633ae9a1f0c82fdb9e559ed2be1c8e415c3e48fc47e1feaf32c6078ec0cdd" +dependencies = [ + "alloy-json-abi 0.8.13", + "alloy-primitives 0.8.13", + "alloy-sol-type-parser 0.8.14", + "alloy-sol-types 0.8.13", "const-hex", "itoa", "serde", @@ -173,29 +277,81 @@ dependencies = [ "winnow 0.6.13", ] +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-rlp", + "derive_more 1.0.0", + "serde", +] + [[package]] name = "alloy-eips" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.6", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.3", "c-kzg", "once_cell", "serde", "sha2", ] +[[package]] +name = "alloy-eips" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dedb328c2114284f767e075589ca9de8d5e9c8a91333402f4804a584ed71a38" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 0.8.13", + "alloy-rlp", + "alloy-serde 0.7.0", + "c-kzg", + "derive_more 1.0.0", + "once_cell", + "serde", + "sha2", +] + [[package]] name = "alloy-genesis" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" dependencies = [ - "alloy-primitives", - "alloy-serde", + "alloy-primitives 0.7.6", + "alloy-serde 0.1.3", + "serde", +] + +[[package]] +name = "alloy-genesis" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4841e8dd4e0f53d76b501fd4c6bc21d95d688bc8ebf0ea359fc6c7ab65b48742" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-serde 0.7.0", "serde", ] @@ -205,8 +361,20 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaeaccd50238126e3a0ff9387c7c568837726ad4f4e399b528ca88104d6c25ef" dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", + "alloy-primitives 0.7.6", + "alloy-sol-type-parser 0.7.6", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-sol-type-parser 0.8.14", "serde", "serde_json", ] @@ -217,7 +385,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d484c2a934d0a4d86f8ad4db8113cb1d607707a6c54f6e78f4f1b4451b47aa70" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.6", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "254f770918f96dc4ec88a15e6e2e243358e1719d66b40ef814428e7697079d25" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "serde", "serde_json", "thiserror", @@ -230,25 +412,86 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a20eba9bc551037f0626d6d29e191888638d979943fa4e842e9e6fc72bf0565" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-primitives", - "alloy-rpc-types-eth", - "alloy-serde", - "alloy-signer", - "alloy-sol-types", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", + "alloy-json-rpc 0.1.3", + "alloy-primitives 0.7.6", + "alloy-rpc-types-eth 0.1.3", + "alloy-serde 0.1.3", + "alloy-signer 0.1.3", + "alloy-sol-types 0.7.6", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", +] + +[[package]] +name = "alloy-network" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "931dd176c6e33355f3dc0170ec69cf5b951f4d73870b276e2c837ab35f9c5136" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-consensus-any", + "alloy-eips 0.7.0", + "alloy-json-rpc 0.7.0", + "alloy-network-primitives", + "alloy-primitives 0.8.13", + "alloy-rpc-types-any", + "alloy-rpc-types-eth 0.7.0", + "alloy-serde 0.7.0", + "alloy-signer 0.7.0", + "alloy-sol-types 0.8.13", "async-trait", "auto_impl", "futures-utils-wasm", + "serde", + "serde_json", "thiserror", ] +[[package]] +name = "alloy-network-primitives" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa6ec0f23be233e851e31c5e4badfedfa9c7bc177bc37f4e03616072cd40a806" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-eips 0.7.0", + "alloy-primitives 0.8.13", + "alloy-serde 0.7.0", + "serde", +] + [[package]] name = "alloy-primitives" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "getrandom", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "alloy-rlp", "arbitrary", @@ -256,18 +499,23 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more", - "ethereum_ssz", + "derive_more 1.0.0", + "foldhash", "getrandom", + "hashbrown 0.15.2", "hex-literal", + "indexmap 2.6.0", "itoa", "k256", "keccak-asm", + "paste", "proptest", "proptest-derive", "rand", "ruint", + "rustc-hash", "serde", + "sha3", "tiny-keccak", ] @@ -278,15 +526,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad5d89acb7339fad13bc69e7b925232f242835bfd91c82fcb9326b36481bd0f0" dependencies = [ "alloy-chains", - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-network", - "alloy-primitives", - "alloy-rpc-client", - "alloy-rpc-types-eth", - "alloy-transport", - "alloy-transport-http", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", + "alloy-json-rpc 0.1.3", + "alloy-network 0.1.3", + "alloy-primitives 0.7.6", + "alloy-rpc-client 0.1.3", + "alloy-rpc-types-eth 0.1.3", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", "async-stream", "async-trait", "auto_impl", @@ -303,11 +551,48 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-provider" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5545e2cbf2f8f24c68bb887ba0294fa12a2f816b9e72c4f226cd137b77d0e294" +dependencies = [ + "alloy-chains", + "alloy-consensus 0.7.0", + "alloy-eips 0.7.0", + "alloy-json-rpc 0.7.0", + "alloy-network 0.7.0", + "alloy-network-primitives", + "alloy-primitives 0.8.13", + "alloy-rpc-client 0.7.0", + "alloy-rpc-types-eth 0.7.0", + "alloy-transport 0.7.0", + "alloy-transport-http 0.7.0", + "async-stream", + "async-trait", + "auto_impl", + "dashmap 6.1.0", + "futures", + "futures-utils-wasm", + "lru", + "parking_lot", + "pin-project", + "reqwest", + "schnellru", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", + "wasmtimer", +] + [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -316,13 +601,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -331,9 +616,9 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ce003e8c74bbbc7d4235131c1d6b7eaf14a533ae850295b90d240340989cb" dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "alloy-transport-http", + "alloy-json-rpc 0.1.3", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", "futures", "pin-project", "reqwest", @@ -341,19 +626,66 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", "url", ] +[[package]] +name = "alloy-rpc-client" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aed9e40c2a73265ebf70f1e48303ee55920282e1ea5971e832873fb2d32cea74" +dependencies = [ + "alloy-json-rpc 0.7.0", + "alloy-primitives 0.8.13", + "alloy-transport 0.7.0", + "alloy-transport-http 0.7.0", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower 0.5.1", + "tracing", + "url", + "wasmtimer", +] + [[package]] name = "alloy-rpc-types" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" dependencies = [ - "alloy-rpc-types-eth", - "alloy-serde", + "alloy-rpc-types-eth 0.1.3", + "alloy-serde 0.1.3", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42dea20fa715a6f39ec7adc735cfd9567342870737270ac67795d55896527772" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-rpc-types-eth 0.7.0", + "alloy-serde 0.7.0", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79d7620e22d6ed7c58451dd303d0501ade5a8bec9dc8daef0fbc48ceffabbae1" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-consensus-any", + "alloy-rpc-types-eth 0.7.0", + "alloy-serde 0.7.0", ] [[package]] @@ -362,25 +694,56 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", + "alloy-primitives 0.7.6", "alloy-rlp", - "alloy-serde", - "alloy-sol-types", + "alloy-serde 0.1.3", + "alloy-sol-types 0.7.6", "itertools 0.13.0", "serde", "serde_json", "thiserror", ] +[[package]] +name = "alloy-rpc-types-eth" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df34b88df4deeac9ecfc80ad7cbb26a33e57437b9db8be5b952792feef6134bc" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-consensus-any", + "alloy-eips 0.7.0", + "alloy-network-primitives", + "alloy-primitives 0.8.13", + "alloy-rlp", + "alloy-serde 0.7.0", + "alloy-sol-types 0.8.13", + "derive_more 1.0.0", + "itertools 0.13.0", + "serde", + "serde_json", +] + [[package]] name = "alloy-serde" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.6", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a89fd4cc3f96b3c5c0dd1cebeb63323e4659bbdc837117fa3fd5ac168df7d9" +dependencies = [ + "alloy-primitives 0.8.13", "serde", "serde_json", ] @@ -391,7 +754,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f740e13eb4c6a0e4d0e49738f1e86f31ad2d7ef93be499539f492805000f7237" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.6", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532010243a96d1f8593c2246ec3971bc52303884fa1e43ca0a776798ba178910" +dependencies = [ + "alloy-primitives 0.8.13", "async-trait", "auto_impl", "elliptic-curve", @@ -405,10 +782,10 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87db68d926887393a1d0f9c43833b44446ea29d603291e7b20e5d115f31aa4e3" dependencies = [ - "alloy-consensus", - "alloy-network", - "alloy-primitives", - "alloy-signer", + "alloy-consensus 0.1.3", + "alloy-network 0.1.3", + "alloy-primitives 0.7.6", + "alloy-signer 0.1.3", "async-trait", "elliptic-curve", "eth-keystore", @@ -417,54 +794,120 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-signer-local" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8080c0ab2dc729b0cbb183843d08e78d2a1629140c9fc16234d2272abb483bd" +dependencies = [ + "alloy-consensus 0.7.0", + "alloy-network 0.7.0", + "alloy-primitives 0.8.13", + "alloy-signer 0.7.0", + "async-trait", + "k256", + "rand", + "thiserror", +] + [[package]] name = "alloy-sol-macro" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.7.6", + "alloy-sol-macro-input 0.7.6", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0279d09463a4695788a3622fd95443625f7be307422deba4b55dd491a9c7a1" +dependencies = [ + "alloy-sol-macro-expander 0.8.13", + "alloy-sol-macro-input 0.8.13", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +dependencies = [ + "alloy-json-abi 0.7.6", + "alloy-sol-macro-input 0.7.6", + "const-hex", + "heck", + "indexmap 2.6.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.89", + "syn-solidity 0.7.6", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feea540fc8233df2ad1156efd744b2075372f43a8f942a68b3b19c8a00e2c12" +dependencies = [ + "alloy-json-abi 0.8.13", + "alloy-sol-macro-input 0.8.13", + "const-hex", + "heck", + "indexmap 2.6.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.89", + "syn-solidity 0.8.14", + "tiny-keccak", ] [[package]] -name = "alloy-sol-macro-expander" +name = "alloy-sol-macro-input" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" dependencies = [ - "alloy-json-abi", - "alloy-sol-macro-input", + "alloy-json-abi 0.7.6", "const-hex", + "dunce", "heck", - "indexmap 2.2.6", - "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.68", - "syn-solidity", - "tiny-keccak", + "serde_json", + "syn 2.0.89", + "syn-solidity 0.7.6", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "2a0ad281f3d1b613af814b66977ee698e443d4644a1510962d0241f26e0e53ae" dependencies = [ - "alloy-json-abi", + "alloy-json-abi 0.8.13", "const-hex", "dunce", "heck", "proc-macro2", "quote", "serde_json", - "syn 2.0.68", - "syn-solidity", + "syn 2.0.89", + "syn-solidity 0.8.14", ] [[package]] @@ -476,15 +919,38 @@ dependencies = [ "winnow 0.6.13", ] +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac17c6e89a50fb4a758012e4b409d9a0ba575228e69b539fe37d7a1bd507ca4a" +dependencies = [ + "serde", + "winnow 0.6.13", +] + [[package]] name = "alloy-sol-types" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", + "alloy-json-abi 0.7.6", + "alloy-primitives 0.7.6", + "alloy-sol-macro 0.7.6", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" +dependencies = [ + "alloy-json-abi 0.8.13", + "alloy-primitives 0.8.13", + "alloy-sol-macro 0.8.13", "const-hex", "serde", ] @@ -495,7 +961,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd9773e4ec6832346171605c776315544bd06e40f803e7b5b7824b325d5442ca" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.3", + "base64", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower 0.4.13", + "url", +] + +[[package]] +name = "alloy-transport" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f295f4b745fb9e4e663d70bc57aed991288912c7aaaf25767def921050ee43" +dependencies = [ + "alloy-json-rpc 0.7.0", "base64", "futures-util", "futures-utils-wasm", @@ -503,8 +987,10 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tower", + "tower 0.5.1", + "tracing", "url", + "wasmtimer", ] [[package]] @@ -513,15 +999,45 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff8ef947b901c0d4e97370f9fa25844cf8b63b1a58fd4011ee82342dc8a9fc6b" dependencies = [ - "alloy-json-rpc", - "alloy-transport", + "alloy-json-rpc 0.1.3", + "alloy-transport 0.1.3", + "reqwest", + "serde_json", + "tower 0.4.13", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport-http" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39139015a5ec127d9c895b49b484608e27fe4538544f84cdf5eae0bd36339bc6" +dependencies = [ + "alloy-json-rpc 0.7.0", + "alloy-transport 0.7.0", "reqwest", "serde_json", - "tower", + "tower 0.5.1", "tracing", "url", ] +[[package]] +name = "alloy-trie" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b2e366c0debf0af77766c23694a3f863b02633050e71e096e257ffbd395e50" +dependencies = [ + "alloy-primitives 0.8.13", + "alloy-rlp", + "arrayvec", + "derive_more 1.0.0", + "nybbles", + "smallvec", + "tracing", +] + [[package]] name = "anstream" version = "0.6.14" @@ -726,7 +1242,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -737,7 +1253,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -748,7 +1264,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -794,7 +1310,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" name = "basic-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.13", "openzeppelin-stylus", "stylus-sdk", ] @@ -803,8 +1319,8 @@ dependencies = [ name = "basic-example-script" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "basic-example", "koba", "tokio", @@ -814,8 +1330,8 @@ dependencies = [ name = "benches" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "futures", @@ -1029,7 +1545,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1256,8 +1772,8 @@ dependencies = [ name = "cryptography-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1294,7 +1810,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1305,7 +1821,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1364,7 +1880,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1377,7 +1893,28 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.68", + "syn 2.0.89", +] + +[[package]] +name = "derive_more" +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 = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "unicode-xid", ] [[package]] @@ -1411,7 +1948,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" name = "e2e" version = "0.1.0" dependencies = [ - "alloy", + "alloy 0.7.2", "e2e-proc", "eyre", "koba", @@ -1427,7 +1964,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1453,7 +1990,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1518,7 +2055,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1539,7 +2076,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1552,8 +2089,8 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" name = "erc1155-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1565,8 +2102,8 @@ dependencies = [ name = "erc20-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1578,8 +2115,8 @@ dependencies = [ name = "erc20-permit-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1591,9 +2128,9 @@ dependencies = [ name = "erc721-consecutive-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", - "alloy-sol-types", + "alloy 0.7.2", + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1606,8 +2143,8 @@ dependencies = [ name = "erc721-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1620,8 +2157,8 @@ dependencies = [ name = "erc721-metadata-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -1662,44 +2199,6 @@ dependencies = [ "uuid 0.8.2", ] -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "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-rlp", - "impl-serde", - "primitive-types", - "uint", -] - -[[package]] -name = "ethereum_ssz" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" -dependencies = [ - "ethereum-types", - "itertools 0.10.5", - "smallvec", -] - [[package]] name = "eyre" version = "0.6.12" @@ -1749,7 +2248,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "arbitrary", "byteorder", "rand", "rustc-hex", @@ -1762,6 +2260,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1848,7 +2352,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -1961,6 +2465,12 @@ dependencies = [ "ahash 0.7.8", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1971,6 +2481,16 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", + "serde", +] + [[package]] name = "heck" version = "0.5.0" @@ -2097,7 +2617,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] @@ -2127,24 +2647,6 @@ 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" @@ -2174,12 +2676,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ + "arbitrary", "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.2", + "serde", ] [[package]] @@ -2280,7 +2784,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e92e1148d087df999396266311bece9e5311c352821872cccaf5dc67117cfc" dependencies = [ - "alloy", + "alloy 0.1.4", "brotli2", "bytesize", "clap", @@ -2395,8 +2899,8 @@ dependencies = [ name = "merkle-proofs-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "openzeppelin-crypto", "stylus-sdk", ] @@ -2409,9 +2913,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mini-alloc" -version = "0.6.0" +version = "0.7.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14eacc4bfcf10da9b6d5185ef51b2dc75434afac34b4d8aabe40f6b141ee071c" +checksum = "6d79b46612e3fc76138ed930cd2e4bbd26ada11954a6d312e3affe4b56df0081" dependencies = [ "cfg-if", ] @@ -2458,13 +2962,13 @@ dependencies = [ name = "motsu-proc" version = "0.2.0" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "motsu", "proc-macro2", "quote", "stylus-sdk", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -2540,7 +3044,17 @@ checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", +] + +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "const-hex", + "smallvec", ] [[package]] @@ -2581,7 +3095,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -2620,11 +3134,11 @@ dependencies = [ name = "openzeppelin-stylus" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives", - "alloy-sol-macro", - "alloy-sol-macro-expander", - "alloy-sol-macro-input", - "alloy-sol-types", + "alloy-primitives 0.8.13", + "alloy-sol-macro 0.8.13", + "alloy-sol-macro-expander 0.8.13", + "alloy-sol-macro-input 0.8.13", + "alloy-sol-types 0.8.13", "keccak-const", "motsu", "openzeppelin-stylus-proc", @@ -2639,15 +3153,15 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] name = "ownable-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -2659,8 +3173,8 @@ dependencies = [ name = "ownable-two-step" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -2772,7 +3286,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -2817,8 +3331,6 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", "uint", ] @@ -2855,11 +3367,33 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2886,13 +3420,13 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" +checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.89", ] [[package]] @@ -2945,6 +3479,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -3018,9 +3553,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3030,9 +3565,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3041,9 +3576,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "region" @@ -3094,7 +3629,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", "tokio-native-tls", "tower-service", @@ -3192,6 +3727,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -3273,8 +3814,8 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" name = "safe-erc20-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -3300,6 +3841,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash 0.8.11", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -3413,7 +3965,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -3582,36 +4134,38 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] name = "stylus-proc" -version = "0.6.0" +version = "0.7.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd02e91dffe7b73df84a861c992494d6b72054bc9a17fe73e147e34e9a64ef3" +checksum = "8abd5d2cb3a10a36101b3d9243eda29daa58aad89b93979afe77c4be89068413" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "cfg-if", "convert_case 0.6.0", "lazy_static", + "proc-macro-error", "proc-macro2", "quote", "regex", "sha3", - "syn 1.0.109", - "syn-solidity", + "syn 2.0.89", + "syn-solidity 0.8.14", + "trybuild", ] [[package]] name = "stylus-sdk" -version = "0.6.0" +version = "0.7.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26042693706e29fb7e3cf3d71c99534ac97fca98b6f81ba77ab658022ab2e210" +checksum = "caa33222d37101b3ba7064f1099ae38c7e388eaeac422e58260b7d00346a5267" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.8.13", + "alloy-sol-types 0.8.13", "cfg-if", "derivative", "hex", @@ -3640,9 +4194,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -3658,9 +4212,27 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", +] + +[[package]] +name = "syn-solidity" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0523f59468a2696391f2a772edc089342aacd53c3caa2ac3264e598edf119b" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.89", ] +[[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" @@ -3679,6 +4251,12 @@ version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" version = "3.10.1" @@ -3691,6 +4269,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.61" @@ -3708,7 +4295,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -3771,7 +4358,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -3836,7 +4423,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.40", ] @@ -3847,7 +4434,7 @@ version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -3870,17 +4457,31 @@ dependencies = [ "tracing", ] +[[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", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3902,7 +4503,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -3920,6 +4521,21 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml", +] + [[package]] name = "typenum" version = "1.17.0" @@ -3938,7 +4554,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "arbitrary", "byteorder", "crunchy", "hex", @@ -3984,6 +4599,12 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "url" version = "2.5.2" @@ -4039,8 +4660,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" name = "vesting-wallet-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy", - "alloy-primitives", + "alloy 0.7.2", + "alloy-primitives 0.8.13", "e2e", "eyre", "openzeppelin-stylus", @@ -4093,7 +4714,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -4150,7 +4771,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4305,6 +4926,20 @@ dependencies = [ "url", ] +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "wast" version = "212.0.0" @@ -4353,6 +4988,15 @@ 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.52.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4595,7 +5239,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] [[package]] @@ -4615,5 +5259,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.89", ] diff --git a/Cargo.toml b/Cargo.toml index cf26be1b5..841770e5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,10 +69,10 @@ pedantic = "warn" all = "warn" [workspace.dependencies] -# stylus-related -stylus-sdk = "0.6.0" +# Stylus SDK related +stylus-sdk = "0.7.0-beta.1" -alloy = { version = "=0.1.4", features = [ +alloy = { version = "=0.7.2", features = [ "contract", "network", "providers", @@ -85,11 +85,11 @@ alloy = { version = "=0.1.4", features = [ # Even though `alloy` includes `alloy-primitives` and `alloy-sol-types` we need # to keep both versions for compatibility with the Stylus SDK. Once they start # using `alloy` we can remove these. -alloy-primitives = { version = "=0.7.6", default-features = false } -alloy-sol-types = { version = "=0.7.6", default-features = false } -alloy-sol-macro = { version = "=0.7.6", default-features = false } -alloy-sol-macro-expander = { version = "=0.7.6", default-features = false } -alloy-sol-macro-input = { version = "=0.7.6", default-features = false } +alloy-primitives = { version = "=0.8.13", default-features = false } +alloy-sol-types = { version = "=0.8.13", default-features = false } +alloy-sol-macro = { version = "=0.8.13", default-features = false } +alloy-sol-macro-expander = { version = "=0.8.13", default-features = false } +alloy-sol-macro-input = { version = "=0.8.13", default-features = false } const-hex = { version = "1.11.1", default-features = false } eyre = "0.6.8" diff --git a/examples/erc1155/src/constructor.sol b/examples/erc1155/src/constructor.sol index 08dd31f1a..cfb15ceb0 100644 --- a/examples/erc1155/src/constructor.sol +++ b/examples/erc1155/src/constructor.sol @@ -4,9 +4,9 @@ pragma solidity ^0.8.24; contract Erc1155Example { mapping(address => mapping(uint256 => uint256)) private _balanceOf; mapping(address => mapping(address => bool)) private _isApprovedForAll; - + string private _uri; - + constructor(string memory uri_) { _uri = uri_; } From ddef560cbb5307529d21c5536392bf1417136d71 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Fri, 29 Nov 2024 18:30:06 +0100 Subject: [PATCH 02/25] fix: move const value in AccessControl (cherry picked from commit 0cab5f9063c101611b6bfd7b5bd14489ebd35db8) --- contracts/src/access/control.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/src/access/control.rs b/contracts/src/access/control.rs index 1ef997353..c4895ba1e 100644 --- a/contracts/src/access/control.rs +++ b/contracts/src/access/control.rs @@ -116,9 +116,6 @@ sol_storage! { #[public] impl AccessControl { - /// The default admin role. `[0; 32]` by default. - pub const DEFAULT_ADMIN_ROLE: [u8; 32] = [0; 32]; - /// Returns `true` if `account` has been granted `role`. /// /// # Arguments @@ -270,6 +267,9 @@ impl AccessControl { } impl AccessControl { + /// The default admin role. `[0; 32]` by default. + pub const DEFAULT_ADMIN_ROLE: [u8; 32] = [0; 32]; + /// Sets `admin_role` as `role`'s admin role. /// /// # Arguments From 1d27f6cfeefe42e6415e4f8b37b35a95b2f1659e Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Mon, 2 Dec 2024 17:56:23 +0100 Subject: [PATCH 03/25] ref: move interfaces to base modules (cherry picked from commit e84084857ac7af4ae3be599e7ab7e14a6faa55f9) --- contracts/src/finance/vesting_wallet.rs | 15 +++---- contracts/src/token/erc1155/mod.rs | 59 +++++++++++++++++++++++-- contracts/src/token/erc1155/receiver.rs | 59 ------------------------- contracts/src/token/erc721/mod.rs | 42 +++++++++--------- 4 files changed, 82 insertions(+), 93 deletions(-) delete mode 100644 contracts/src/token/erc1155/receiver.rs diff --git a/contracts/src/finance/vesting_wallet.rs b/contracts/src/finance/vesting_wallet.rs index 24b0e2a89..6fd5ce987 100644 --- a/contracts/src/finance/vesting_wallet.rs +++ b/contracts/src/finance/vesting_wallet.rs @@ -30,7 +30,7 @@ use stylus_sdk::{ call::{self, call, Call}, contract, evm, function_selector, storage::TopLevelStorage, - stylus_proc::{public, sol_storage, SolidityError}, + stylus_proc::{public, sol_interface, sol_storage, SolidityError}, }; use crate::{ @@ -80,14 +80,11 @@ pub enum Error { InvalidToken(InvalidToken), } -pub use token::IErc20; -#[allow(missing_docs)] -mod token { - stylus_sdk::stylus_proc::sol_interface! { - /// Interface of the ERC-20 token. - interface IErc20 { - function balanceOf(address account) external view returns (uint256); - } +sol_interface! { + /// Interface of the ERC-20 token. + #[allow(missing_docs)] + interface IErc20 { + function balanceOf(address account) external view returns (uint256); } } diff --git a/contracts/src/token/erc1155/mod.rs b/contracts/src/token/erc1155/mod.rs index 1bd927744..ba7df6f09 100644 --- a/contracts/src/token/erc1155/mod.rs +++ b/contracts/src/token/erc1155/mod.rs @@ -10,6 +10,7 @@ use stylus_sdk::{ evm, function_selector, msg, prelude::{public, sol_storage, AddressVM, SolidityError}, storage::TopLevelStorage, + stylus_proc::sol_interface, }; use crate::utils::{ @@ -19,9 +20,6 @@ use crate::utils::{ pub mod extensions; -mod receiver; -pub use receiver::IERC1155Receiver; - const SINGLE_TRANSFER_FN_SELECTOR: [u8; 4] = function_selector!( "onERC1155Received", Address, @@ -179,6 +177,61 @@ impl MethodError for Error { } } +sol_interface! { + /// Interface that must be implemented by smart contracts + /// in order to receive ERC-1155 token transfers. + #[allow(missing_docs)] + interface IERC1155Receiver { + /// Handles the receipt of a single ERC-1155 token type. + /// This function is called at the end of a + /// [`IErc1155::safe_batch_transfer_from`] + /// after the balance has been updated. + /// + /// NOTE: To accept the transfer, + /// this must return [`SINGLE_TRANSFER_FN_SELECTOR`], + /// or its own function selector. + /// + /// * `operator` - The address which initiated the transfer. + /// * `from` - The address which previously owned the token. + /// * `id` - The ID of the token being transferred. + /// * `value` - The amount of tokens being transferred. + /// * `data` - Additional data with no specified format. + #[allow(missing_docs)] + function onERC1155Received( + address operator, + address from, + uint256 id, + uint256 value, + bytes calldata data + ) external returns (bytes4); + + /// Handles the receipt of multiple ERC-1155 token types. + /// This function is called at the end of a + /// [`IErc1155::safe_batch_transfer_from`] + /// after the balances have been updated. + /// + /// NOTE: To accept the transfer(s), + /// this must return [`BATCH_TRANSFER_FN_SELECTOR`], + /// or its own function selector. + /// + /// * `operator` - The address which initiated the batch transfer. + /// * `from` - The address which previously owned the token. + /// * `ids` - An array containing ids of each token being transferred + /// (order and length must match values array). + /// * `values` - An array containing amounts of each token + /// being transferred (order and length must match ids array). + /// * `data` - Additional data with no specified format. + #[allow(missing_docs)] + function onERC1155BatchReceived( + address operator, + address from, + uint256[] calldata ids, + uint256[] calldata values, + bytes calldata data + ) external returns (bytes4); + } +} + sol_storage! { /// State of an [`Erc1155`] token. pub struct Erc1155 { diff --git a/contracts/src/token/erc1155/receiver.rs b/contracts/src/token/erc1155/receiver.rs deleted file mode 100644 index 49da4798f..000000000 --- a/contracts/src/token/erc1155/receiver.rs +++ /dev/null @@ -1,59 +0,0 @@ -#![allow(missing_docs)] -//! Module with an interface required for smart contract -//! in order to receive ERC-1155 token transfers. - -use stylus_sdk::stylus_proc::sol_interface; - -sol_interface! { - /// Interface that must be implemented by smart contracts - /// in order to receive ERC-1155 token transfers. - interface IERC1155Receiver { - /// Handles the receipt of a single ERC-1155 token type. - /// This function is called at the end of a - /// [`IErc1155::safe_batch_transfer_from`] - /// after the balance has been updated. - /// - /// NOTE: To accept the transfer, - /// this must return [`SINGLE_TRANSFER_FN_SELECTOR`], - /// or its own function selector. - /// - /// * `operator` - The address which initiated the transfer. - /// * `from` - The address which previously owned the token. - /// * `id` - The ID of the token being transferred. - /// * `value` - The amount of tokens being transferred. - /// * `data` - Additional data with no specified format. - #[allow(missing_docs)] - function onERC1155Received( - address operator, - address from, - uint256 id, - uint256 value, - bytes calldata data - ) external returns (bytes4); - - /// Handles the receipt of multiple ERC-1155 token types. - /// This function is called at the end of a - /// [`IErc1155::safe_batch_transfer_from`] - /// after the balances have been updated. - /// - /// NOTE: To accept the transfer(s), - /// this must return [`BATCH_TRANSFER_FN_SELECTOR`], - /// or its own function selector. - /// - /// * `operator` - The address which initiated the batch transfer. - /// * `from` - The address which previously owned the token. - /// * `ids` - An array containing ids of each token being transferred - /// (order and length must match values array). - /// * `values` - An array containing amounts of each token - /// being transferred (order and length must match ids array). - /// * `data` - Additional data with no specified format. - #[allow(missing_docs)] - function onERC1155BatchReceived( - address operator, - address from, - uint256[] calldata ids, - uint256[] calldata values, - bytes calldata data - ) external returns (bytes4); - } -} diff --git a/contracts/src/token/erc721/mod.rs b/contracts/src/token/erc721/mod.rs index 5f6fb886d..1a3fe8e4f 100644 --- a/contracts/src/token/erc721/mod.rs +++ b/contracts/src/token/erc721/mod.rs @@ -9,6 +9,7 @@ use stylus_sdk::{ call::{self, Call, MethodError}, evm, msg, prelude::*, + stylus_proc::sol_interface, }; use crate::utils::{ @@ -160,29 +161,26 @@ impl MethodError for Error { } } -pub use receiver::IERC721Receiver; -#[allow(missing_docs)] -mod receiver { - stylus_sdk::stylus_proc::sol_interface! { - /// [`Erc721`] token receiver interface. +sol_interface! { + /// [`Erc721`] token receiver interface. + /// + /// Interface for any contract that wants to support `safe_transfers` + /// from [`Erc721`] asset contracts. + #[allow(missing_docs)] + interface IERC721Receiver { + /// Whenever an [`Erc721`] `token_id` token is transferred + /// to this contract via [`Erc721::safe_transfer_from`]. /// - /// Interface for any contract that wants to support `safe_transfers` - /// from [`Erc721`] asset contracts. - interface IERC721Receiver { - /// Whenever an [`Erc721`] `token_id` token is transferred - /// to this contract via [`Erc721::safe_transfer_from`]. - /// - /// It must return its function selector to confirm the token transfer. - /// If any other value is returned or the interface is not implemented - /// by the recipient, the transfer will be reverted. - #[allow(missing_docs)] - function onERC721Received( - address operator, - address from, - uint256 token_id, - bytes calldata data - ) external returns (bytes4); - } + /// It must return its function selector to confirm the token transfer. + /// If any other value is returned or the interface is not implemented + /// by the recipient, the transfer will be reverted. + #[allow(missing_docs)] + function onERC721Received( + address operator, + address from, + uint256 token_id, + bytes calldata data + ) external returns (bytes4); } } From c3cc640c02b7f497fca8c3d5e8329328505a79dc Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Mon, 2 Dec 2024 18:01:59 +0100 Subject: [PATCH 04/25] ref: fix AccessControl example (cherry picked from commit 431b7063d87e1e86581feaf397ed81420cc04eb9) --- examples/access-control/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/access-control/src/lib.rs b/examples/access-control/src/lib.rs index 0b4590d1f..af489be33 100644 --- a/examples/access-control/src/lib.rs +++ b/examples/access-control/src/lib.rs @@ -29,8 +29,6 @@ pub const TRANSFER_ROLE: [u8; 32] = [ #[public] #[inherit(Erc20, AccessControl)] impl AccessControlExample { - pub const TRANSFER_ROLE: [u8; 32] = TRANSFER_ROLE; - pub fn make_admin(&mut self, account: Address) -> Result<(), Vec> { self.access.only_role(AccessControl::DEFAULT_ADMIN_ROLE.into())?; self.access @@ -55,3 +53,7 @@ impl AccessControlExample { self.access._set_role_admin(role, new_admin_role) } } + +impl AccessControlExample { + pub const TRANSFER_ROLE: [u8; 32] = TRANSFER_ROLE; +} From e0e71ba87b11e334835a7fc5d5bcfafdd1f3015b Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Mon, 2 Dec 2024 18:12:34 +0100 Subject: [PATCH 05/25] fix: add missing Vec imports (cherry picked from commit f921f1be673c48d4a993029d9f49145de715756d) --- contracts/src/access/control.rs | 2 ++ contracts/src/access/ownable.rs | 2 ++ contracts/src/access/ownable_two_step.rs | 2 ++ contracts/src/finance/vesting_wallet.rs | 2 ++ contracts/src/token/erc20/extensions/capped.rs | 3 ++- contracts/src/token/erc20/extensions/metadata.rs | 3 ++- contracts/src/token/erc20/extensions/permit.rs | 2 ++ contracts/src/token/erc20/mod.rs | 2 ++ contracts/src/token/erc20/utils/safe_erc20.rs | 2 ++ contracts/src/token/erc721/extensions/consecutive.rs | 2 +- contracts/src/token/erc721/extensions/enumerable.rs | 3 ++- contracts/src/token/erc721/extensions/metadata.rs | 5 ++++- contracts/src/token/erc721/mod.rs | 3 ++- contracts/src/utils/metadata.rs | 3 +-- contracts/src/utils/nonces.rs | 2 ++ contracts/src/utils/pausable.rs | 2 ++ 16 files changed, 32 insertions(+), 8 deletions(-) diff --git a/contracts/src/access/control.rs b/contracts/src/access/control.rs index c4895ba1e..53515c556 100644 --- a/contracts/src/access/control.rs +++ b/contracts/src/access/control.rs @@ -40,6 +40,8 @@ //! accounts that have been granted it. We recommend using //! `AccessControlDefaultAdminRules` to enforce additional security measures for //! this role. +use alloc::vec::Vec; + use alloy_primitives::{Address, B256}; use alloy_sol_types::sol; use stylus_sdk::{ diff --git a/contracts/src/access/ownable.rs b/contracts/src/access/ownable.rs index 50692973f..89fa892d9 100644 --- a/contracts/src/access/ownable.rs +++ b/contracts/src/access/ownable.rs @@ -8,6 +8,8 @@ //! This module is used through inheritance. It will make available the //! [`Ownable::only_owner`] function, which can be called to restrict operations //! to the owner. +use alloc::vec::Vec; + use alloy_primitives::Address; use alloy_sol_types::sol; use openzeppelin_stylus_proc::interface_id; diff --git a/contracts/src/access/ownable_two_step.rs b/contracts/src/access/ownable_two_step.rs index f5d9a2be1..f244c0dee 100644 --- a/contracts/src/access/ownable_two_step.rs +++ b/contracts/src/access/ownable_two_step.rs @@ -16,6 +16,8 @@ //! This module uses [`Ownable`] as a member, and makes all its public functions //! available. +use alloc::vec::Vec; + use alloy_primitives::Address; use alloy_sol_types::sol; use stylus_sdk::{ diff --git a/contracts/src/finance/vesting_wallet.rs b/contracts/src/finance/vesting_wallet.rs index 6fd5ce987..a1b442425 100644 --- a/contracts/src/finance/vesting_wallet.rs +++ b/contracts/src/finance/vesting_wallet.rs @@ -22,6 +22,8 @@ //! adjustment in the vesting schedule to ensure the vested amount is as //! intended. +use alloc::{vec, vec::Vec}; + use alloy_primitives::{Address, U256, U64}; use alloy_sol_types::sol; use openzeppelin_stylus_proc::interface_id; diff --git a/contracts/src/token/erc20/extensions/capped.rs b/contracts/src/token/erc20/extensions/capped.rs index a971900b5..c4b9ad341 100644 --- a/contracts/src/token/erc20/extensions/capped.rs +++ b/contracts/src/token/erc20/extensions/capped.rs @@ -5,10 +5,11 @@ //! Note that they will not be capped by simply including this module, //! but only once the checks are put in place. +use alloc::vec::Vec; + use alloy_primitives::U256; use alloy_sol_types::sol; use stylus_sdk::stylus_proc::{public, sol_storage, SolidityError}; - sol! { /// Indicates an error related to the operation that failed /// because `total_supply` exceeded the `_cap`. diff --git a/contracts/src/token/erc20/extensions/metadata.rs b/contracts/src/token/erc20/extensions/metadata.rs index 6cc10141f..a333d3865 100644 --- a/contracts/src/token/erc20/extensions/metadata.rs +++ b/contracts/src/token/erc20/extensions/metadata.rs @@ -11,8 +11,9 @@ use crate::utils::introspection::erc165::IErc165; /// Number of decimals used by default on implementors of [`Metadata`]. pub const DEFAULT_DECIMALS: u8 = 18; -use crate::utils::Metadata; +use alloc::vec::Vec; +use crate::utils::Metadata; sol_storage! { /// Metadata of the [`super::super::Erc20`] token. /// diff --git a/contracts/src/token/erc20/extensions/permit.rs b/contracts/src/token/erc20/extensions/permit.rs index 1b58e948d..311b5d7c7 100644 --- a/contracts/src/token/erc20/extensions/permit.rs +++ b/contracts/src/token/erc20/extensions/permit.rs @@ -9,6 +9,8 @@ //! By not relying on [`crate::token::erc20::IErc20::approve`], //! the token holder account doesn’t need to send a transaction, //! and thus is not required to hold Ether at all. +use alloc::vec::Vec; + use alloy_primitives::{b256, keccak256, Address, B256, U256}; use alloy_sol_types::{sol, SolType}; use stylus_sdk::{ diff --git a/contracts/src/token/erc20/mod.rs b/contracts/src/token/erc20/mod.rs index 91399f425..d0f51c421 100644 --- a/contracts/src/token/erc20/mod.rs +++ b/contracts/src/token/erc20/mod.rs @@ -4,6 +4,8 @@ //! revert instead of returning `false` on failure. This behavior is //! nonetheless conventional and does not conflict with the expectations of //! [`Erc20`] applications. +use alloc::vec::Vec; + use alloy_primitives::{Address, FixedBytes, U256}; use alloy_sol_types::sol; use openzeppelin_stylus_proc::interface_id; diff --git a/contracts/src/token/erc20/utils/safe_erc20.rs b/contracts/src/token/erc20/utils/safe_erc20.rs index 28115e227..ba3f7bfe8 100644 --- a/contracts/src/token/erc20/utils/safe_erc20.rs +++ b/contracts/src/token/erc20/utils/safe_erc20.rs @@ -7,6 +7,8 @@ //! your contract, which allows you to call the safe operations as //! `contract.safe_transfer(token_addr, ...)`, etc. +use alloc::vec::Vec; + use alloy_primitives::{Address, U256}; use alloy_sol_types::{sol, SolCall}; use stylus_sdk::{ diff --git a/contracts/src/token/erc721/extensions/consecutive.rs b/contracts/src/token/erc721/extensions/consecutive.rs index 302cb56f4..1f793802b 100644 --- a/contracts/src/token/erc721/extensions/consecutive.rs +++ b/contracts/src/token/erc721/extensions/consecutive.rs @@ -22,7 +22,7 @@ //! restriction on the [`Erc721Consecutive::_update`] function call since it is //! not possible to call a Rust function from the Solidity constructor. -use alloc::vec; +use alloc::{vec, vec::Vec}; use alloy_primitives::{uint, Address, U256}; use alloy_sol_types::sol; diff --git a/contracts/src/token/erc721/extensions/enumerable.rs b/contracts/src/token/erc721/extensions/enumerable.rs index f35bc97c0..70e60bbaf 100644 --- a/contracts/src/token/erc721/extensions/enumerable.rs +++ b/contracts/src/token/erc721/extensions/enumerable.rs @@ -9,6 +9,8 @@ //! interfere with enumerability and should not be used together with //! [`Erc721Enumerable`]. +use alloc::vec::Vec; + use alloy_primitives::{uint, Address, FixedBytes, U256}; use alloy_sol_types::sol; use openzeppelin_stylus_proc::interface_id; @@ -18,7 +20,6 @@ use crate::{ token::{erc721, erc721::IErc721}, utils::introspection::erc165::IErc165, }; - sol! { /// Indicates an error when an `owner`'s token query /// was out of bounds for `index`. diff --git a/contracts/src/token/erc721/extensions/metadata.rs b/contracts/src/token/erc721/extensions/metadata.rs index c1e95e078..d37c83371 100644 --- a/contracts/src/token/erc721/extensions/metadata.rs +++ b/contracts/src/token/erc721/extensions/metadata.rs @@ -1,6 +1,9 @@ //! Optional Metadata of the ERC-721 standard. -use alloc::string::{String, ToString}; +use alloc::{ + string::{String, ToString}, + vec::Vec, +}; use alloy_primitives::{FixedBytes, U256}; use openzeppelin_stylus_proc::interface_id; diff --git a/contracts/src/token/erc721/mod.rs b/contracts/src/token/erc721/mod.rs index 1a3fe8e4f..527c3716d 100644 --- a/contracts/src/token/erc721/mod.rs +++ b/contracts/src/token/erc721/mod.rs @@ -1,5 +1,4 @@ //! Implementation of the [`Erc721`] token standard. -use alloc::vec; use alloy_primitives::{fixed_bytes, uint, Address, FixedBytes, U128, U256}; use openzeppelin_stylus_proc::interface_id; @@ -19,6 +18,8 @@ use crate::utils::{ pub mod extensions; +use alloc::{vec, vec::Vec}; + sol! { /// Emitted when the `token_id` token is transferred from `from` to `to`. /// diff --git a/contracts/src/utils/metadata.rs b/contracts/src/utils/metadata.rs index 7d904dbb0..b4410d12c 100644 --- a/contracts/src/utils/metadata.rs +++ b/contracts/src/utils/metadata.rs @@ -1,8 +1,7 @@ //! Common Metadata Smart Contract. -use alloc::string::String; +use alloc::{string::String, vec, vec::Vec}; use stylus_sdk::stylus_proc::{public, sol_storage}; - sol_storage! { /// Metadata of the token. pub struct Metadata { diff --git a/contracts/src/utils/nonces.rs b/contracts/src/utils/nonces.rs index 13678fcc3..0e55134f5 100644 --- a/contracts/src/utils/nonces.rs +++ b/contracts/src/utils/nonces.rs @@ -2,6 +2,8 @@ //! //! Nonces will only increment. +use alloc::vec::Vec; + use alloy_primitives::{uint, Address, U256}; use alloy_sol_types::sol; use stylus_sdk::stylus_proc::{public, sol_storage, SolidityError}; diff --git a/contracts/src/utils/pausable.rs b/contracts/src/utils/pausable.rs index 1a2ed5ae9..d072c3a38 100644 --- a/contracts/src/utils/pausable.rs +++ b/contracts/src/utils/pausable.rs @@ -14,6 +14,8 @@ //! exposed by default. //! You should expose them manually in your contract's abi. +use alloc::vec::Vec; + use alloy_sol_types::sol; use stylus_sdk::{ evm, msg, From b24bcdf4e869a3794ea3142cff637f3d523baa82 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Wed, 4 Dec 2024 16:36:58 +0100 Subject: [PATCH 06/25] build: use koba with updated alloy --- Cargo.lock | 758 +++++++++++------------------------------------------ Cargo.toml | 2 +- 2 files changed, 160 insertions(+), 600 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 95c68d77a..3119e815c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,8 +6,8 @@ version = 4 name = "access-control-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -80,48 +80,26 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "alloy" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" -dependencies = [ - "alloy-consensus 0.1.3", - "alloy-contract 0.1.3", - "alloy-core 0.7.6", - "alloy-eips 0.1.3", - "alloy-genesis 0.1.3", - "alloy-network 0.1.3", - "alloy-provider 0.1.3", - "alloy-rpc-client 0.1.3", - "alloy-rpc-types 0.1.3", - "alloy-serde 0.1.3", - "alloy-signer 0.1.3", - "alloy-signer-local 0.1.3", - "alloy-transport 0.1.3", - "alloy-transport-http 0.1.3", -] - [[package]] name = "alloy" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44ab65cb6104c389b46df77b7990cab08780f57e41b412b46d6d12baf7e8c716" dependencies = [ - "alloy-consensus 0.7.0", - "alloy-contract 0.7.0", - "alloy-core 0.8.13", - "alloy-eips 0.7.0", - "alloy-genesis 0.7.0", - "alloy-network 0.7.0", - "alloy-provider 0.7.0", - "alloy-rpc-client 0.7.0", - "alloy-rpc-types 0.7.0", - "alloy-serde 0.7.0", - "alloy-signer 0.7.0", - "alloy-signer-local 0.7.0", - "alloy-transport 0.7.0", - "alloy-transport-http 0.7.0", + "alloy-consensus", + "alloy-contract", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", + "alloy-transport", + "alloy-transport-http", ] [[package]] @@ -134,34 +112,20 @@ dependencies = [ "strum", ] -[[package]] -name = "alloy-consensus" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f63a6c9eb45684a5468536bc55379a2af0f45ffa5d756e4e4964532737e1836" -dependencies = [ - "alloy-eips 0.1.3", - "alloy-primitives 0.7.6", - "alloy-rlp", - "alloy-serde 0.1.3", - "c-kzg", - "serde", -] - [[package]] name = "alloy-consensus" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a1ff8439834ab71a4b0ecd1a8ff80b3921c87615f158940c3364f399c732786" dependencies = [ - "alloy-eips 0.7.0", - "alloy-primitives 0.8.13", + "alloy-eips", + "alloy-primitives", "alloy-rlp", - "alloy-serde 0.7.0", + "alloy-serde", "alloy-trie", "auto_impl", "c-kzg", - "derive_more 1.0.0", + "derive_more", "serde", ] @@ -171,93 +135,45 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "519a86faaa6729464365a90c04eba68539b6d3a30f426edb4b3dafd78920d42f" dependencies = [ - "alloy-consensus 0.7.0", - "alloy-eips 0.7.0", - "alloy-primitives 0.8.13", + "alloy-consensus", + "alloy-eips", + "alloy-primitives", "alloy-rlp", - "alloy-serde 0.7.0", + "alloy-serde", "serde", ] -[[package]] -name = "alloy-contract" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c26b7d34cb76f826558e9409a010e25257f7bfb5aa5e3dd0042c564664ae159" -dependencies = [ - "alloy-dyn-abi 0.7.6", - "alloy-json-abi 0.7.6", - "alloy-network 0.1.3", - "alloy-primitives 0.7.6", - "alloy-provider 0.1.3", - "alloy-rpc-types-eth 0.1.3", - "alloy-sol-types 0.7.6", - "alloy-transport 0.1.3", - "futures", - "futures-util", - "thiserror", -] - [[package]] name = "alloy-contract" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca2b353d8b7f160dc930dfa174557acefece6deab5ecd7e6230d38858579eea" dependencies = [ - "alloy-dyn-abi 0.8.13", - "alloy-json-abi 0.8.13", - "alloy-network 0.7.0", + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.13", - "alloy-provider 0.7.0", - "alloy-rpc-types-eth 0.7.0", - "alloy-sol-types 0.8.13", - "alloy-transport 0.7.0", + "alloy-primitives", + "alloy-provider", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport", "futures", "futures-util", "thiserror", ] -[[package]] -name = "alloy-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af3faff14c12c8b11037e0a093dd157c3702becb8435577a2408534d0758315" -dependencies = [ - "alloy-dyn-abi 0.7.6", - "alloy-json-abi 0.7.6", - "alloy-primitives 0.7.6", - "alloy-sol-types 0.7.6", -] - [[package]] name = "alloy-core" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d22df68fa7d9744be0b1a9be3260e9aa089fbf41903ab182328333061ed186" dependencies = [ - "alloy-dyn-abi 0.8.13", - "alloy-json-abi 0.8.13", - "alloy-primitives 0.8.13", + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", "alloy-rlp", - "alloy-sol-types 0.8.13", -] - -[[package]] -name = "alloy-dyn-abi" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" -dependencies = [ - "alloy-json-abi 0.7.6", - "alloy-primitives 0.7.6", - "alloy-sol-type-parser 0.7.6", - "alloy-sol-types 0.7.6", - "const-hex", - "itoa", - "serde", - "serde_json", - "winnow 0.6.13", + "alloy-sol-types", ] [[package]] @@ -266,10 +182,10 @@ version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cf633ae9a1f0c82fdb9e559ed2be1c8e415c3e48fc47e1feaf32c6078ec0cdd" dependencies = [ - "alloy-json-abi 0.8.13", - "alloy-primitives 0.8.13", - "alloy-sol-type-parser 0.8.14", - "alloy-sol-types 0.8.13", + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", "const-hex", "itoa", "serde", @@ -283,7 +199,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.8.13", + "alloy-primitives", "alloy-rlp", "serde", ] @@ -294,25 +210,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-rlp", - "derive_more 1.0.0", - "serde", -] - -[[package]] -name = "alloy-eips" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4b0fc6a572ef2eebda0a31a5e393d451abda703fec917c75d9615d8c978cf2" -dependencies = [ - "alloy-primitives 0.7.6", + "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.3", - "c-kzg", - "once_cell", + "derive_more", "serde", - "sha2", ] [[package]] @@ -323,73 +224,37 @@ checksum = "8dedb328c2114284f767e075589ca9de8d5e9c8a91333402f4804a584ed71a38" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives 0.8.13", + "alloy-primitives", "alloy-rlp", - "alloy-serde 0.7.0", + "alloy-serde", "c-kzg", - "derive_more 1.0.0", + "derive_more", "once_cell", "serde", "sha2", ] -[[package]] -name = "alloy-genesis" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48450f9c6f0821c1eee00ed912942492ed4f11dd69532825833de23ecc7a2256" -dependencies = [ - "alloy-primitives 0.7.6", - "alloy-serde 0.1.3", - "serde", -] - [[package]] name = "alloy-genesis" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4841e8dd4e0f53d76b501fd4c6bc21d95d688bc8ebf0ea359fc6c7ab65b48742" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-serde 0.7.0", + "alloy-primitives", + "alloy-serde", "serde", ] -[[package]] -name = "alloy-json-abi" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaeaccd50238126e3a0ff9387c7c568837726ad4f4e399b528ca88104d6c25ef" -dependencies = [ - "alloy-primitives 0.7.6", - "alloy-sol-type-parser 0.7.6", - "serde", - "serde_json", -] - [[package]] name = "alloy-json-abi" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-type-parser 0.8.14", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-json-rpc" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d484c2a934d0a4d86f8ad4db8113cb1d607707a6c54f6e78f4f1b4451b47aa70" -dependencies = [ - "alloy-primitives 0.7.6", + "alloy-primitives", + "alloy-sol-type-parser", "serde", "serde_json", - "thiserror", - "tracing", ] [[package]] @@ -398,51 +263,31 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "254f770918f96dc4ec88a15e6e2e243358e1719d66b40ef814428e7697079d25" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-types", "serde", "serde_json", "thiserror", "tracing", ] -[[package]] -name = "alloy-network" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a20eba9bc551037f0626d6d29e191888638d979943fa4e842e9e6fc72bf0565" -dependencies = [ - "alloy-consensus 0.1.3", - "alloy-eips 0.1.3", - "alloy-json-rpc 0.1.3", - "alloy-primitives 0.7.6", - "alloy-rpc-types-eth 0.1.3", - "alloy-serde 0.1.3", - "alloy-signer 0.1.3", - "alloy-sol-types 0.7.6", - "async-trait", - "auto_impl", - "futures-utils-wasm", - "thiserror", -] - [[package]] name = "alloy-network" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "931dd176c6e33355f3dc0170ec69cf5b951f4d73870b276e2c837ab35f9c5136" dependencies = [ - "alloy-consensus 0.7.0", + "alloy-consensus", "alloy-consensus-any", - "alloy-eips 0.7.0", - "alloy-json-rpc 0.7.0", + "alloy-eips", + "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives 0.8.13", + "alloy-primitives", "alloy-rpc-types-any", - "alloy-rpc-types-eth 0.7.0", - "alloy-serde 0.7.0", - "alloy-signer 0.7.0", - "alloy-sol-types 0.8.13", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", "async-trait", "auto_impl", "futures-utils-wasm", @@ -457,34 +302,11 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa6ec0f23be233e851e31c5e4badfedfa9c7bc177bc37f4e03616072cd40a806" dependencies = [ - "alloy-consensus 0.7.0", - "alloy-eips 0.7.0", - "alloy-primitives 0.8.13", - "alloy-serde 0.7.0", - "serde", -] - -[[package]] -name = "alloy-primitives" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more 0.99.18", - "getrandom", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", "serde", - "tiny-keccak", ] [[package]] @@ -499,7 +321,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more 1.0.0", + "derive_more", "foldhash", "getrandom", "hashbrown 0.15.2", @@ -519,38 +341,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "alloy-provider" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5d89acb7339fad13bc69e7b925232f242835bfd91c82fcb9326b36481bd0f0" -dependencies = [ - "alloy-chains", - "alloy-consensus 0.1.3", - "alloy-eips 0.1.3", - "alloy-json-rpc 0.1.3", - "alloy-network 0.1.3", - "alloy-primitives 0.7.6", - "alloy-rpc-client 0.1.3", - "alloy-rpc-types-eth 0.1.3", - "alloy-transport 0.1.3", - "alloy-transport-http 0.1.3", - "async-stream", - "async-trait", - "auto_impl", - "dashmap 5.5.3", - "futures", - "futures-utils-wasm", - "lru", - "pin-project", - "reqwest", - "serde", - "serde_json", - "tokio", - "tracing", - "url", -] - [[package]] name = "alloy-provider" version = "0.7.0" @@ -558,16 +348,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5545e2cbf2f8f24c68bb887ba0294fa12a2f816b9e72c4f226cd137b77d0e294" dependencies = [ "alloy-chains", - "alloy-consensus 0.7.0", - "alloy-eips 0.7.0", - "alloy-json-rpc 0.7.0", - "alloy-network 0.7.0", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.13", - "alloy-rpc-client 0.7.0", - "alloy-rpc-types-eth 0.7.0", - "alloy-transport 0.7.0", - "alloy-transport-http 0.7.0", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-transport", + "alloy-transport-http", "async-stream", "async-trait", "auto_impl", @@ -610,37 +400,16 @@ dependencies = [ "syn 2.0.89", ] -[[package]] -name = "alloy-rpc-client" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ce003e8c74bbbc7d4235131c1d6b7eaf14a533ae850295b90d240340989cb" -dependencies = [ - "alloy-json-rpc 0.1.3", - "alloy-transport 0.1.3", - "alloy-transport-http 0.1.3", - "futures", - "pin-project", - "reqwest", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tracing", - "url", -] - [[package]] name = "alloy-rpc-client" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aed9e40c2a73265ebf70f1e48303ee55920282e1ea5971e832873fb2d32cea74" dependencies = [ - "alloy-json-rpc 0.7.0", - "alloy-primitives 0.8.13", - "alloy-transport 0.7.0", - "alloy-transport-http 0.7.0", + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "alloy-transport-http", "futures", "pin-project", "reqwest", @@ -654,25 +423,15 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "alloy-rpc-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dfa1dd3e0bc3a3d89744fba8d1511216e83257160da2cd028a18b7d9c026030" -dependencies = [ - "alloy-rpc-types-eth 0.1.3", - "alloy-serde 0.1.3", -] - [[package]] name = "alloy-rpc-types" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42dea20fa715a6f39ec7adc735cfd9567342870737270ac67795d55896527772" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-rpc-types-eth 0.7.0", - "alloy-serde 0.7.0", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", "serde", ] @@ -682,28 +441,10 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79d7620e22d6ed7c58451dd303d0501ade5a8bec9dc8daef0fbc48ceffabbae1" dependencies = [ - "alloy-consensus 0.7.0", + "alloy-consensus", "alloy-consensus-any", - "alloy-rpc-types-eth 0.7.0", - "alloy-serde 0.7.0", -] - -[[package]] -name = "alloy-rpc-types-eth" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd7aa9ff9e67f1ba7ee0dd8cebfc95831d1649b0e4eeefae940dc3681079fa" -dependencies = [ - "alloy-consensus 0.1.3", - "alloy-eips 0.1.3", - "alloy-primitives 0.7.6", - "alloy-rlp", - "alloy-serde 0.1.3", - "alloy-sol-types 0.7.6", - "itertools 0.13.0", - "serde", - "serde_json", - "thiserror", + "alloy-rpc-types-eth", + "alloy-serde", ] [[package]] @@ -712,63 +453,38 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df34b88df4deeac9ecfc80ad7cbb26a33e57437b9db8be5b952792feef6134bc" dependencies = [ - "alloy-consensus 0.7.0", + "alloy-consensus", "alloy-consensus-any", - "alloy-eips 0.7.0", + "alloy-eips", "alloy-network-primitives", - "alloy-primitives 0.8.13", + "alloy-primitives", "alloy-rlp", - "alloy-serde 0.7.0", - "alloy-sol-types 0.8.13", - "derive_more 1.0.0", + "alloy-serde", + "alloy-sol-types", + "derive_more", "itertools 0.13.0", "serde", "serde_json", ] -[[package]] -name = "alloy-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8913f9e825068d77c516188c221c44f78fd814fce8effe550a783295a2757d19" -dependencies = [ - "alloy-primitives 0.7.6", - "serde", - "serde_json", -] - [[package]] name = "alloy-serde" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a89fd4cc3f96b3c5c0dd1cebeb63323e4659bbdc837117fa3fd5ac168df7d9" dependencies = [ - "alloy-primitives 0.8.13", + "alloy-primitives", "serde", "serde_json", ] -[[package]] -name = "alloy-signer" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f740e13eb4c6a0e4d0e49738f1e86f31ad2d7ef93be499539f492805000f7237" -dependencies = [ - "alloy-primitives 0.7.6", - "async-trait", - "auto_impl", - "elliptic-curve", - "k256", - "thiserror", -] - [[package]] name = "alloy-signer" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "532010243a96d1f8593c2246ec3971bc52303884fa1e43ca0a776798ba178910" dependencies = [ - "alloy-primitives 0.8.13", + "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", @@ -776,95 +492,45 @@ dependencies = [ "thiserror", ] -[[package]] -name = "alloy-signer-local" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87db68d926887393a1d0f9c43833b44446ea29d603291e7b20e5d115f31aa4e3" -dependencies = [ - "alloy-consensus 0.1.3", - "alloy-network 0.1.3", - "alloy-primitives 0.7.6", - "alloy-signer 0.1.3", - "async-trait", - "elliptic-curve", - "eth-keystore", - "k256", - "rand", - "thiserror", -] - [[package]] name = "alloy-signer-local" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8080c0ab2dc729b0cbb183843d08e78d2a1629140c9fc16234d2272abb483bd" dependencies = [ - "alloy-consensus 0.7.0", - "alloy-network 0.7.0", - "alloy-primitives 0.8.13", - "alloy-signer 0.7.0", + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", "async-trait", + "eth-keystore", "k256", "rand", "thiserror", ] -[[package]] -name = "alloy-sol-macro" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" -dependencies = [ - "alloy-sol-macro-expander 0.7.6", - "alloy-sol-macro-input 0.7.6", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "alloy-sol-macro" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c0279d09463a4695788a3622fd95443625f7be307422deba4b55dd491a9c7a1" dependencies = [ - "alloy-sol-macro-expander 0.8.13", - "alloy-sol-macro-input 0.8.13", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.89", ] -[[package]] -name = "alloy-sol-macro-expander" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" -dependencies = [ - "alloy-json-abi 0.7.6", - "alloy-sol-macro-input 0.7.6", - "const-hex", - "heck", - "indexmap 2.6.0", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.89", - "syn-solidity 0.7.6", - "tiny-keccak", -] - [[package]] name = "alloy-sol-macro-expander" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4feea540fc8233df2ad1156efd744b2075372f43a8f942a68b3b19c8a00e2c12" dependencies = [ - "alloy-json-abi 0.8.13", - "alloy-sol-macro-input 0.8.13", + "alloy-json-abi", + "alloy-sol-macro-input", "const-hex", "heck", "indexmap 2.6.0", @@ -872,34 +538,17 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.89", - "syn-solidity 0.8.14", + "syn-solidity", "tiny-keccak", ] -[[package]] -name = "alloy-sol-macro-input" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" -dependencies = [ - "alloy-json-abi 0.7.6", - "const-hex", - "dunce", - "heck", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.89", - "syn-solidity 0.7.6", -] - [[package]] name = "alloy-sol-macro-input" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0ad281f3d1b613af814b66977ee698e443d4644a1510962d0241f26e0e53ae" dependencies = [ - "alloy-json-abi 0.8.13", + "alloy-json-abi", "const-hex", "dunce", "heck", @@ -907,16 +556,7 @@ dependencies = [ "quote", "serde_json", "syn 2.0.89", - "syn-solidity 0.8.14", -] - -[[package]] -name = "alloy-sol-type-parser" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" -dependencies = [ - "winnow 0.6.13", + "syn-solidity", ] [[package]] @@ -929,57 +569,26 @@ dependencies = [ "winnow 0.6.13", ] -[[package]] -name = "alloy-sol-types" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" -dependencies = [ - "alloy-json-abi 0.7.6", - "alloy-primitives 0.7.6", - "alloy-sol-macro 0.7.6", - "const-hex", - "serde", -] - [[package]] name = "alloy-sol-types" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ - "alloy-json-abi 0.8.13", - "alloy-primitives 0.8.13", - "alloy-sol-macro 0.8.13", + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", "const-hex", "serde", ] -[[package]] -name = "alloy-transport" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd9773e4ec6832346171605c776315544bd06e40f803e7b5b7824b325d5442ca" -dependencies = [ - "alloy-json-rpc 0.1.3", - "base64", - "futures-util", - "futures-utils-wasm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower 0.4.13", - "url", -] - [[package]] name = "alloy-transport" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f295f4b745fb9e4e663d70bc57aed991288912c7aaaf25767def921050ee43" dependencies = [ - "alloy-json-rpc 0.7.0", + "alloy-json-rpc", "base64", "futures-util", "futures-utils-wasm", @@ -993,29 +602,14 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "alloy-transport-http" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8ef947b901c0d4e97370f9fa25844cf8b63b1a58fd4011ee82342dc8a9fc6b" -dependencies = [ - "alloy-json-rpc 0.1.3", - "alloy-transport 0.1.3", - "reqwest", - "serde_json", - "tower 0.4.13", - "tracing", - "url", -] - [[package]] name = "alloy-transport-http" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39139015a5ec127d9c895b49b484608e27fe4538544f84cdf5eae0bd36339bc6" dependencies = [ - "alloy-json-rpc 0.7.0", - "alloy-transport 0.7.0", + "alloy-json-rpc", + "alloy-transport", "reqwest", "serde_json", "tower 0.5.1", @@ -1029,10 +623,10 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b2e366c0debf0af77766c23694a3f863b02633050e71e096e257ffbd395e50" dependencies = [ - "alloy-primitives 0.8.13", + "alloy-primitives", "alloy-rlp", "arrayvec", - "derive_more 1.0.0", + "derive_more", "nybbles", "smallvec", "tracing", @@ -1310,7 +904,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" name = "basic-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives 0.8.13", + "alloy-primitives", "openzeppelin-stylus", "stylus-sdk", ] @@ -1319,8 +913,8 @@ dependencies = [ name = "basic-example-script" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "basic-example", "koba", "tokio", @@ -1330,8 +924,8 @@ dependencies = [ name = "benches" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "futures", @@ -1579,12 +1173,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -1772,8 +1360,8 @@ dependencies = [ name = "cryptography-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -1883,19 +1471,6 @@ dependencies = [ "syn 2.0.89", ] -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version 0.4.0", - "syn 2.0.89", -] - [[package]] name = "derive_more" version = "1.0.0" @@ -1948,7 +1523,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" name = "e2e" version = "0.1.0" dependencies = [ - "alloy 0.7.2", + "alloy", "e2e-proc", "eyre", "koba", @@ -2089,8 +1664,8 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" name = "erc1155-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -2102,8 +1677,8 @@ dependencies = [ name = "erc20-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -2115,8 +1690,8 @@ dependencies = [ name = "erc20-permit-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -2128,9 +1703,9 @@ dependencies = [ name = "erc721-consecutive-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy", + "alloy-primitives", + "alloy-sol-types", "e2e", "eyre", "openzeppelin-stylus", @@ -2143,8 +1718,8 @@ dependencies = [ name = "erc721-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -2157,8 +1732,8 @@ dependencies = [ name = "erc721-metadata-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -2781,10 +2356,9 @@ checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" [[package]] name = "koba" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e92e1148d087df999396266311bece9e5311c352821872cccaf5dc67117cfc" +source = "git+https://github.com/OpenZeppelin/koba?branch=build%2Fbump-alloy#9f5fc33853088f7c265571c1f90728eb56c5051f" dependencies = [ - "alloy 0.1.4", + "alloy", "brotli2", "bytesize", "clap", @@ -2899,8 +2473,8 @@ dependencies = [ name = "merkle-proofs-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-types", "openzeppelin-crypto", "stylus-sdk", ] @@ -2962,8 +2536,8 @@ dependencies = [ name = "motsu-proc" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-types", "motsu", "proc-macro2", "quote", @@ -3134,11 +2708,11 @@ dependencies = [ name = "openzeppelin-stylus" version = "0.2.0-alpha.1" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-macro 0.8.13", - "alloy-sol-macro-expander 0.8.13", - "alloy-sol-macro-input 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-macro", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "alloy-sol-types", "keccak-const", "motsu", "openzeppelin-stylus-proc", @@ -3150,7 +2724,7 @@ dependencies = [ name = "openzeppelin-stylus-proc" version = "0.1.0" dependencies = [ - "convert_case 0.6.0", + "convert_case", "proc-macro2", "quote", "syn 2.0.89", @@ -3160,8 +2734,8 @@ dependencies = [ name = "ownable-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -3173,8 +2747,8 @@ dependencies = [ name = "ownable-two-step" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -3814,8 +3388,8 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" name = "safe-erc20-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", @@ -4143,10 +3717,10 @@ version = "0.7.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8abd5d2cb3a10a36101b3d9243eda29daa58aad89b93979afe77c4be89068413" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-types", "cfg-if", - "convert_case 0.6.0", + "convert_case", "lazy_static", "proc-macro-error", "proc-macro2", @@ -4154,7 +3728,7 @@ dependencies = [ "regex", "sha3", "syn 2.0.89", - "syn-solidity 0.8.14", + "syn-solidity", "trybuild", ] @@ -4164,8 +3738,8 @@ version = "0.7.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caa33222d37101b3ba7064f1099ae38c7e388eaeac422e58260b7d00346a5267" dependencies = [ - "alloy-primitives 0.8.13", - "alloy-sol-types 0.8.13", + "alloy-primitives", + "alloy-sol-types", "cfg-if", "derivative", "hex", @@ -4203,18 +3777,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-solidity" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "syn-solidity" version = "0.8.14" @@ -4454,7 +4016,6 @@ dependencies = [ "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -4489,7 +4050,6 @@ 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", @@ -4660,8 +4220,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" name = "vesting-wallet-example" version = "0.2.0-alpha.1" dependencies = [ - "alloy 0.7.2", - "alloy-primitives 0.8.13", + "alloy", + "alloy-primitives", "e2e", "eyre", "openzeppelin-stylus", diff --git a/Cargo.toml b/Cargo.toml index 841770e5d..54a663b4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ alloy-sol-macro-input = { version = "=0.8.13", default-features = false } const-hex = { version = "1.11.1", default-features = false } eyre = "0.6.8" keccak-const = "0.2.0" -koba = "0.2.0" +koba = { git = "https://github.com/OpenZeppelin/koba", branch = "build/bump-alloy" } once_cell = "1.19.0" rand = "0.8.5" regex = "1.10.4" From 0f40dc46bde2744e332c40ea3655c633137f9e6a Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Tue, 3 Dec 2024 09:21:30 +0100 Subject: [PATCH 07/25] build: update E2E crate with new alloy (cherry picked from commit 91a0e8edc06df3ed4e3f6dfd8fcccb7fc063b2c7) --- Cargo.lock | 2 +- lib/e2e/Cargo.toml | 2 +- lib/e2e/src/system.rs | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3119e815c..2c0d6a37d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1521,7 +1521,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "e2e" -version = "0.1.0" +version = "0.2.0" dependencies = [ "alloy", "e2e-proc", diff --git a/lib/e2e/Cargo.toml b/lib/e2e/Cargo.toml index 84a9c6df0..fc8b8ab51 100644 --- a/lib/e2e/Cargo.toml +++ b/lib/e2e/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "e2e" description = "End-to-end Testing for Stylus" -version = "0.1.0" +version = "0.2.0" categories = ["development-tools::testing", "cryptography::cryptocurrencies"] keywords = ["arbitrum", "ethereum", "stylus", "integration-testing", "tests"] authors.workspace = true diff --git a/lib/e2e/src/system.rs b/lib/e2e/src/system.rs index 5d90cd8be..9f622cd24 100644 --- a/lib/e2e/src/system.rs +++ b/lib/e2e/src/system.rs @@ -3,8 +3,8 @@ use alloy::{ primitives::Address, providers::{ fillers::{ - ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, - WalletFiller, + BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, + NonceFiller, WalletFiller, }, Identity, ProviderBuilder, RootProvider, }, @@ -20,8 +20,11 @@ pub(crate) const RPC_URL_ENV_VAR_NAME: &str = "RPC_URL"; pub type Wallet = FillProvider< JoinFill< JoinFill< - JoinFill, NonceFiller>, - ChainIdFiller, + Identity, + JoinFill< + GasFiller, + JoinFill>, + >, >, WalletFiller, >, @@ -33,8 +36,11 @@ pub type Wallet = FillProvider< /// Convenience type alias that represents an alloy provider. pub type Provider = FillProvider< JoinFill< - JoinFill, NonceFiller>, - ChainIdFiller, + Identity, + JoinFill< + GasFiller, + JoinFill>, + >, >, RootProvider>, Http, From 3c909bf38e3ab7ba757e169060792159e260c7de Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Tue, 3 Dec 2024 09:52:56 +0100 Subject: [PATCH 08/25] ref: extract v as u8 from Signature (cherry picked from commit 25d400c9122af0840d51049b3c40ed4c0e464ce3) --- examples/ecdsa/tests/ecdsa.rs | 16 ++++++---------- examples/erc20-permit/tests/erc20permit.rs | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/examples/ecdsa/tests/ecdsa.rs b/examples/ecdsa/tests/ecdsa.rs index 9380fd9bb..1673a6c90 100644 --- a/examples/ecdsa/tests/ecdsa.rs +++ b/examples/ecdsa/tests/ecdsa.rs @@ -1,7 +1,7 @@ #![cfg(feature = "e2e")] use abi::ECDSA; -use alloy::primitives::{address, b256, uint, Address, B256}; +use alloy::primitives::{address, b256, uint, Address, Parity, B256}; use e2e::{Account, ReceiptExt, Revert}; use eyre::Result; use openzeppelin_stylus::utils::cryptography::ecdsa::SIGNATURE_S_UPPER_BOUND; @@ -108,17 +108,13 @@ async fn recovers_from_v_r_s(alice: Account) -> Result<()> { let contract = ECDSA::new(contract_addr, &alice.wallet); let signature = alice.sign_hash(&HASH).await; + let parity: Parity = signature.v().into(); + let v_byte = parity + .y_parity_byte_non_eip155() + .expect("should be non-EIP155 signature"); let ECDSA::recoverReturn { recovered } = contract - .recover( - HASH, - signature - .v() - .y_parity_byte_non_eip155() - .expect("should be non-EIP155 signature"), - signature.r().into(), - signature.s().into(), - ) + .recover(HASH, v_byte, signature.r().into(), signature.s().into()) .call() .await?; diff --git a/examples/erc20-permit/tests/erc20permit.rs b/examples/erc20-permit/tests/erc20permit.rs index d831c3f43..ab0e155a5 100644 --- a/examples/erc20-permit/tests/erc20permit.rs +++ b/examples/erc20-permit/tests/erc20permit.rs @@ -2,14 +2,14 @@ use abi::Erc20Permit; use alloy::{ - primitives::{b256, keccak256, Address, B256, U256}, + primitives::{b256, keccak256, Address, Parity, B256, U256}, + signers::Signature, sol, sol_types::SolType, }; use alloy_primitives::uint; use e2e::{receipt, send, watch, Account, EventExt, ReceiptExt, Revert}; use eyre::Result; - mod abi; // Saturday, 1 January 2000 00:00:00 @@ -65,6 +65,11 @@ fn permit_struct_hash( ))) } +fn extract_signature_v(signature: &Signature) -> u8 { + let parity: Parity = signature.v().into(); + parity.y_parity_byte_non_eip155().expect("should be non-EIP155 signature") +} + // ============================================================================ // Integration Tests: ERC-20 Permit Extension // ============================================================================ @@ -103,7 +108,7 @@ async fn error_when_expired_deadline_for_permit( bob_addr, balance, EXPIRED_DEADLINE, - signature.v().y_parity_byte_non_eip155().unwrap(), + extract_signature_v(&signature), signature.r().into(), signature.s().into() )) @@ -152,7 +157,7 @@ async fn permit_works(alice: Account, bob: Account) -> Result<()> { bob_addr, balance, FAIR_DEADLINE, - signature.v().y_parity_byte_non_eip155().unwrap(), + extract_signature_v(&signature), signature.r().into(), signature.s().into() ))?; @@ -237,7 +242,7 @@ async fn permit_rejects_reused_signature( bob_addr, balance, FAIR_DEADLINE, - signature.v().y_parity_byte_non_eip155().unwrap(), + extract_signature_v(&signature), signature.r().into(), signature.s().into() ))?; @@ -247,7 +252,7 @@ async fn permit_rejects_reused_signature( bob_addr, balance, FAIR_DEADLINE, - signature.v().y_parity_byte_non_eip155().unwrap(), + extract_signature_v(&signature), signature.r().into(), signature.s().into() )) @@ -312,7 +317,7 @@ async fn permit_rejects_invalid_signature( bob_addr, balance, FAIR_DEADLINE, - signature.v().y_parity_byte_non_eip155().unwrap(), + extract_signature_v(&signature), signature.r().into(), signature.s().into() )) From 1acaa4c1b8fba808cfa5b5b45e4cdc7ee54ebc88 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Tue, 3 Dec 2024 10:09:38 +0100 Subject: [PATCH 09/25] fix: use proper data type for U96 (cherry picked from commit 0596f0c17d2c3b6fa3a116e62fba470f4d3ecd1e) --- examples/erc721-consecutive/tests/erc721-consecutive.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/erc721-consecutive/tests/erc721-consecutive.rs b/examples/erc721-consecutive/tests/erc721-consecutive.rs index 1f50f78c5..ed572ea52 100644 --- a/examples/erc721-consecutive/tests/erc721-consecutive.rs +++ b/examples/erc721-consecutive/tests/erc721-consecutive.rs @@ -4,7 +4,7 @@ use alloy::{ primitives::{Address, U256}, sol, }; -use alloy_primitives::uint; +use alloy_primitives::{uint, aliases::U96}; use e2e::{receipt, watch, Account, EventExt, ReceiptExt, Revert}; use crate::{abi::Erc721, Erc721ConsecutiveExample::constructorCall}; @@ -24,9 +24,9 @@ fn random_token_id() -> U256 { fn ctr(receivers: Vec
, amounts: Vec) -> constructorCall { constructorCall { receivers, - amounts, - firstConsecutiveId: FIRST_CONSECUTIVE_ID, - maxBatchSize: MAX_BATCH_SIZE, + amounts: amounts.iter().map(|v| U96::from(*v)).collect(), + firstConsecutiveId: U96::from(FIRST_CONSECUTIVE_ID), + maxBatchSize: U96::from(MAX_BATCH_SIZE), } } From fa476f146652ca0a6e1178518b7b7f5cde852acc Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Tue, 3 Dec 2024 11:50:40 +0100 Subject: [PATCH 10/25] fix: benches (cherry picked from commit 65a0c6ed24b1400a91688a20f32d0b3c3ad87b8c) --- benches/src/lib.rs | 4 ++-- examples/erc721-consecutive/tests/erc721-consecutive.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benches/src/lib.rs b/benches/src/lib.rs index f6f39d9a2..dfbb657f6 100644 --- a/benches/src/lib.rs +++ b/benches/src/lib.rs @@ -3,7 +3,7 @@ use std::process::Command; use alloy::{ primitives::Address, rpc::types::{ - serde_helpers::WithOtherFields, AnyReceiptEnvelope, Log, + serde_helpers::WithOtherFields, AnyReceiptEnvelope, Log, Receipt, TransactionReceipt, }, }; @@ -40,7 +40,7 @@ pub enum CacheOpt { } type ArbTxReceipt = - WithOtherFields>>; + WithOtherFields>>>; async fn deploy( account: &Account, diff --git a/examples/erc721-consecutive/tests/erc721-consecutive.rs b/examples/erc721-consecutive/tests/erc721-consecutive.rs index ed572ea52..740779a42 100644 --- a/examples/erc721-consecutive/tests/erc721-consecutive.rs +++ b/examples/erc721-consecutive/tests/erc721-consecutive.rs @@ -4,7 +4,7 @@ use alloy::{ primitives::{Address, U256}, sol, }; -use alloy_primitives::{uint, aliases::U96}; +use alloy_primitives::{aliases::U96, uint}; use e2e::{receipt, watch, Account, EventExt, ReceiptExt, Revert}; use crate::{abi::Erc721, Erc721ConsecutiveExample::constructorCall}; From 1078a12fd0e6090c4979d27fadf8ec33549bf776 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Wed, 4 Dec 2024 21:10:54 +0100 Subject: [PATCH 11/25] fix: constrain storage ints --- .../src/token/erc1155/extensions/metadata_uri.rs | 2 +- contracts/src/utils/math/storage.rs | 13 +++++++++---- contracts/src/utils/metadata.rs | 2 +- .../src/utils/structs/checkpoints/generic_size.rs | 3 +++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/contracts/src/token/erc1155/extensions/metadata_uri.rs b/contracts/src/token/erc1155/extensions/metadata_uri.rs index 6f822a7df..8e7c8debd 100644 --- a/contracts/src/token/erc1155/extensions/metadata_uri.rs +++ b/contracts/src/token/erc1155/extensions/metadata_uri.rs @@ -3,7 +3,7 @@ //! //! [ERC]: https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions -use alloc::string::String; +use alloc::{string::String, vec::Vec}; use alloy_primitives::{FixedBytes, U256}; use alloy_sol_macro::sol; diff --git a/contracts/src/utils/math/storage.rs b/contracts/src/utils/math/storage.rs index 31193c47b..51d891a3b 100644 --- a/contracts/src/utils/math/storage.rs +++ b/contracts/src/utils/math/storage.rs @@ -1,5 +1,6 @@ //! Simple math operations missing in `stylus_sdk::storage`. use alloy_primitives::Uint; +use alloy_sol_types::sol_data::{IntBitCount, SupportedInt}; use stylus_sdk::storage::{StorageGuardMut, StorageUint}; pub(crate) trait AddAssignUnchecked { @@ -8,10 +9,12 @@ pub(crate) trait AddAssignUnchecked { impl<'a, const B: usize, const L: usize> AddAssignUnchecked> for StorageGuardMut<'a, StorageUint> +where + IntBitCount: SupportedInt, { fn add_assign_unchecked(&mut self, rhs: Uint) { - let new_balance = self.get() + rhs; - self.set(new_balance); + let new_value = self.get() + rhs; + self.set(new_value); } } @@ -21,9 +24,11 @@ pub(crate) trait SubAssignUnchecked { impl<'a, const B: usize, const L: usize> SubAssignUnchecked> for StorageGuardMut<'a, StorageUint> +where + IntBitCount: SupportedInt, { fn sub_assign_unchecked(&mut self, rhs: Uint) { - let new_balance = self.get() - rhs; - self.set(new_balance); + let new_value = self.get() - rhs; + self.set(new_value); } } diff --git a/contracts/src/utils/metadata.rs b/contracts/src/utils/metadata.rs index b4410d12c..e668bca34 100644 --- a/contracts/src/utils/metadata.rs +++ b/contracts/src/utils/metadata.rs @@ -1,5 +1,5 @@ //! Common Metadata Smart Contract. -use alloc::{string::String, vec, vec::Vec}; +use alloc::{string::String, vec::Vec}; use stylus_sdk::stylus_proc::{public, sol_storage}; sol_storage! { diff --git a/contracts/src/utils/structs/checkpoints/generic_size.rs b/contracts/src/utils/structs/checkpoints/generic_size.rs index 033700c66..aee10a65e 100644 --- a/contracts/src/utils/structs/checkpoints/generic_size.rs +++ b/contracts/src/utils/structs/checkpoints/generic_size.rs @@ -2,6 +2,7 @@ use core::ops::{Add, Div, Mul, Sub}; +use alloy_sol_types::sol_data::{IntBitCount, SupportedInt}; use stylus_sdk::{alloy_primitives::Uint, prelude::*}; /// Trait that associates types of specific size for checkpoints key and value. @@ -87,6 +88,8 @@ pub trait Accessor { impl Accessor for stylus_sdk::storage::StorageUint +where + IntBitCount: SupportedInt, { type Wraps = Uint; From a9c3fbed98776fdaeb53d9317747f8d3d065b55a Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Thu, 5 Dec 2024 15:24:56 +0100 Subject: [PATCH 12/25] build: update koba to v0.3.0 --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c0d6a37d..4b966c4ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2355,8 +2355,9 @@ checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" [[package]] name = "koba" -version = "0.2.0" -source = "git+https://github.com/OpenZeppelin/koba?branch=build%2Fbump-alloy#9f5fc33853088f7c265571c1f90728eb56c5051f" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648bf93c7aff36defcf825c5a42d32503eb617c85f057a989f34ebfebed99f45" dependencies = [ "alloy", "brotli2", diff --git a/Cargo.toml b/Cargo.toml index 54a663b4e..aeaad6ac9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ alloy-sol-macro-input = { version = "=0.8.13", default-features = false } const-hex = { version = "1.11.1", default-features = false } eyre = "0.6.8" keccak-const = "0.2.0" -koba = { git = "https://github.com/OpenZeppelin/koba", branch = "build/bump-alloy" } +koba = "0.3.0" once_cell = "1.19.0" rand = "0.8.5" regex = "1.10.4" From 94cb034c5f59ea0ffd46c644adc193e13bef4b4d Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Fri, 6 Dec 2024 11:55:40 +0400 Subject: [PATCH 13/25] remove not used Provider --- lib/e2e/src/lib.rs | 2 +- lib/e2e/src/system.rs | 30 +----------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/lib/e2e/src/lib.rs b/lib/e2e/src/lib.rs index 539f71aa7..13c2c4dea 100644 --- a/lib/e2e/src/lib.rs +++ b/lib/e2e/src/lib.rs @@ -13,7 +13,7 @@ pub use e2e_proc::test; pub use error::{Panic, PanicCode, Revert}; pub use event::EventExt; pub use receipt::ReceiptExt; -pub use system::{fund_account, provider, Provider, Wallet}; +pub use system::{fund_account, Wallet}; /// This macro provides a shorthand for broadcasting the transaction to the /// network. diff --git a/lib/e2e/src/system.rs b/lib/e2e/src/system.rs index 9f622cd24..1c0613e4a 100644 --- a/lib/e2e/src/system.rs +++ b/lib/e2e/src/system.rs @@ -6,7 +6,7 @@ use alloy::{ BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, WalletFiller, }, - Identity, ProviderBuilder, RootProvider, + Identity, RootProvider, }, transports::http::{Client, Http}, }; @@ -33,39 +33,11 @@ pub type Wallet = FillProvider< Ethereum, >; -/// Convenience type alias that represents an alloy provider. -pub type Provider = FillProvider< - JoinFill< - Identity, - JoinFill< - GasFiller, - JoinFill>, - >, - >, - RootProvider>, - Http, - Ethereum, ->; - /// Load the `name` environment variable. fn env(name: &str) -> eyre::Result { std::env::var(name).wrap_err(format!("failed to load {name}")) } -/// Returns an alloy provider connected to the `RPC_URL` rpc endpoint. -/// -/// # Panics -/// -/// May panic if unable to load the `RPC_URL` environment variable. -#[must_use] -pub fn provider() -> Provider { - let rpc_url = env(RPC_URL_ENV_VAR_NAME) - .expect("failed to load RPC_URL var from env") - .parse() - .expect("failed to parse RPC_URL string into a URL"); - ProviderBuilder::new().with_recommended_fillers().on_http(rpc_url) -} - /// Send `amount` eth to `address` in the nitro-tesnode. pub fn fund_account(address: Address, amount: u32) -> eyre::Result<()> { let node_script = get_node_path()?.join("test-node.bash"); From 06945d6230c2fc735bcffcc22e059633c5fc07d4 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Fri, 6 Dec 2024 14:43:21 +0400 Subject: [PATCH 14/25] add stylus-sdk patch for external calls --- Cargo.lock | 9 +++------ Cargo.toml | 9 +++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b966c4ba..746da475d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2489,8 +2489,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mini-alloc" version = "0.7.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d79b46612e3fc76138ed930cd2e4bbd26ada11954a6d312e3affe4b56df0081" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" dependencies = [ "cfg-if", ] @@ -3715,8 +3714,7 @@ dependencies = [ [[package]] name = "stylus-proc" version = "0.7.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8abd5d2cb3a10a36101b3d9243eda29daa58aad89b93979afe77c4be89068413" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -3736,8 +3734,7 @@ dependencies = [ [[package]] name = "stylus-sdk" version = "0.7.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa33222d37101b3ba7064f1099ae38c7e388eaeac422e58260b7d00346a5267" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" dependencies = [ "alloy-primitives", "alloy-sol-types", diff --git a/Cargo.toml b/Cargo.toml index aeaad6ac9..3748f50e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,3 +136,12 @@ incremental = false [profile.dev] panic = "abort" + +# TODO#q: remove this once the fix is released +[patch.crates-io.stylus-sdk] +git = "https://github.com/qalisander/stylus-sdk-rs" +branch = "fix-encoding-in-sol-interface" + +[patch.crates-io.stylus-proc] +git = "https://github.com/qalisander/stylus-sdk-rs" +branch = "fix-encoding-in-sol-interface" From 3a6e6bd3ffec2f428c7c4fc7b8cc4f37440ff076 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Sat, 7 Dec 2024 19:08:45 +0400 Subject: [PATCH 15/25] retrieve tx hashes for block timestamp --- examples/vesting-wallet/tests/vesting-wallet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vesting-wallet/tests/vesting-wallet.rs b/examples/vesting-wallet/tests/vesting-wallet.rs index 50f0b48e8..d75ba49c1 100644 --- a/examples/vesting-wallet/tests/vesting-wallet.rs +++ b/examples/vesting-wallet/tests/vesting-wallet.rs @@ -39,7 +39,7 @@ fn ctr( async fn block_timestamp(account: &Account) -> eyre::Result { let timestamp = account .wallet - .get_block(BlockId::latest(), BlockTransactionsKind::Full) + .get_block(BlockId::latest(), BlockTransactionsKind::Hashes) .await? .expect("latest block should exist") .header From d33bdc3d303322263e93907524cba1cf490df771 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Sat, 7 Dec 2024 19:55:29 +0400 Subject: [PATCH 16/25] fix run_check_release test for vesting_wallet --- examples/vesting-wallet/tests/vesting-wallet.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/vesting-wallet/tests/vesting-wallet.rs b/examples/vesting-wallet/tests/vesting-wallet.rs index d75ba49c1..d292b8b7f 100644 --- a/examples/vesting-wallet/tests/vesting-wallet.rs +++ b/examples/vesting-wallet/tests/vesting-wallet.rs @@ -311,9 +311,10 @@ mod erc20_vesting { assert_in_delta(old_alice_balance + released, alice_balance); assert_in_delta(old_contract_balance - released, contract_balance); - assert!( - receipt.emits(VestingWallet::EtherReleased { amount: released }) - ); + assert!(receipt.emits(VestingWallet::ERC20Released { + token: erc20_address, + amount: released + })); Ok(()) } From eb5cc951a3215c15944866995181ef7ae99566e1 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Mon, 9 Dec 2024 17:08:30 +0400 Subject: [PATCH 17/25] update alloy to 0.8.14 --- Cargo.lock | 34 +++++++++++++++++----------------- Cargo.toml | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c813e09e..650e87f1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +checksum = "ac4b22b3e51cac09fd2adfcc73b55f447b4df669f983c13f7894ec82b607c63f" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -311,9 +311,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" +checksum = "9db948902dfbae96a73c2fbf1f7abec62af034ab883e4c777c3fd29702bd6e2c" dependencies = [ "alloy-rlp", "arbitrary", @@ -511,9 +511,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0279d09463a4695788a3622fd95443625f7be307422deba4b55dd491a9c7a1" +checksum = "3bfd7853b65a2b4f49629ec975fee274faf6dff15ab8894c620943398ef283c0" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -525,9 +525,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feea540fc8233df2ad1156efd744b2075372f43a8f942a68b3b19c8a00e2c12" +checksum = "82ec42f342d9a9261699f8078e57a7a4fda8aaa73c1a212ed3987080e6a9cd13" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -544,9 +544,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0ad281f3d1b613af814b66977ee698e443d4644a1510962d0241f26e0e53ae" +checksum = "ed2c50e6a62ee2b4f7ab3c6d0366e5770a21cad426e109c2f40335a1b3aff3df" dependencies = [ "alloy-json-abi", "const-hex", @@ -571,9 +571,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" +checksum = "c9dc0fffe397aa17628160e16b89f704098bf3c9d74d5d369ebc239575936de5" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -1156,9 +1156,9 @@ checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -2502,7 +2502,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mini-alloc" version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" dependencies = [ "cfg-if", ] @@ -3727,7 +3727,7 @@ dependencies = [ [[package]] name = "stylus-proc" version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -3747,7 +3747,7 @@ dependencies = [ [[package]] name = "stylus-sdk" version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#a31d36a883f8b3d30835f05779997b793444e532" +source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" dependencies = [ "alloy-primitives", "alloy-sol-types", diff --git a/Cargo.toml b/Cargo.toml index cdfde278f..06f56207c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,11 +87,11 @@ alloy = { version = "=0.7.2", features = [ # Even though `alloy` includes `alloy-primitives` and `alloy-sol-types` we need # to keep both versions for compatibility with the Stylus SDK. Once they start # using `alloy` we can remove these. -alloy-primitives = { version = "=0.8.13", default-features = false } -alloy-sol-types = { version = "=0.8.13", default-features = false } -alloy-sol-macro = { version = "=0.8.13", default-features = false } -alloy-sol-macro-expander = { version = "=0.8.13", default-features = false } -alloy-sol-macro-input = { version = "=0.8.13", default-features = false } +alloy-primitives = { version = "=0.8.14", default-features = false } +alloy-sol-types = { version = "=0.8.14", default-features = false } +alloy-sol-macro = { version = "=0.8.14", default-features = false } +alloy-sol-macro-expander = { version = "=0.8.14", default-features = false } +alloy-sol-macro-input = { version = "=0.8.14", default-features = false } const-hex = { version = "1.11.1", default-features = false } eyre = "0.6.8" From c255a90371d7a72c723792105ed1764ec21368dc Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Wed, 11 Dec 2024 16:17:50 +0400 Subject: [PATCH 18/25] ++ --- contracts/src/utils/math/storage.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/src/utils/math/storage.rs b/contracts/src/utils/math/storage.rs index 7d5a07c34..5e709c002 100644 --- a/contracts/src/utils/math/storage.rs +++ b/contracts/src/utils/math/storage.rs @@ -1,5 +1,6 @@ //! Simple math operations missing in `stylus_sdk::storage`. use alloy_primitives::Uint; +use alloy_sol_types::sol_data::{IntBitCount, SupportedInt}; use stylus_sdk::storage::StorageUint; /// Adds value and assign the result to `self`, ignoring overflow. From f8b76459b21c8863e7df48a57e7f8b0c9c9a2857 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Wed, 11 Dec 2024 16:28:40 +0400 Subject: [PATCH 19/25] import alloc::vec::Vec for permit --- contracts/src/token/erc20/extensions/permit.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/src/token/erc20/extensions/permit.rs b/contracts/src/token/erc20/extensions/permit.rs index 64af6492a..089184048 100644 --- a/contracts/src/token/erc20/extensions/permit.rs +++ b/contracts/src/token/erc20/extensions/permit.rs @@ -12,6 +12,8 @@ //! //! [ERC]: https://eips.ethereum.org/EIPS/eip-2612 +use alloc::vec::Vec; + use alloy_primitives::{b256, keccak256, Address, B256, U256}; use alloy_sol_types::{sol, SolType}; use stylus_sdk::{ From 0f2a246697ce9de751b44f2a138c5b20ea271a7f Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Wed, 11 Dec 2024 16:28:59 +0400 Subject: [PATCH 20/25] remove unused code --- lib/e2e/src/lib.rs | 2 +- lib/e2e/src/system.rs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/e2e/src/lib.rs b/lib/e2e/src/lib.rs index 8c35d7e62..8878ee197 100644 --- a/lib/e2e/src/lib.rs +++ b/lib/e2e/src/lib.rs @@ -13,7 +13,7 @@ pub use e2e_proc::test; pub use error::{Panic, PanicCode, Revert}; pub use event::Ext as EventExt; pub use receipt::Ext as ReceiptExt; -pub use system::{fund_account, provider, Provider, Wallet}; +pub use system::{fund_account, Wallet}; /// This macro provides a shorthand for broadcasting the transaction to the /// network. diff --git a/lib/e2e/src/system.rs b/lib/e2e/src/system.rs index 1ab09c66b..f58591e53 100644 --- a/lib/e2e/src/system.rs +++ b/lib/e2e/src/system.rs @@ -33,11 +33,6 @@ pub type Wallet = FillProvider< Ethereum, >; -/// Load the `name` environment variable. -fn env(name: &str) -> eyre::Result { - std::env::var(name).wrap_err(format!("failed to load {name}")) -} - /// Send `amount` eth to `address` in the nitro-tesnode. /// /// # Errors From b6898fc72d7c4563a08c9c678b5394332ac53854 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Fri, 13 Dec 2024 20:20:02 +0400 Subject: [PATCH 21/25] post merge fix --- contracts/src/access/control.rs | 10 +++++----- contracts/src/finance/vesting_wallet.rs | 2 +- contracts/src/token/erc1155/mod.rs | 2 +- contracts/src/token/erc721/mod.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/src/access/control.rs b/contracts/src/access/control.rs index 1126461bb..cc50f3d83 100644 --- a/contracts/src/access/control.rs +++ b/contracts/src/access/control.rs @@ -43,8 +43,8 @@ //! this role. use alloc::vec::Vec; -use alloy_primitives::{Address, B256}; -use alloy_sol_types::sol; +use alloy_primitives::{Address, FixedBytes, B256}; +use sol::*; use stylus_sdk::{ evm, msg, prelude::storage, @@ -126,9 +126,6 @@ pub struct AccessControl { #[public] impl AccessControl { - /// The default admin role. `[0; 32]` by default. - pub const DEFAULT_ADMIN_ROLE: [u8; 32] = [0; 32]; - /// Returns `true` if `account` has been granted `role`. /// /// # Arguments @@ -280,6 +277,9 @@ impl AccessControl { } impl AccessControl { + /// The default admin role. `[0; 32]` by default. + pub const DEFAULT_ADMIN_ROLE: [u8; 32] = [0; 32]; + /// Sets `admin_role` as `role`'s admin role. /// /// # Arguments diff --git a/contracts/src/finance/vesting_wallet.rs b/contracts/src/finance/vesting_wallet.rs index 9efc36acf..8265141bd 100644 --- a/contracts/src/finance/vesting_wallet.rs +++ b/contracts/src/finance/vesting_wallet.rs @@ -34,7 +34,7 @@ use stylus_sdk::{ block, call::{self, call, Call}, contract, evm, function_selector, - prelude::storage, + prelude::{sol_interface, storage}, storage::{StorageMap, StorageU256, StorageU64}, stylus_proc::{public, SolidityError}, }; diff --git a/contracts/src/token/erc1155/mod.rs b/contracts/src/token/erc1155/mod.rs index 52b7929bf..389148b2d 100644 --- a/contracts/src/token/erc1155/mod.rs +++ b/contracts/src/token/erc1155/mod.rs @@ -7,7 +7,7 @@ use stylus_sdk::{ abi::Bytes, call::{self, Call, MethodError}, evm, function_selector, msg, - prelude::{public, storage, AddressVM, SolidityError}, + prelude::{public, sol_interface, storage, AddressVM, SolidityError}, storage::{StorageBool, StorageMap, StorageU256}, }; diff --git a/contracts/src/token/erc721/mod.rs b/contracts/src/token/erc721/mod.rs index a7c402139..6e57f511e 100644 --- a/contracts/src/token/erc721/mod.rs +++ b/contracts/src/token/erc721/mod.rs @@ -1,5 +1,5 @@ //! Implementation of the [`Erc721`] token standard. -use alloc::vec; +use alloc::{vec, vec::Vec}; use alloy_primitives::{uint, Address, FixedBytes, U128, U256}; use openzeppelin_stylus_proc::interface_id; From a16de97459369e3d453512461096c2873cb5e5b5 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Fri, 13 Dec 2024 20:24:44 +0400 Subject: [PATCH 22/25] ++ --- contracts/src/utils/pausable.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/src/utils/pausable.rs b/contracts/src/utils/pausable.rs index 507a13c0f..3ff800dee 100644 --- a/contracts/src/utils/pausable.rs +++ b/contracts/src/utils/pausable.rs @@ -16,7 +16,6 @@ use alloc::vec::Vec; -use alloy_sol_types::sol; pub use sol::*; use stylus_sdk::{ evm, msg, From acd843af700cc4d1cc36796d6be892b486041632 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Fri, 13 Dec 2024 20:25:43 +0400 Subject: [PATCH 23/25] ++ --- contracts/src/access/control.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/src/access/control.rs b/contracts/src/access/control.rs index cc50f3d83..b14199ae5 100644 --- a/contracts/src/access/control.rs +++ b/contracts/src/access/control.rs @@ -44,7 +44,7 @@ use alloc::vec::Vec; use alloy_primitives::{Address, FixedBytes, B256}; -use sol::*; +pub use sol::*; use stylus_sdk::{ evm, msg, prelude::storage, From 6661c5a2c8ad27375948b11f43acbf95d6b4f8f7 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Mon, 23 Dec 2024 22:31:29 +0400 Subject: [PATCH 24/25] bump stylus sdk 0.7.0-rc.1 --- Cargo.lock | 12 ++++++------ Cargo.toml | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3aaf6900a..fe07dec27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2514,8 +2514,8 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mini-alloc" -version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" +version = "0.7.0-rc.1" +source = "git+https://github.com/OffchainLabs/stylus-sdk-rs?branch=rel%2F0.7.0-rc.1#754c69be04c0017a1d2573f2aa5b0c5f2483288a" dependencies = [ "cfg-if", ] @@ -3739,8 +3739,8 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" +version = "0.7.0-rc.1" +source = "git+https://github.com/OffchainLabs/stylus-sdk-rs?branch=rel%2F0.7.0-rc.1#754c69be04c0017a1d2573f2aa5b0c5f2483288a" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -3759,8 +3759,8 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.7.0-beta.1" -source = "git+https://github.com/qalisander/stylus-sdk-rs?branch=fix-encoding-in-sol-interface#2af4d8e232fc90c464eed29d0c0396f330f183ea" +version = "0.7.0-rc.1" +source = "git+https://github.com/OffchainLabs/stylus-sdk-rs?branch=rel%2F0.7.0-rc.1#754c69be04c0017a1d2573f2aa5b0c5f2483288a" dependencies = [ "alloy-primitives", "alloy-sol-types", diff --git a/Cargo.toml b/Cargo.toml index 917d028db..4e05837c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ all = "warn" [workspace.dependencies] # Stylus SDK related -stylus-sdk = "0.7.0-beta.1" +stylus-sdk = "0.7.0-rc.1" alloy = { version = "=0.7.2", features = [ "contract", @@ -153,9 +153,9 @@ files = { extend-exclude = [] } # TODO#q: remove this once the fix is released [patch.crates-io.stylus-sdk] -git = "https://github.com/qalisander/stylus-sdk-rs" -branch = "fix-encoding-in-sol-interface" +git = "https://github.com/OffchainLabs/stylus-sdk-rs" +branch = "rel/0.7.0-rc.1" [patch.crates-io.stylus-proc] -git = "https://github.com/qalisander/stylus-sdk-rs" -branch = "fix-encoding-in-sol-interface" +git = "https://github.com/OffchainLabs/stylus-sdk-rs" +branch = "rel/0.7.0-rc.1" \ No newline at end of file From dafd146e32dc36dcc399f6f2b13ab7afbb052c79 Mon Sep 17 00:00:00 2001 From: Alisander Qoshqosh Date: Mon, 23 Dec 2024 23:00:59 +0400 Subject: [PATCH 25/25] patch motsu --- Cargo.lock | 50 ++++++++++++------------- Cargo.toml | 9 ++++- contracts/src/finance/vesting_wallet.rs | 2 +- contracts/src/token/erc1155/mod.rs | 2 +- 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe07dec27..f3d2b823f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "access-control-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -902,7 +902,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "basic-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy-primitives", "openzeppelin-stylus", @@ -911,7 +911,7 @@ dependencies = [ [[package]] name = "basic-example-script" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -922,7 +922,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1358,7 +1358,7 @@ dependencies = [ [[package]] name = "cryptography-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1662,7 +1662,7 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erc1155-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "erc1155-metadata-uri-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1688,7 +1688,7 @@ dependencies = [ [[package]] name = "erc1155-supply-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1701,7 +1701,7 @@ dependencies = [ [[package]] name = "erc20-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1714,7 +1714,7 @@ dependencies = [ [[package]] name = "erc20-permit-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1727,7 +1727,7 @@ dependencies = [ [[package]] name = "erc721-consecutive-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1742,7 +1742,7 @@ dependencies = [ [[package]] name = "erc721-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "erc721-metadata-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -2498,7 +2498,7 @@ dependencies = [ [[package]] name = "merkle-proofs-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -2548,7 +2548,8 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "motsu" -version = "0.2.0" +version = "0.2.1" +source = "git+https://github.com/OpenZeppelin/stylus-test-helpers?branch=build%2Fstylus-v0.7.0-rc.1#23e8451ca9988caddab3b878cb3b53d343ffa18c" dependencies = [ "const-hex", "dashmap 6.1.0", @@ -2560,14 +2561,11 @@ dependencies = [ [[package]] name = "motsu-proc" -version = "0.2.0" +version = "0.2.1" +source = "git+https://github.com/OpenZeppelin/stylus-test-helpers?branch=build%2Fstylus-v0.7.0-rc.1#23e8451ca9988caddab3b878cb3b53d343ffa18c" dependencies = [ - "alloy-primitives", - "alloy-sol-types", - "motsu", "proc-macro2", "quote", - "stylus-sdk", "syn 2.0.89", ] @@ -2718,7 +2716,7 @@ dependencies = [ [[package]] name = "openzeppelin-crypto" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "crypto-bigint", "educe", @@ -2732,7 +2730,7 @@ dependencies = [ [[package]] name = "openzeppelin-stylus" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -2758,7 +2756,7 @@ dependencies = [ [[package]] name = "ownable-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -2771,7 +2769,7 @@ dependencies = [ [[package]] name = "ownable-two-step" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -3412,7 +3410,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe-erc20-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", @@ -4242,7 +4240,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vesting-wallet-example" -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" dependencies = [ "alloy", "alloy-primitives", diff --git a/Cargo.toml b/Cargo.toml index 741af1978..24c9445b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,11 +148,16 @@ default = { extend-ignore-identifiers-re = [ ] } files = { extend-exclude = [] } -# TODO#q: remove this once the fix is released +# TODO#q: remove stylus sdk patch once the fix is released [patch.crates-io.stylus-sdk] git = "https://github.com/OffchainLabs/stylus-sdk-rs" branch = "rel/0.7.0-rc.1" [patch.crates-io.stylus-proc] git = "https://github.com/OffchainLabs/stylus-sdk-rs" -branch = "rel/0.7.0-rc.1" \ No newline at end of file +branch = "rel/0.7.0-rc.1" + +# TODO#q: remove motsu patch once update is released +[patch.crates-io.motsu] +git = "https://github.com/OpenZeppelin/stylus-test-helpers" +branch = "build/stylus-v0.7.0-rc.1" \ No newline at end of file diff --git a/contracts/src/finance/vesting_wallet.rs b/contracts/src/finance/vesting_wallet.rs index 5e6c2b029..23864878e 100644 --- a/contracts/src/finance/vesting_wallet.rs +++ b/contracts/src/finance/vesting_wallet.rs @@ -34,8 +34,8 @@ use stylus_sdk::{ block, call::{self, call, Call}, contract, evm, function_selector, - storage::{StorageMap, StorageU256, StorageU64, TopLevelStorage}, prelude::{sol_interface, storage}, + storage::{StorageMap, StorageU256, StorageU64, TopLevelStorage}, stylus_proc::{public, SolidityError}, }; diff --git a/contracts/src/token/erc1155/mod.rs b/contracts/src/token/erc1155/mod.rs index 9a1d10f62..138e069f7 100644 --- a/contracts/src/token/erc1155/mod.rs +++ b/contracts/src/token/erc1155/mod.rs @@ -7,8 +7,8 @@ use stylus_sdk::{ abi::Bytes, call::{self, Call, MethodError}, evm, function_selector, msg, - storage::{StorageBool, StorageMap, StorageU256, TopLevelStorage}, prelude::{public, sol_interface, storage, AddressVM, SolidityError}, + storage::{StorageBool, StorageMap, StorageU256, TopLevelStorage}, }; use crate::utils::{