Restructure into a Cargo workspace (prep for factory/router/LP-token contracts) - #103
Merged
0takuc0mrade merged 3 commits intoJul 9, 2026
Merged
Conversation
Relocates the existing crate to contracts/pool/ and adds a workspace root Cargo.toml, laying the groundwork for the additional contracts (LP token, factory, router) that will live alongside it. Behavior is unchanged: the workspace's shared target/ dir means the WASM artifact still lands at target/wasm32v1-none/release/nodus_protocol_amm.wasm, and every existing cargo build/test/clippy/fmt invocation still works unmodified from the repo root. [profile.release] moved to the workspace root, since Cargo only honors it there for workspace members. soroban-sdk's version is now declared once via [workspace.dependencies] so every future contract crate stays in lockstep.
Bare 'cargo fmt' run from a virtual-manifest workspace root isn't guaranteed to cover every member as more contracts are added; --all makes that explicit. Matches the Makefile's lint target, which already used --all.
Also fixes two stale references left over from before the crate was renamed nodus-protocol-amm: the wasm32-unknown-unknown target (CI and rust-toolchain.toml have used wasm32v1-none for a while) and the nodus_amm.wasm filename (actual artifact is nodus_protocol_amm.wasm).
emwulrd
pushed a commit
to emwulrd/Nodus-Protocol-Smart-Contract
that referenced
this pull request
Jul 20, 2026
emwulrd
pushed a commit
to emwulrd/Nodus-Protocol-Smart-Contract
that referenced
this pull request
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of a series of PRs to partition this repo into multiple contracts (factory, standalone LP token, router) instead of the single monolithic
NodusAmmpool contract it has today. This PR is purely structural — no contract behavior changes — and lays the groundwork the others depend on.contracts/pool/, adds a workspace rootCargo.toml.[profile.release]moved to the workspace root (Cargo only honors it there for members);soroban-sdk's version is now declared once via[workspace.dependencies]so every future contract crate stays in lockstep.target/dir means the WASM artifact still lands at the exact same path as before (target/wasm32v1-none/release/nodus_protocol_amm.wasm), and every existingcargo build/test/clippy/fmtinvocation still works unmodified from the repo root — verified locally.cargo fmt -- --check→cargo fmt --all -- --check. Both currently behave identically with only one workspace member, but barecargo fmtisn't guaranteed to cover every member as more contracts are added, and this also matches what the Makefile'slinttarget already did.wasm32-unknown-unknown→wasm32v1-none,nodus_amm.wasm→nodus_protocol_amm.wasm) — noticed while editing the same section, not otherwise related to this PR.Test plan
cargo build --release --target wasm32v1-none— succeeds, same output pathcargo test --features testutils— 52 passed, 0 failed (unchanged)cargo clippy --all-targets --features testutils -- -D warnings— cleancargo fmt --all -- --check— cleanNote on account access
Opened from my personal fork — my nodus-protocol org access was revoked partway through this work (confirmed via
gh api repos/.../permissions). Same situation as the mobile-repo PRs from earlier today.What's next