Skip to content

Latest commit

 

History

History
48 lines (43 loc) · 2.29 KB

File metadata and controls

48 lines (43 loc) · 2.29 KB

AGENTS.md

Instructions for AI coding agents contributing to MiHashport-Contract.

Repo context

  • Stack: Rust (edition 2021) Soroban smart contracts, Cargo workspace, soroban-sdk v22. Toolchain pinned in rust-toolchain.toml (wasm32v1-none target included).
  • Build:
    • Native (fast iteration): cargo build
    • Contract WASM (what actually deploys): cargo build --target wasm32v1-none --release
  • Test: cargo test (unit tests live in each contract's src/test.rs, using soroban_sdk::testutils).
  • Important directories:
    • contracts/<name>/src/lib.rs — contract entrypoints, storage keys (DataKey enum), 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.toml lists workspace members — add new contracts there when creating one.

Rules

  • 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-by line.
  • 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.md after 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.