Skip to content

Commit ebc07f2

Browse files
authored
Merge pull request #1139 from Enniwealth/feat/issues-932-903-905-909
Fix for #932 #903 #905 #909
2 parents 16d8b4c + e716329 commit ebc07f2

25 files changed

Lines changed: 1309 additions & 229 deletions

‎.github/dependabot.yml‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ updates:
1919
cargo-minor-and-patch:
2020
update-types: [minor, patch]
2121
ignore:
22-
# Deliberately exact-pinned in Cargo.toml (`=x.y.z`), mostly to hold the
23-
# 1.80 MSRV; bump these by hand after checking the MSRV job.
24-
- dependency-name: clap
25-
- dependency-name: clap_complete
22+
# Remaining exact pins in Cargo.toml (justified next to each `=` entry).
23+
# Caret-ranged crates (clap, toml, colored, dirs, clap_complete) may update.
2624
- dependency-name: clap_mangen
27-
- dependency-name: toml
28-
- dependency-name: colored
29-
- dependency-name: dirs
25+
- dependency-name: comfy-table
3026
- dependency-name: stellar-strkey
3127
- dependency-name: zxcvbn
3228
# time >= 0.3.46 requires Rust 1.88, above our 1.80 MSRV (see deny.toml).

‎.github/workflows/latest-deps.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Latest dependency resolution (scheduled)
2+
3+
# Exercises caret ranges without --locked so MSRV-compatible upgrades surface
4+
# before Dependabot PRs. See CONTRIBUTING.md "MSRV policy" and issue #903.
5+
6+
name: Latest deps
7+
8+
on:
9+
schedule:
10+
# Mondays 06:15 UTC
11+
- cron: "15 6 * * 1"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
latest-deps:
19+
name: cargo update + check (no lock)
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust stable
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
components: rustfmt, clippy
28+
29+
- name: Cache cargo
30+
uses: Swatinem/rust-cache@v2
31+
32+
- name: Update dependencies within caret ranges
33+
run: cargo update
34+
35+
- name: Check workspace against refreshed lockfile
36+
run: cargo check --workspace --all-targets
37+
38+
- name: Run library/unit tests
39+
run: cargo test --workspace --lib --bins
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Native deploy / SAC regression tests (#905 / #909)
2+
3+
name: Native deploy smoke
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- "src/utils/soroban_native.rs"
9+
- "src/commands/deploy.rs"
10+
- "src/commands/asset.rs"
11+
- "src/utils/soroban.rs"
12+
- "tests/sac_contract_id.rs"
13+
- "tests/watch_only_wallet.rs"
14+
- ".github/workflows/native-deploy-smoke.yml"
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
vectors:
22+
name: SAC + watch-only tests
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
- name: Install system dependencies
28+
run: sudo apt-get update && sudo apt-get install -y libudev-dev
29+
- name: SAC contract-id fixtures
30+
run: cargo test --locked --test sac_contract_id
31+
- name: Watch-only wallet CLI
32+
run: cargo test --locked --test watch_only_wallet
33+
- name: Native deploy unit tests
34+
run: cargo test --locked soroban_native::

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,4 @@ test_snapshots/
200200

201201
# Python bytecode (release/notes script tests)
202202
__pycache__/
203+
.vendor/

‎CONTRIBUTING.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,19 @@ Welcome to StarForge! This guide will help you get started contributing to the p
3838

3939
### Rust
4040

41-
StarForge requires **Rust 1.80 or later**.
41+
StarForge requires **Rust 1.80 or later** (`rust-version` in `Cargo.toml`).
42+
43+
#### MSRV policy
44+
45+
- The Minimum Supported Rust Version (MSRV) tracks approximately **N−3** stable
46+
releases (today: 1.80 while latest stable is ~1.83+).
47+
- MSRV bumps happen only in **minor** StarForge releases, never in patch releases.
48+
- Exact dependency pins (`=x.y.z`) are avoided unless a justification comment sits
49+
next to the pin (usually an MSRV or API-stability hold). Prefer caret ranges and
50+
rely on `.cargo/config.toml` `incompatible-rust-versions = "fallback"` plus the
51+
weekly `latest-deps` CI job to catch drift.
52+
- When raising MSRV, update `Cargo.toml` `rust-version`, the `MSRV (Rust …)` CI
53+
job, `CONTRIBUTING.md`, and `docs/BRANCH_PROTECTION.md` in the same PR.
4254

4355
#### Install Rust
4456

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,18 @@ single_match = "allow"
8181
await_holding_lock = "allow"
8282

8383
[dependencies]
84-
clap = { version = "=4.4.18", features = ["derive", "color"] }
84+
# Caret ranges: MSRV-aware resolution (see `.cargo/config.toml` and CONTRIBUTING.md).
85+
clap = { version = "4.4", features = ["derive", "color"] }
8586
serde = { version = "1.0", features = ["derive"] }
8687
serde_json = "1.0"
8788
regex = "1.10"
88-
toml = "=0.8.8"
89+
toml = "0.8"
8990
semver = "1.0"
9091
spdx = "0.13.5"
91-
colored = "=2.1.0"
92+
colored = "2.1"
93+
# Pinned: 7.1.2+ pulls unicode-width 0.2 which requires a newer MSRV than 1.80.
9294
comfy-table = "=7.1.1"
93-
dirs = "=5.0.1"
95+
dirs = "5.0"
9496
anyhow = "1.0"
9597
thiserror = "2.0"
9698
chrono = { version = "0.4", features = ["serde"] }
@@ -101,10 +103,11 @@ tokio = { version = "1", features = ["full"] }
101103
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }
102104
futures-util = "0.3"
103105
ctrlc = "3.4"
104-
clap_complete = "=4.4.10"
106+
clap_complete = "4.4"
105107
dialoguer = { version = "0.11", features = ["fuzzy-select", "password"] }
106108
aes-gcm = "0.10.3"
107109
argon2 = "0.5.3"
110+
# Pinned: strkey encoding must stay aligned with stellar-xdr 22.x fixtures.
108111
stellar-strkey = "=0.0.10"
109112
stellar-xdr = { version = "22.0.0", features = ["serde"] }
110113
base64 = "0.21"
@@ -116,6 +119,7 @@ wasmtime = { version = "24.0.7", default-features = false, features = ["cranelif
116119
uuid = { version = "1.6.1", features = ["v4", "serde"] }
117120
hidapi = { version = "2.6.5", optional = true }
118121
trezor-client = { version = "0.1.5", default-features = false, features = ["stellar"], optional = true }
122+
# Pinned: 3.2+ bumps MSRV past 1.80.
119123
zxcvbn = "=3.1.1"
120124
zeroize = { version = "1", features = ["derive"] }
121125
hex = "0.4"
@@ -174,7 +178,8 @@ opt-level = 3
174178
lto = true
175179

176180
[build-dependencies]
177-
clap = { version = "4.4.18", features = ["derive"] }
178-
clap_complete = "4.4.10"
181+
clap = { version = "4.4", features = ["derive"] }
182+
clap_complete = "4.4"
183+
# Pinned: clap_mangen 0.2.31+ requires clap 4.5 APIs not guaranteed on MSRV 1.80.
179184
clap_mangen = "=0.2.30"
180185
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-serde_json-1"] }

‎docs/MIGRATING_FROM_STELLAR_CLI.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ writing. Check `starforge <command> --help` for anything that has changed.
178178
`stellar cache` have no StarForge equivalent. (`starforge tx` covers
179179
payments, batches, history and fee stats.)
180180
- **State maintenance.** `stellar contract extend`, `restore`, `fetch`, `id`,
181-
`alias` and `asset deploy` (Stellar Asset Contracts) have no equivalent.
181+
`alias` has a StarForge equivalent (`starforge alias`). Stellar Asset Contracts
182+
use `starforge asset contract-id` / `starforge asset wrap`.
182183
- **Default identity.** There's no `keys use`: pass `--wallet` explicitly.
183184
- **More binding languages.** stellar-cli also generates Java, Flutter, Swift
184185
and PHP clients.

‎docs/native-deploy.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Native Soroban deploy (no stellar CLI)
2+
3+
`starforge deploy run --execute` uploads WASM and creates the contract instance
4+
entirely over Soroban RPC:
5+
6+
1. `UploadContractWasm` (skipped when the WASM hash is already on-chain)
7+
2. Simulate → assemble footprint / resource fee / auth
8+
3. Sign with the selected wallet
9+
4. `sendTransaction` + poll to SUCCESS
10+
5. `CreateContract` / `CreateContractV2` (with `--constructor-arg` when needed)
11+
12+
```bash
13+
starforge deploy run --wasm target/wasm32-unknown-unknown/release/hello.wasm \
14+
--wallet deployer --network testnet --execute
15+
16+
# Machine-readable contract id
17+
starforge deploy run --wasm hello.wasm --wallet deployer --execute --json
18+
19+
# Print the legacy stellar CLI command instead
20+
starforge deploy run --wasm hello.wasm --wallet deployer --print-only
21+
```
22+
23+
Constructor arguments use `type:value` forms (`address:G…`, `u32:1`, `string:hi`,
24+
`xdr:<base64 ScVal>`).

‎docs/stellar-asset-contracts.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Stellar Asset Contracts (SAC)
2+
3+
Compute the deterministic Soroban contract id for a classic asset, or wrap
4+
(deploy) the SAC when it is missing.
5+
6+
```bash
7+
# Native XLM
8+
starforge asset contract-id XLM --network testnet
9+
10+
# Issued asset
11+
starforge asset contract-id USDC:G... --network testnet --json
12+
13+
# Deploy / wrap if absent (pays fees from --wallet)
14+
starforge asset wrap USDC:G... --wallet deployer --network testnet --yes
15+
```
16+
17+
Use the SAC id with token templates and DeFi contracts that speak the SEP-41
18+
token interface — for example after wrapping USDC, pass the `C…` id into a
19+
token client instead of hand-computing the preimage.
20+
21+
See also: `starforge deploy run --execute` for native WASM deploy without the
22+
stellar CLI.

0 commit comments

Comments
 (0)