Instructions for AI coding agents contributing to MiHashport-Contract.
- Stack: Rust (edition 2021) Soroban smart contracts, Cargo workspace,
soroban-sdkv22. Toolchain pinned inrust-toolchain.toml(wasm32v1-nonetarget included). - Build:
- Native (fast iteration):
cargo build - Contract WASM (what actually deploys):
cargo build --target wasm32v1-none --release
- Native (fast iteration):
- Test:
cargo test(unit tests live in each contract'ssrc/test.rs, usingsoroban_sdk::testutils). - Important directories:
contracts/<name>/src/lib.rs— contract entrypoints, storage keys (DataKeyenum), error enum (Error).contracts/<name>/src/test.rs— that contract's tests.docs/PLAN.md— the 6-phase roadmap; every issue traces back to a line item here.
- Root
Cargo.tomllists workspace members — add new contracts there when creating one.
- Each issue should be addressed in its own commit.
- The PR description must include the appropriate
Closes #<issue>tags for every issue addressed. - Commit messages must be single-line only.
- Do not add a
Co-authored-byline. - Keep the implementation minimal and focused on the issue at hand.
- Integrate changes cleanly with the current codebase structure — read the surrounding code (the rest of the contract, its tests, sibling contracts) before writing.
- Avoid over-engineering or assuming unfinished parts are stable. Phases in
docs/PLAN.mdafter the one you're working in may not exist yet — don't build against contracts or entrypoints that haven't been implemented. - The project is under active development: expect bugs, missing pieces, and incomplete implementations. Do not "fix" things outside your issue's scope, even if you notice something that looks wrong.
- The test suite may or may not be reliable at any given time. If tests exist and run, use them; if they don't, do not assume passing behavior — prioritize clean, correct, minimal code either way.
- Keep the scope as small as possible while still fully addressing each issue.
- Do NOT commit or push any implementation notes, plan files, or scratch
markdown (e.g.
IMPLEMENTATION.md,NOTES.md,TODO.md,*.plan.md). These stay local only — they are gitignored for a reason.