Skip to content

Commit

Permalink
remove panic handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
qalisander committed Oct 23, 2024
1 parent 5e14313 commit 3ace35d
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rand.workspace = true
std = []

[lib]
crate-type = ["lib", "cdylib"]
crate-type = ["lib"]

[lints]
workspace = true
6 changes: 0 additions & 6 deletions contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,3 @@ extern crate alloc;
pub mod access;
pub mod token;
pub mod utils;

#[cfg(all(target_arch = "wasm32", not(feature = "std")))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
2 changes: 1 addition & 1 deletion examples/access-control/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_std, no_main)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/token/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion examples/ecdsa/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_std, no_main)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion examples/erc20-permit/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion examples/erc20/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
2 changes: 1 addition & 1 deletion examples/erc721-consecutive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloy_primitives::{Address, U256};
Expand Down
2 changes: 1 addition & 1 deletion examples/erc721-metadata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::{string::String, vec::Vec};
Expand Down
2 changes: 1 addition & 1 deletion examples/erc721/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_main, no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down
8 changes: 1 addition & 7 deletions examples/merkle-proofs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![cfg_attr(not(feature = "std"), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand All @@ -14,12 +14,6 @@ use stylus_sdk::{
prelude::{entrypoint, public, sol_storage},
};

#[cfg(target_arch = "wasm32")]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}

sol! {
error MerkleProofInvalidMultiProofLength();
error MerkleProofInvalidRootChild();
Expand Down
2 changes: 1 addition & 1 deletion examples/ownable/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(not(test), no_std, no_main)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;

use alloc::vec::Vec;
Expand Down

0 comments on commit 3ace35d

Please sign in to comment.