Repository: OpenZeppelin/rust-contracts-stylus
Pull request #624: build: bump Stylus SDK to v0.8.4
Author: login: 0xNeshi
Created: 2025-04-10T07:40:27Z | Merged: 2025-04-10T10:39:52Z



Diff:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e3c8be72..bc405f6ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Moved `Erc20` callable interface to _/erc20/interface.rs_ module and renamed it to `Erc20Interface`. #461
 - Bump `cargo-stylus` to `v0.5.11`. #617
-- Bump Stylus SDK to `v0.8.3`. #605
+- Bump Stylus SDK to `v0.8.4`. #624
 - Remove `ownable_two_step::Error` wrapper in `Ownable2Step`, and emit `ownable::Error` directly. #594
 - Poseidon babybear and goldilocks (64-bit) instances now have 256-bit security (capacity 4). #613
 - `BitIteratorBE` (bit iteration) trait at `openzeppelin_crypto` now accepts `self` by value. #589
diff --git a/Cargo.lock b/Cargo.lock
index aa5a59b76..d8c04be1d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -269,6 +269,7 @@ checksum = "9b15b13d38b366d01e818fe8e710d4d702ef7499eacd44926a06171dd9585d0c"
 dependencies = [
  "alloy-primitives",
  "alloy-rlp",
+ "k256",
  "serde",
  "thiserror 2.0.12",
 ]
@@ -1150,6 +1151,16 @@ dependencies = [
  "syn 2.0.100",
 ]
 
+[[package]]
+name = "aurora-engine-modexp"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9"
+dependencies = [
+ "hex",
+ "num",
+]
+
 [[package]]
 name = "auto_impl"
 version = "1.2.1"
@@ -1999,6 +2010,17 @@ dependencies = [
  "syn 2.0.100",
 ]
 
+[[package]]
+name = "enumn"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+]
+
 [[package]]
 name = "enumset"
 version = "1.1.5"
@@ -2982,6 +3004,9 @@ name = "lazy_static"
 version = "1.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
+dependencies = [
+ "spin",
+]
 
 [[package]]
 name = "leb128"
@@ -3113,9 +3138,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
 
 [[package]]
 name = "mini-alloc"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3dc09847999e8f92fb6ff6f3e11e9ac1b1976208aed3d6a3688d94132f4298"
+checksum = "2bb2aa3693a765fb59300b47151b0587b4058a73dec61f7fda974e160856e4d0"
 dependencies = [
  "cfg-if",
 ]
@@ -3148,9 +3173,9 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389"
 
 [[package]]
 name = "motsu"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b268a11003a485c01c4ddbc15223b0a1ff3fd1389e37c7dc1c277f25f143c26a"
+checksum = "cabe3e7bd29998942e4436ac773816d2b5f6b7ffe52a4f9caddbb84838ee9df8"
 dependencies = [
  "alloy-primitives",
  "alloy-signer-local 0.11.1",
@@ -3160,15 +3185,16 @@ dependencies = [
  "k256",
  "motsu-proc",
  "once_cell",
+ "revm-precompile",
  "stylus-sdk",
  "tiny-keccak",
 ]
 
 [[package]]
 name = "motsu-proc"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a45f688b2e7f47d6f0b81907408a58957b0f556456dbbce361dc4ce6bda9ca8e"
+checksum = "8f08debebddc2c71579fad7a55f980334c0b9f8df23a42d75553401b20de9f67"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -3192,6 +3218,20 @@ dependencies = [
  "tempfile",
 ]
 
+[[package]]
+name = "num"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
+dependencies = [
+ "num-bigint",
+ "num-complex",
+ "num-integer",
+ "num-iter",
+ "num-rational",
+ "num-traits",
+]
+
 [[package]]
 name = "num-bigint"
 version = "0.4.6"
@@ -3202,6 +3242,15 @@ dependencies = [
  "num-traits",
 ]
 
+[[package]]
+name = "num-complex"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
+dependencies = [
+ "num-traits",
+]
+
 [[package]]
 name = "num-integer"
 version = "0.1.46"
@@ -3211,6 +3260,28 @@ dependencies = [
  "num-traits",
 ]
 
+[[package]]
+name = "num-iter"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
+dependencies = [
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+]
+
 [[package]]
 name = "num-traits"
 version = "0.2.19"
@@ -3909,6 +3980,45 @@ dependencies = [
  "windows-registry",
 ]
 
+[[package]]
+name = "revm-precompile"
+version = "16.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99743c3a2cac341084cc15ac74286c4bf34a0941ebf60aa420cfdb9f81f72f9f"
+dependencies = [
+ "aurora-engine-modexp",
+ "blst",
+ "c-kzg",
+ "cfg-if",
+ "k256",
+ "once_cell",
+ "revm-primitives",
+ "ripemd",
+ "secp256k1",
+ "sha2",
+ "substrate-bn",
+]
+
+[[package]]
+name = "revm-primitives"
+version = "15.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0f987564210317706def498421dfba2ae1af64a8edce82c6102758b48133fcb"
+dependencies = [
+ "alloy-eip2930",
+ "alloy-eip7702 0.5.1",
+ "alloy-primitives",
+ "auto_impl",
+ "bitflags 2.9.0",
+ "bitvec",
+ "c-kzg",
+ "cfg-if",
+ "dyn-clone",
+ "enumn",
+ "hex",
+ "serde",
+]
+
 [[package]]
 name = "rfc6979"
 version = "0.4.0"
@@ -3919,6 +4029,15 @@ dependencies = [
  "subtle",
 ]
 
+[[package]]
+name = "ripemd"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
+dependencies = [
+ "digest 0.10.7",
+]
+
 [[package]]
 name = "rkyv"
 version = "0.7.45"
@@ -4172,6 +4291,25 @@ dependencies = [
  "zeroize",
 ]
 
+[[package]]
+name = "secp256k1"
+version = "0.29.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
+dependencies = [
+ "rand 0.8.5",
+ "secp256k1-sys",
+]
+
+[[package]]
+name = "secp256k1-sys"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9"
+dependencies = [
+ "cc",
+]
+
 [[package]]
 name = "security-framework"
 version = "2.11.1"
@@ -4394,6 +4532,12 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
+[[package]]
+name = "spin"
+version = "0.9.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+
 [[package]]
 name = "spki"
 version = "0.7.3"
@@ -4446,9 +4590,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-core"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2434fc6bcabf9b7f1a3d5da44cfa34609b12e98e3fde3f3d0c4709e5726474a"
+checksum = "2586fda31f933cca8f1d90d3cdfb46d85e3e9c21351f0d6c25fbaba4804bf43e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -4458,9 +4602,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-proc"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c003efb32d59dc3f291f4a22c777e81e5dc699cdbcafeefd4a39598bd0c36e7a"
+checksum = "25f21ddceb4cf882b442f5f591f8c3bb8c1fc2b38059759ac55721d3af21850e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -4479,9 +4623,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-sdk"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df6cba6ce22094d368abca999750bde1eade17083d5037d036a9fb553cb04532"
+checksum = "5de0c762e897a961dfd004f589a113d8f36bdb464fba6d980d53ff5f0ce3e75e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -4499,9 +4643,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-test"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdedf2d3c35b94843379767025e94142deaa6919179c2e679953cf48da40924b"
+checksum = "78a9611edff24096c74bc3114bc5cd7988662f6855a5f2a23640d9f747b347ff"
 dependencies = [
  "alloy-primitives",
  "alloy-provider 0.11.1",
@@ -4511,6 +4655,19 @@ dependencies = [
  "url",
 ]
 
+[[package]]
+name = "substrate-bn"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c"
+dependencies = [
+ "byteorder",
+ "crunchy",
+ "lazy_static",
+ "rand 0.8.5",
+ "rustc-hex",
+]
+
 [[package]]
 name = "subtle"
 version = "2.6.1"
diff --git a/Cargo.toml b/Cargo.toml
index 903608fe0..6e6cdfec3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -82,7 +82,7 @@ all = "warn"
 
 [workspace.dependencies]
 # Stylus SDK related
-stylus-sdk = { version = "=0.8.3", default-features = false, features = [
+stylus-sdk = { version = "=0.8.4", default-features = false, features = [
   "mini-alloc",
 ] }
 
@@ -126,7 +126,7 @@ proc-macro2 = "1.0.79"
 quote = "1.0.35"
 
 # test helpers
-motsu = "0.7.0"
+motsu = "0.8.0"
 
 # members
 openzeppelin-stylus = { path = "contracts" }
diff --git a/README.md b/README.md
index b60f67694..4971cf86d 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ We put great effort in testing the contracts before releasing an alpha, but thes
 > ```toml
 > [dependencies]
 > alloy-primitives = { version = "=0.8.20", default-features = false }
-> stylus-sdk = { version = "=0.8.1", default-features = false, features = [
+> stylus-sdk = { version = "=0.8.4", default-features = false, features = [
 >   "mini-alloc",
 > ] }
 > ```
diff --git a/contracts/src/access/control.rs b/contracts/src/access/control.rs
index f2aadae4f..6836b23bb 100644
--- a/contracts/src/access/control.rs
+++ b/contracts/src/access/control.rs
@@ -264,7 +264,7 @@ impl IAccessControl for AccessControl {
     }
 
     fn get_role_admin(&self, role: B256) -> B256 {
-        *self.roles.getter(role).admin_role
+        self.roles.getter(role).admin_role.get()
     }
 
     fn grant_role(
diff --git a/contracts/src/token/common/erc2981.rs b/contracts/src/token/common/erc2981.rs
index ffea0639b..0e5f373bd 100644
--- a/contracts/src/token/common/erc2981.rs
+++ b/contracts/src/token/common/erc2981.rs
@@ -170,7 +170,7 @@ impl IErc2981 for Erc2981 {
     ) -> (Address, U256) {
         let royalty_info = self.token_royalty_info.get(token_id);
         let (royalty_receiver, royalty_fraction) =
-            if royalty_info.receiver.is_zero() {
+            if royalty_info.receiver.get().is_zero() {
                 (
                     &self.default_royalty_info.receiver,
                     &self.default_royalty_info.royalty_fraction,
@@ -760,8 +760,8 @@ mod tests {
 
         // With no default royalty, should return zero address and zero amount
         let token_royalty = contract.token_royalty_info.get(TOKEN_ID);
-        assert!(token_royalty.receiver.is_zero());
-        assert_eq!(U96::ZERO, *token_royalty.royalty_fraction);
+        assert!(token_royalty.receiver.get().is_zero());
+        assert_eq!(U96::ZERO, token_royalty.royalty_fraction.get());
     }
 
     #[motsu::test]
diff --git a/contracts/src/token/erc1155/extensions/supply.rs b/contracts/src/token/erc1155/extensions/supply.rs
index 42b14307d..f0323f5a9 100644
--- a/contracts/src/token/erc1155/extensions/supply.rs
+++ b/contracts/src/token/erc1155/extensions/supply.rs
@@ -90,7 +90,7 @@ impl IErc1155Supply for Erc1155Supply {
     }
 
     fn total_supply_all(&self) -> U256 {
-        *self.total_supply_all
+        self.total_supply_all.get()
     }
 
     fn exists(&self, id: U256) -> bool {
diff --git a/contracts/src/token/erc20/extensions/erc4626.rs b/contracts/src/token/erc20/extensions/erc4626.rs
index cd2bfad4e..0cc52eca3 100644
--- a/contracts/src/token/erc20/extensions/erc4626.rs
+++ b/contracts/src/token/erc20/extensions/erc4626.rs
@@ -814,7 +814,7 @@ impl IErc4626 for Erc4626 {
     type Error = Error;
 
     fn asset(&self) -> Address {
-        *self.asset
+        self.asset.get()
     }
 
     fn total_assets(&mut self) -> Result<U256, Self::Error> {
diff --git a/contracts/src/token/erc20/utils/safe_erc20.rs b/contracts/src/token/erc20/utils/safe_erc20.rs
index 64ccae399..2d493c10c 100644
--- a/contracts/src/token/erc20/utils/safe_erc20.rs
+++ b/contracts/src/token/erc20/utils/safe_erc20.rs
@@ -25,12 +25,11 @@ use stylus_sdk::{
 
 use crate::{
     token::erc20,
-    utils::{
-        introspection::erc165::{Erc165, IErc165},
-        ReentrantCallHandler,
-    },
+    utils::introspection::erc165::{Erc165, IErc165},
 };
 
+const BOOL_TYPE_SIZE: usize = 32;
+
 #[cfg_attr(coverage_nightly, coverage(off))]
 mod sol {
     use alloy_sol_macro::sol;
@@ -339,12 +338,17 @@ impl SafeErc20 {
             return Err(SafeErc20FailedOperation { token }.into());
         }
 
-        match RawCall::new()
-            .limit_return_data(0, 32)
-            .call_with_reentrant_handling(token, &call.abi_encode())
-        {
-            Ok(data) if data.is_empty() || Self::encodes_true(&data) => Ok(()),
-            _ => Err(SafeErc20FailedOperation { token }.into()),
+        unsafe {
+            match RawCall::new()
+                .limit_return_data(0, BOOL_TYPE_SIZE)
+                .flush_storage_cache()
+                .call(token, &call.abi_encode())
+            {
+                Ok(data) if data.is_empty() || Self::encodes_true(&data) => {
+                    Ok(())
+                }
+                _ => Err(SafeErc20FailedOperation { token }.into()),
+            }
         }
     }
 
@@ -368,14 +372,17 @@ impl SafeErc20 {
         }
 
         let call = IErc20::allowanceCall { owner: address(), spender };
-        let result = RawCall::new()
-            .limit_return_data(0, 32)
-            .call_with_reentrant_handling(token, &call.abi_encode())
-            .map_err(|_| {
-                Error::SafeErc20FailedOperation(SafeErc20FailedOperation {
-                    token,
-                })
-            })?;
+        let result = unsafe {
+            RawCall::new()
+                .limit_return_data(0, BOOL_TYPE_SIZE)
+                .flush_storage_cache()
+                .call(token, &call.abi_encode())
+                .map_err(|_| {
+                    Error::SafeErc20FailedOperation(SafeErc20FailedOperation {
+                        token,
+                    })
+                })?
+        };
 
         Ok(U256::from_be_slice(&result))
     }
diff --git a/contracts/src/utils/mod.rs b/contracts/src/utils/mod.rs
index d36001aab..b8f56cef7 100644
--- a/contracts/src/utils/mod.rs
+++ b/contracts/src/utils/mod.rs
@@ -5,9 +5,7 @@ pub mod math;
 pub mod metadata;
 pub mod nonces;
 pub mod pausable;
-pub mod reentrant_call_handler;
 pub mod structs;
 
 pub use metadata::Metadata;
 pub use pausable::Pausable;
-pub use reentrant_call_handler::ReentrantCallHandler;
diff --git a/contracts/src/utils/reentrant_call_handler.rs b/contracts/src/utils/reentrant_call_handler.rs
deleted file mode 100644
index 8344ddfee..000000000
--- a/contracts/src/utils/reentrant_call_handler.rs
+++ /dev/null
@@ -1,96 +0,0 @@
-//! This module provides functionality for handling contract calls with
-//! safeguards for reentrancy.
-//!
-//! The [`ReentrantCallHandler`] trait allows performing raw contract calls
-//! while managing reentrancy issues, particularly when the `reentrant` feature
-//! is enabled. This ensures that storage aliasing does not occur during
-//! reentrant calls by flushing storage caches before the call is made.
-//!
-//! The behavior of the trait method
-//! [`ReentrantCallHandler::call_with_reentrant_handling`] varies depending on
-//! the presence of the `reentrant` feature, providing either a safe or default
-//! (unsafe) raw call mechanism. The module also interacts with raw calls and
-//! storage management methods like [ReentrantCallHandler::flush_storage_cache]
-//! to ensure that data integrity is maintained when making contract calls.
-//!
-//! For more details on the inner workings of raw calls and storage cache
-//! management, see the documentation for [RawCall::call] and
-//! [ReentrantCallHandler::flush_storage_cache].
-//!
-//! [RawCall::call]: https://docs.rs/stylus-sdk/0.8.1/stylus_sdk/call/struct.RawCall.html#method.call
-//! [ReentrantCallHandler::flush_storage_cache]: https://docs.rs/stylus-sdk/0.8.1/stylus_sdk/call/struct.RawCall.html#method.flush_storage_cache
-
-use alloy_primitives::Address;
-use stylus_sdk::{call::RawCall, ArbResult};
-
-/// A trait for handling calls that may require special handling for reentrancy.
-///
-/// This trait defines the method
-/// [`ReentrantCallHandler::call_with_reentrant_handling`], which is intended to
-/// perform a contract call with safeguards against reentrancy issues. The
-/// behavior of the method can vary depending on whether the `reentrant` feature
-/// is enabled:
-///
-/// - When the `reentrant` feature is enabled, the
-///   [`ReentrantCallHandler::call_with_reentrant_handling`] method will ensure
-///   that the storage cache is flushed before making the contract call to avoid
-///   potential issues with aliasing storage during a reentrant call. This is
-///   considered unsafe due to potential aliasing of storage in the middle of a
-///   storage reference's lifetime. See the
-///   [ReentrantCallHandler::flush_storage_cache] method for more details on
-///   handling storage caches.
-/// - When the `reentrant` feature is not enabled, the method simply makes the
-///   call without any additional safeguards.
-///
-/// For more information on the safety of raw contract calls and storage
-/// management, see:
-/// - [RawCall::call]
-/// - [ReentrantCallHandler::flush_storage_cache]
-///
-/// [RawCall::call]: https://docs.rs/stylus-sdk/0.8.1/stylus_sdk/call/struct.RawCall.html#method.call
-/// [ReentrantCallHandler::flush_storage_cache]: https://docs.rs/stylus-sdk/0.8.1/stylus_sdk/call/struct.RawCall.html#method.flush_storage_cache
-pub trait ReentrantCallHandler {
-    /// Executes a contract call with reentrancy safeguards, returning the call
-    /// result.
-    ///
-    /// This method performs a raw call to another contract using the provided
-    /// `token` and `call_data`. The method behavior changes based on the
-    /// `reentrant` feature:
-    ///
-    /// - With the `reentrant` feature enabled, it flushes any cached storage
-    ///   values before the call to prevent storage aliasing.
-    /// - Without the `reentrant` feature, it makes the call directly without
-    ///   additional safeguards.
-    ///
-    /// # Arguments
-    ///
-    /// * `token` - The address of the contract being called.
-    /// * `call_data` - The encoded data for the contract call.
-    ///
-    /// # Errors
-    ///
-    /// * Returns [`stylus_sdk::ArbResult`] indicating the success or failure of
-    ///   the call.
-    fn call_with_reentrant_handling(
-        self,
-        token: Address,
-        call_data: &[u8],
-    ) -> ArbResult;
-}
-
-impl ReentrantCallHandler for RawCall {
-    fn call_with_reentrant_handling(
-        self,
-        token: Address,
-        call_data: &[u8],
-    ) -> ArbResult {
-        #[cfg(feature = "reentrant")]
-        unsafe {
-            self.flush_storage_cache().call(token, call_data)
-        }
-        #[cfg(not(feature = "reentrant"))]
-        {
-            self.call(token, call_data)
-        }
-    }
-}
diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index ef41ac869..57630685f 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -1836,9 +1836,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
 
 [[package]]
 name = "mini-alloc"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3dc09847999e8f92fb6ff6f3e11e9ac1b1976208aed3d6a3688d94132f4298"
+checksum = "2bb2aa3693a765fb59300b47151b0587b4058a73dec61f7fda974e160856e4d0"
 dependencies = [
  "cfg-if",
 ]
@@ -2883,9 +2883,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-core"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2434fc6bcabf9b7f1a3d5da44cfa34609b12e98e3fde3f3d0c4709e5726474a"
+checksum = "2586fda31f933cca8f1d90d3cdfb46d85e3e9c21351f0d6c25fbaba4804bf43e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -2895,9 +2895,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-proc"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c003efb32d59dc3f291f4a22c777e81e5dc699cdbcafeefd4a39598bd0c36e7a"
+checksum = "25f21ddceb4cf882b442f5f591f8c3bb8c1fc2b38059759ac55721d3af21850e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -2916,9 +2916,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-sdk"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df6cba6ce22094d368abca999750bde1eade17083d5037d036a9fb553cb04532"
+checksum = "5de0c762e897a961dfd004f589a113d8f36bdb464fba6d980d53ff5f0ce3e75e"
 dependencies = [
  "alloy-primitives",
  "alloy-sol-types",
@@ -2936,9 +2936,9 @@ dependencies = [
 
 [[package]]
 name = "stylus-test"
-version = "0.8.3"
+version = "0.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdedf2d3c35b94843379767025e94142deaa6919179c2e679953cf48da40924b"
+checksum = "78a9611edff24096c74bc3114bc5cd7988662f6855a5f2a23640d9f747b347ff"
 dependencies = [
  "alloy-primitives",
  "alloy-provider",
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index eafac225e..ec9b90de9 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -10,7 +10,7 @@ cargo-fuzz = true
 [dependencies]
 libfuzzer-sys = "0.4"
 motsu = "0.7.0"
-stylus-sdk = { version = "=0.8.3", default-features = false, features = [
+stylus-sdk = { version = "=0.8.4", default-features = false, features = [
     "mini-alloc",
 ] }
 alloy-primitives = { version = "=0.8.20", default-features = false }


Reviews:
user: login: bidzyyys
body: @0xNeshi we need at first bump `motsu` version. I will create a PR shortly.
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-10T07:43:58Z
user: login: 0xNeshi
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-10T07:58:07Z
user: login: bidzyyys
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-10T08:25:11Z
user: login: bidzyyys
body: LGTM!
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-10T08:25:24Z
user: login: qalisander
body: LGTM
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-10T08:34:07Z

Review comments:
diff_hunk: @@ -368,14 +372,17 @@ impl SafeErc20 {
         }
 
         let call = IErc20::allowanceCall { owner: address(), spender };
-        let result = RawCall::new()
-            .limit_return_data(0, 32)
-            .call_with_reentrant_handling(token, &call.abi_encode())
-            .map_err(|_| {
-                Error::SafeErc20FailedOperation(SafeErc20FailedOperation {
-                    token,
-                })
-            })?;
+        let result = unsafe {
path: contracts/src/token/erc20/utils/safe_erc20.rs
user: login: bidzyyys
body: Why do we need unsafe here?
created_at: 2025-04-10T07:43:11Z
author_association: COLLABORATOR
diff_hunk: @@ -368,14 +372,17 @@ impl SafeErc20 {
         }
 
         let call = IErc20::allowanceCall { owner: address(), spender };
-        let result = RawCall::new()
-            .limit_return_data(0, 32)
-            .call_with_reentrant_handling(token, &call.abi_encode())
-            .map_err(|_| {
-                Error::SafeErc20FailedOperation(SafeErc20FailedOperation {
-                    token,
-                })
-            })?;
+        let result = unsafe {
path: contracts/src/token/erc20/utils/safe_erc20.rs
user: login: 0xNeshi
body: `RawCall::call` is now unsafe by default
created_at: 2025-04-10T07:58:07Z
author_association: COLLABORATOR
diff_hunk: @@ -368,14 +372,17 @@ impl SafeErc20 {
         }
 
         let call = IErc20::allowanceCall { owner: address(), spender };
-        let result = RawCall::new()
-            .limit_return_data(0, 32)
-            .call_with_reentrant_handling(token, &call.abi_encode())
-            .map_err(|_| {
-                Error::SafeErc20FailedOperation(SafeErc20FailedOperation {
-                    token,
-                })
-            })?;
+        let result = unsafe {
path: contracts/src/token/erc20/utils/safe_erc20.rs
user: login: bidzyyys
body: Fair enough, thanks!
created_at: 2025-04-10T08:25:11Z
author_association: COLLABORATOR

PR comments:
user: login: netlify[bot]
created_at: 2025-04-10T07:40:43Z
body: ### <span aria-hidden="true">✅</span> Deploy Preview for *contracts-stylus* canceled.


|  Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | e0e2c0d36f83db8c633f4c9e09b90ab09df2f5c7 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/sites/contracts-stylus/deploys/67f7809aeafe6f0008df6bd3 |
author_association: NONE
user: login: codecov[bot]
created_at: 2025-04-10T07:44:37Z
body: ## [Codecov](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin) Report
Attention: Patch coverage is `58.33333%` with `10 lines` in your changes missing coverage. Please review.
> Project coverage is 86.8%. Comparing base [(`2c2574f`)](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/commit/2c2574f39e183795dbc04a308e9ef1fcfc475828?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin) to head [(`e0e2c0d`)](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/commit/e0e2c0d36f83db8c633f4c9e09b90ab09df2f5c7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin).
> Report is 1 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

| [Files with missing lines](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin) | Patch % | Lines |
|---|---|---|
| [contracts/src/token/erc20/utils/safe\_erc20.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Ftoken%2Ferc20%2Futils%2Fsafe_erc20.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy90b2tlbi9lcmMyMC91dGlscy9zYWZlX2VyYzIwLnJz) | 44.4% | [10 Missing :warning: ](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin) |

<details><summary>Additional details and impacted files</summary>


| [Files with missing lines](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin) | Coverage Δ | |
|---|---|---|
| [contracts/src/access/control.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Faccess%2Fcontrol.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy9hY2Nlc3MvY29udHJvbC5ycw==) | `97.0% <100.0%> (ø)` | |
| [contracts/src/token/common/erc2981.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Ftoken%2Fcommon%2Ferc2981.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy90b2tlbi9jb21tb24vZXJjMjk4MS5ycw==) | `98.7% <100.0%> (ø)` | |
| [contracts/src/token/erc1155/extensions/supply.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Ftoken%2Ferc1155%2Fextensions%2Fsupply.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy90b2tlbi9lcmMxMTU1L2V4dGVuc2lvbnMvc3VwcGx5LnJz) | `81.2% <100.0%> (ø)` | |
| [contracts/src/token/erc20/extensions/erc4626.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Ftoken%2Ferc20%2Fextensions%2Ferc4626.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy90b2tlbi9lcmMyMC9leHRlbnNpb25zL2VyYzQ2MjYucnM=) | `26.4% <100.0%> (ø)` | |
| [contracts/src/token/erc20/utils/safe\_erc20.rs](https://app.codecov.io/gh/OpenZeppelin/rust-contracts-stylus/pull/624?src=pr&el=tree&filepath=contracts%2Fsrc%2Ftoken%2Ferc20%2Futils%2Fsafe_erc20.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenZeppelin#diff-Y29udHJhY3RzL3NyYy90b2tlbi9lcmMyMC91dGlscy9zYWZlX2VyYzIwLnJz) | `50.3% <44.4%> (+0.3%)` | :arrow_up: |

</details>
author_association: NONE