Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
116 lines (109 loc) · 5.84 KB
/
Copy pathCargo.toml
File metadata and controls
116 lines (109 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[workspace]
# Resolver 2 keeps dev-dependency features out of non-test builds. Without it a
# workspace-wide `cargo build --target wasm32-unknown-unknown` unifies
# `brain-storm-integration`'s dev-dependency on `brain-storm-shared` (default
# features, i.e. `contract`) into every other contract's copy, re-exporting
# `SharedContract`'s entry points from each contract's wasm.
resolver = "2"
members = [
"contracts/analytics",
"contracts/integration",
"contracts/token",
"contracts/shared",
"contracts/certificate",
"contracts/governance",
"contracts/credential_metadata",
"contracts/reputation",
"contracts/buyback",
"contracts/scholarship_fund",
"contracts/token_restrictions",
"contracts/liquidity_pool",
"contracts/grants",
"contracts/badges",
"contracts/nft",
"contracts/registry",
"contracts/market",
"contracts/dispute",
"contracts/royalty_distribution",
"contracts/escrow",
]
[workspace.dependencies]
# Soroban SDK - latest stable (resolves to 21.7.7 in Cargo.lock)
# Individual contracts may specify their own minimum versions; Cargo resolves
# to the highest compatible version across the workspace.
soroban-sdk = "21.7"
soroban-cli = "21.7"
# Common dependencies
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
anyhow = "1.0"
[profile.release]
opt-level = "z"
overflow-checks = true
lto = true
debug = false
strip = true
codegen-units = 1
panic = "abort"
[profile.dev]
opt-level = 0
debug = true
overflow-checks = true
# ── Code-quality enforcement ──────────────────────────────────────────────────
# rustfmt is configured via rustfmt.toml at the workspace root.
# Enforce in CI with: cargo fmt --all -- --check
# Format locally with: cargo fmt --all
#
# clippy is configured via clippy.toml at the workspace root.
# Enforce in CI with: cargo clippy --workspace -- -D warnings
# This configuration also adds -D warnings at runtime via workspace defaults
[workspace.metadata.fmt]
check_command = "cargo fmt --all -- --check"
format_command = "cargo fmt --all"
# ── Workspace-level lint configuration (#1199) ────────────────────────────────
# Selected clippy::pedantic lints enabled across all 19 contracts.
# See clippy.toml for the full rationale on lints that were SKIPPED.
#
# Each crate that inherits this workspace lint table via `[lints] workspace = true`
# will have these lints active. Individual allow-attributes with a comment
# justification are used at the call site when a lint fires on intentional code.
[workspace.lints.clippy]
# Correctness / subtle bugs
bool_to_int_with_if = "warn" # prefer `usize::from(cond)` over `if cond { 1 } else { 0 }`
cloned_instead_of_copied = "warn" # prefer `.copied()` for Copy types
default_trait_access = "warn" # prefer `Default::default()` over `SomeType::default()`
explicit_iter_loop = "warn" # prefer `for x in iter` over `for x in iter.into_iter()`
filter_map_next = "warn" # prefer `.find_map()` over `.filter_map().next()`
flat_map_option = "warn" # prefer `.filter_map()` over `.flat_map(|x| Some(x)...)`
if_not_else = "warn" # prefer positive conditions first
inconsistent_struct_constructor = "warn" # field order must match struct definition
inefficient_to_string = "warn" # avoid redundant `.to_string()` on already-owned strings
items_after_statements = "warn" # keep item definitions at the top of blocks
manual_assert = "warn" # prefer `assert!()` over `if cond { panic!(...) }`
manual_let_else = "warn" # prefer `let … else` over `match` with early return
manual_ok_or = "warn" # prefer `.ok_or()` over `match … { Some(v) => Ok(v), None => Err(e) }`
map_unwrap_or = "warn" # prefer `.unwrap_or_else()` over `.map().unwrap_or()`
match_bool = "warn" # prefer `if/else` over `match` on booleans
match_same_arms = "warn" # merge identical match arms
needless_continue = "warn" # remove redundant `continue` at end of loop
needless_pass_by_value = "warn" # prefer pass-by-reference when ownership is not needed
range_minus_one = "warn" # prefer `..end` over `..=end - 1`
range_plus_one = "warn" # prefer `..=end` over `..end + 1`
redundant_closure_for_method_calls = "warn" # prefer method references over wrapping closures
return_self_not_must_use = "warn" # builder-pattern methods should be `#[must_use]`
semicolon_if_nothing_returned = "warn" # add trailing `;` to expression statements
unnested_or_patterns = "warn" # prefer `A | B` over nested `match`
unused_self = "warn" # methods that don't use `self` should be free functions
used_underscore_binding = "warn" # using a `_`-prefixed variable suggests it's intentionally unused
# Lints kept at allow (would require large churn or are inapplicable):
# same_functions_in_if_blocks — not available in MSRV 1.70.0
# missing_errors_doc, missing_panics_doc — see clippy.toml rationale
# module_name_repetitions — ABI-breaking rename for TokenContract, etc.
# must_use_candidate — too noisy on entry-point fns
# wildcard_imports — soroban_sdk glob imports are idiomatic
# too_many_lines — contract fns are intentionally verbose
# struct_excessive_bools — on-chain state structs need bool fields
# cast_possible_truncation — required for SDK TTL/timestamp APIs
# cast_sign_loss — same as above
# cast_precision_loss — no float arithmetic in contracts