diff --git a/arbitrator/langs/rust b/arbitrator/langs/rust index 1398a1b4a..f3d8d9dc1 160000 --- a/arbitrator/langs/rust +++ b/arbitrator/langs/rust @@ -1 +1 @@ -Subproject commit 1398a1b4a636801347876cf222cdc1d69c529556 +Subproject commit f3d8d9dc1cf7d7e14fbf63a6e701a2b1441e7395 diff --git a/arbitrator/stylus/tests/create/Cargo.lock b/arbitrator/stylus/tests/create/Cargo.lock index 3eb008301..527500b10 100644 --- a/arbitrator/stylus/tests/create/Cargo.lock +++ b/arbitrator/stylus/tests/create/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/erc20/Cargo.lock b/arbitrator/stylus/tests/erc20/Cargo.lock index 86708b5a4..ad14dc806 100644 --- a/arbitrator/stylus/tests/erc20/Cargo.lock +++ b/arbitrator/stylus/tests/erc20/Cargo.lock @@ -646,10 +646,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if 1.0.0", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -662,10 +663,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if 1.0.0", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/erc20/Cargo.toml b/arbitrator/stylus/tests/erc20/Cargo.toml index 88c44f1ae..859bfe50a 100644 --- a/arbitrator/stylus/tests/erc20/Cargo.toml +++ b/arbitrator/stylus/tests/erc20/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] alloy-primitives = "0.3.1" alloy-sol-types = "0.3.1" -stylus-sdk = { path = "../../../langs/rust/stylus-sdk" } +stylus-sdk = { path = "../../../langs/rust/stylus-sdk", features = ["reentrant"] } hex = "0.4.3" wee_alloc = "0.4.5" diff --git a/arbitrator/stylus/tests/erc20/src/main.rs b/arbitrator/stylus/tests/erc20/src/main.rs index 3f4de6527..730f9f6f3 100644 --- a/arbitrator/stylus/tests/erc20/src/main.rs +++ b/arbitrator/stylus/tests/erc20/src/main.rs @@ -36,7 +36,7 @@ sol_storage! { // Another contract we'd like to call sol_interface! { interface IMath { - function sum(uint256[] values) pure returns (string, uint256); + function sumValues(uint256[] values) pure returns (string, uint256); } } @@ -57,13 +57,13 @@ impl Weth { } // sums numbers - pub fn sum(values: Vec) -> Result<(String, U256), Vec> { + pub fn sum_values(values: Vec) -> Result<(String, U256), Vec> { Ok(("sum".into(), values.iter().sum())) } - // calls the sum() method from the interface + // calls the sum_values() method from the interface pub fn sum_with_helper(&self, helper: IMath, values: Vec) -> Result> { - let (text, sum) = helper.sum(self, values)?; + let (text, sum) = helper.sum_values(self, values)?; assert_eq!(&text, "sum"); Ok(sum) } diff --git a/arbitrator/stylus/tests/evm-data/Cargo.lock b/arbitrator/stylus/tests/evm-data/Cargo.lock index 2ad8082a7..fce7b0975 100644 --- a/arbitrator/stylus/tests/evm-data/Cargo.lock +++ b/arbitrator/stylus/tests/evm-data/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/evm-data/src/main.rs b/arbitrator/stylus/tests/evm-data/src/main.rs index 1f6776fc9..29bf69a0e 100644 --- a/arbitrator/stylus/tests/evm-data/src/main.rs +++ b/arbitrator/stylus/tests/evm-data/src/main.rs @@ -42,7 +42,7 @@ fn user_main(input: Vec) -> Result, Vec> { // Call burnArbGas let gas_left_before = evm::gas_left(); let ink_left_before = evm::ink_left(); - unsafe { RawCall::new().call(arb_test_addr, burn_call_data)? }; + RawCall::new().call(arb_test_addr, burn_call_data)?; let gas_left_after = evm::gas_left(); let ink_left_after = evm::ink_left(); diff --git a/arbitrator/stylus/tests/fallible/Cargo.lock b/arbitrator/stylus/tests/fallible/Cargo.lock index 0390292af..0d67d0f66 100644 --- a/arbitrator/stylus/tests/fallible/Cargo.lock +++ b/arbitrator/stylus/tests/fallible/Cargo.lock @@ -435,10 +435,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -451,10 +452,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/keccak-100/Cargo.lock b/arbitrator/stylus/tests/keccak-100/Cargo.lock index d6cb6e6e6..94021ec62 100644 --- a/arbitrator/stylus/tests/keccak-100/Cargo.lock +++ b/arbitrator/stylus/tests/keccak-100/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/keccak/Cargo.lock b/arbitrator/stylus/tests/keccak/Cargo.lock index 34a5fc54e..422729bfe 100644 --- a/arbitrator/stylus/tests/keccak/Cargo.lock +++ b/arbitrator/stylus/tests/keccak/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/log/Cargo.lock b/arbitrator/stylus/tests/log/Cargo.lock index bbf34c89b..3481bf846 100644 --- a/arbitrator/stylus/tests/log/Cargo.lock +++ b/arbitrator/stylus/tests/log/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/multicall/Cargo.lock b/arbitrator/stylus/tests/multicall/Cargo.lock index ca860e123..c1a831172 100644 --- a/arbitrator/stylus/tests/multicall/Cargo.lock +++ b/arbitrator/stylus/tests/multicall/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/multicall/Cargo.toml b/arbitrator/stylus/tests/multicall/Cargo.toml index c9c388b08..2ab5728d1 100644 --- a/arbitrator/stylus/tests/multicall/Cargo.toml +++ b/arbitrator/stylus/tests/multicall/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -stylus-sdk = { path = "../../../langs/rust/stylus-sdk" } +stylus-sdk = { path = "../../../langs/rust/stylus-sdk", features = ["reentrant"] } hex = "0.4.3" [profile.release] diff --git a/arbitrator/stylus/tests/multicall/src/main.rs b/arbitrator/stylus/tests/multicall/src/main.rs index a9c763eb2..ebb784e04 100644 --- a/arbitrator/stylus/tests/multicall/src/main.rs +++ b/arbitrator/stylus/tests/multicall/src/main.rs @@ -10,7 +10,7 @@ use stylus_sdk::{ prelude::*, }; -#[entrypoint(allow_reentrancy = true)] +#[entrypoint] fn user_main(input: Vec) -> Result, Vec> { let mut input = input.as_slice(); let count = input[0]; diff --git a/arbitrator/stylus/tests/read-return-data/Cargo.lock b/arbitrator/stylus/tests/read-return-data/Cargo.lock index f08f053af..e2aa95632 100644 --- a/arbitrator/stylus/tests/read-return-data/Cargo.lock +++ b/arbitrator/stylus/tests/read-return-data/Cargo.lock @@ -436,10 +436,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -452,10 +453,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/read-return-data/src/main.rs b/arbitrator/stylus/tests/read-return-data/src/main.rs index 976bbb081..3f13deff1 100644 --- a/arbitrator/stylus/tests/read-return-data/src/main.rs +++ b/arbitrator/stylus/tests/read-return-data/src/main.rs @@ -40,21 +40,17 @@ fn user_main(input: Vec) -> Result, Vec> { let safe_offset = offset.min(call_data.len()); if call_type == 2 { - unsafe { - RawCall::new() - .limit_return_data(offset, size) - .call(precompile, call_data)? - }; + RawCall::new() + .limit_return_data(offset, size) + .call(precompile, call_data)?; } for _ in 0..count { let data = match call_type { - 0 => unsafe { RawCall::new().call(precompile, call_data)? }, - 1 => unsafe { - RawCall::new() - .limit_return_data(offset, size) - .call(precompile, call_data)? - }, + 0 => RawCall::new().call(precompile, call_data)?, + 1 => RawCall::new() + .limit_return_data(offset, size) + .call(precompile, call_data)?, 2 => contract::read_return_data(offset, Some(size)), _ => error!("unknown call_type {call_type}"), }; diff --git a/arbitrator/stylus/tests/sdk-storage/Cargo.lock b/arbitrator/stylus/tests/sdk-storage/Cargo.lock index f2710a29b..78828b9d7 100644 --- a/arbitrator/stylus/tests/sdk-storage/Cargo.lock +++ b/arbitrator/stylus/tests/sdk-storage/Cargo.lock @@ -449,10 +449,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if 1.0.0", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -465,10 +466,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if 1.0.0", "derivative", "fnv", "hex", diff --git a/arbitrator/stylus/tests/storage/Cargo.lock b/arbitrator/stylus/tests/storage/Cargo.lock index 72e4cc16e..503ba8cf1 100644 --- a/arbitrator/stylus/tests/storage/Cargo.lock +++ b/arbitrator/stylus/tests/storage/Cargo.lock @@ -435,10 +435,11 @@ dependencies = [ [[package]] name = "stylus-proc" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "convert_case 0.6.0", "lazy_static", "proc-macro2", @@ -451,10 +452,11 @@ dependencies = [ [[package]] name = "stylus-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "alloy-primitives", "alloy-sol-types", + "cfg-if", "derivative", "fnv", "hex",