Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ The non-fungible token implementation is designed to be compatible with existing

### WASM Compilation

- **Target**: `wasm32-unknown-unknown`
- **Target**: `wasm32v1-none`
- **Optimization**: Release builds with size optimization
- **No-std Environment**: Minimal runtime footprint

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ We provide a set of example contracts that demonstrate how to use the library. Y
2. `cd stellar-contracts/examples`
3. Take a look at the current folder, and select an example contract you are interested in. We will go with the `fungible-pausable` in this guide.
4. `cd fungible-pausable`
5. `cargo build --target wasm32-unknown-unknown --release`
6. Now, the `target/wasm32-unknown-unknown/release/` directory will contain the compiled contracts. In this case, `target/wasm32-unknown-unknown/release/fungible_pausable_example.wasm` is the compiled wasm file.
5. `cargo build --target wasm32v1-none --release`
6. Now, the `target/wasm32v1-none/release/` directory will contain the compiled contracts. In this case, `target/wasm32v1-none/release/fungible_pausable_example.wasm` is the compiled wasm file.
7. Deploying to the testnet is no different than any other contract. You can follow the instructions in the [Stellar documentation](https://developers.stellar.org/docs/build/smart-contracts/getting-started/deploy-to-testnet).


Expand Down
4 changes: 2 additions & 2 deletions packages/test-utils/default-impl-macro-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ version.workspace = true
crate-type = ["lib", "cdylib"]
doctest = false


[dev-dependencies]
# This crate is only used for testing, and not compatible with `wasm32` targets.
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
stellar-access = { workspace = true }
stellar-macros = { workspace = true }
Expand Down
13 changes: 13 additions & 0 deletions packages/test-utils/default-impl-macro-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@
//!
//! This crate is not intended for use in any other context. And this `lib.rs`
//! file is empty on purpose.

// A conditional attribute that applies `no_std` only for wasm targets.
// This prevents Cargo from implicitly injecting std::prelude imports into empty crates
// when building for wasm targets that don't support std (like wasm32v1-none).
#![cfg_attr(target_family = "wasm", no_std)]

// Panic handler required for `no_std` wasm targets.
// Halts execution by entering an infinite loop, causing a wasm trap.
#[cfg(all(target_family = "wasm", not(test)))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
7 changes: 2 additions & 5 deletions packages/test-utils/event-assertion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ publish = false
version.workspace = true

# This crate is only used for testing, and not compatible with `wasm32` targets.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.soroban-sdk]
workspace = true
features = ["testutils"]

[dependencies]
[target.'cfg(not(target_family = "wasm"))'.dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
stellar-tokens = { workspace = true }
Loading
Loading