Skip to content

Commit 5b74700

Browse files
fix: resolve no_std deployment conflicts while maintaining 23.9 KiB contract size
- Use conditional compilation #[cfg(not(any(feature = "std", feature = "export-abi")))] for no_std and panic handler - Allows stylus_sdk to use std during deployment phases while maintaining no_std for WASM builds - Successfully deployed to Arbitrum Sepolia at 0x7c56d119a916da6593e1fd8c1d010161f20afd70 - Contract size remains at 23.9 KiB (24,497 bytes), under 24 KiB deployment limit - Resolves duplicate panic handler and unresolved std module errors during deployment Co-Authored-By: ayush.suresh@dourolabs.xyz <byteSlayer31037@gmail.com>
1 parent 2a58ad8 commit 5b74700

File tree

1 file changed

+3
-3
lines changed
  • target_chains/stylus/contracts/wormhole/src

1 file changed

+3
-3
lines changed

target_chains/stylus/contracts/wormhole/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#![cfg_attr(not(feature = "std"), no_std, no_main)]
1+
#![cfg_attr(not(any(feature = "std", feature = "export-abi")), no_std)]
22
extern crate alloc;
33

4-
#[cfg(not(feature = "std"))]
4+
#[cfg(not(any(feature = "std", feature = "export-abi")))]
55
#[global_allocator]
66
static ALLOC: mini_alloc::MiniAlloc = mini_alloc::MiniAlloc::INIT;
77

8-
#[cfg(not(feature = "std"))]
8+
#[cfg(not(any(feature = "std", feature = "export-abi")))]
99
#[panic_handler]
1010
fn panic(_info: &core::panic::PanicInfo) -> ! {
1111
loop {}

0 commit comments

Comments
 (0)