Skip to content
Merged
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 skills/assets/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ SAC provides a smart-contract interface for Stellar Assets, enabling smart contr
# Get the SAC address for an asset
stellar contract asset deploy \
--asset USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN \
--source alice \
--source-account alice \
--network testnet
```

Expand Down
10 changes: 5 additions & 5 deletions skills/smart-contracts/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,24 @@ Full patterns (three storage types, auth variants, cross-contract calls, events,
## Build, deploy, invoke

```bash
# Build optimized WASM → target/wasm32-unknown-unknown/release/*.wasm
# Build optimized WASM → target/wasm32v1-none/release/*.wasm
stellar contract build

# Create and fund an identity (testnet)
stellar keys generate --global alice --network testnet --fund
stellar keys generate alice --network testnet --fund

# Deploy (constructor args go after the `--`)
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/my_contract.wasm \
--source alice \
--wasm target/wasm32v1-none/release/my_contract.wasm \
--source-account alice \
--network testnet \
-- \
--admin alice

# Invoke
stellar contract invoke \
--id CONTRACT_ID \
--source alice \
--source-account alice \
--network testnet \
-- \
increment
Expand Down
8 changes: 4 additions & 4 deletions skills/smart-contracts/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Import another contract's WASM to get a typed client:
```rust
mod token_contract {
soroban_sdk::contractimport!(
file = "../token/target/wasm32-unknown-unknown/release/token.wasm"
file = "../token/target/wasm32v1-none/release/token.wasm"
);
}

Expand Down Expand Up @@ -252,9 +252,9 @@ Worked examples: [soroban-examples](https://github.com/stellar/soroban-examples)
The 64KB limit is real and the release profile in [SKILL.md](SKILL.md#project-setup) is mandatory. If you still exceed it:

```bash
ls -la target/wasm32-unknown-unknown/release/*.wasm # check size
ls -la target/wasm32v1-none/release/*.wasm # check size
cargo install cargo-bloat
cargo bloat --release --target wasm32-unknown-unknown # find heavy deps
cargo bloat --release --target wasm32v1-none # find heavy deps
```

Then: split the contract, drop heavy dependencies, prefer `symbol_short!`, avoid large static data.
Expand All @@ -277,7 +277,7 @@ Fees are multidimensional (CPU instructions, ledger reads/writes, bytes, events,
| `cannot find macro println` / `std` errors | Missing `#![no_std]` | Add as first line of `lib.rs`; use SDK types |
| Calls fail after inactivity, data "missing" | Storage TTL expired → archived | Extend TTLs proactively; restore archived entries |
| Temporary data vanished | Wrong storage type | Use `persistent()` for data that must survive |
| `Error: identity "alice" not found` | CLI identity missing | `stellar keys generate --global alice --network testnet --fund` |
| `Error: identity "alice" not found` | CLI identity missing | `stellar keys generate alice --network testnet --fund` |
| `invalid argument format` on invoke | Wrong CLI arg syntax | Plain strings for addresses; JSON for complex types |
| `transaction simulation failed` | Soroban tx not simulated/assembled | Simulate, then `assembleTransaction` before signing |
| `tx_bad_auth` | Wrong network passphrase or signer | Match passphrase to network; check signing identity |
Expand Down
16 changes: 8 additions & 8 deletions skills/smart-contracts/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ let vault_id = env.register(VaultContract, ());

```bash
stellar container start local # or: docker run --rm -it -p 8000:8000 stellar/quickstart:latest --local
stellar keys generate --global test-account --network local --fund
stellar contract deploy --wasm target/wasm32-unknown-unknown/release/contract.wasm \
--source test-account --network local
stellar keys generate test-account --network local --fund
stellar contract deploy --wasm target/wasm32v1-none/release/contract.wasm \
--source-account test-account --network local
```

Endpoints: RPC `http://localhost:8000/soroban/rpc`, Horizon `http://localhost:8000`, passphrase `"Standalone Network ; February 2017"`.

## Testnet

```bash
stellar keys generate --global my-key --network testnet --fund
stellar contract deploy --wasm ... --source my-key --network testnet
stellar keys generate my-key --network testnet --fund
stellar contract deploy --wasm ... --source-account my-key --network testnet
```

- RPC: `https://soroban-testnet.stellar.org` · Horizon: `https://horizon-testnet.stellar.org`
Expand Down Expand Up @@ -207,7 +207,7 @@ Three techniques worth knowing; each is one command plus a doc link:
## Resource profiling

```bash
stellar contract invoke --id CONTRACT_ID --source alice --network testnet \
stellar contract invoke --id CONTRACT_ID --source-account alice --network testnet \
--send=no -- function_name --arg value
```

Expand All @@ -224,9 +224,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add wasm32-unknown-unknown
- run: rustup target add wasm32v1-none
- run: cargo test
- run: cargo build --release --target wasm32-unknown-unknown
- run: cargo build --release --target wasm32v1-none
```

For integration jobs, run `stellar/quickstart` as a service container and deploy with the CLI (`cargo install stellar-cli --locked`).
Expand Down
Loading