Skip to content

Add docs for how to add a new contract function following existing patterns #503

Description

@Chucks1093

Summary

Contributors adding new functionality to the contracts repo have no documented reference for the expected patterns: where to put the function, how to handle authorization, how to emit events, and what the CI checks require before a PR can be merged.

Scope

  • Document the file structure: which module a new function belongs in based on its category (trade, config, view, admin)
  • Explain the authorization pattern: when to use require_auth and which address to authorize against
  • Show the event emission pattern: how to define a new event struct and emit it
  • List what CI checks must pass: cargo fmt, cargo clippy, cargo test

Acceptance Criteria

  • Module placement rule is documented for each function category
  • Authorization pattern is explained with an example
  • Event emission pattern is shown with a worked example
  • CI requirements are listed clearly

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions