Skip to content

feat(templates): implement smart contract template library (#332)#437

Open
Tboy123-emm wants to merge 1 commit into
Nanle-code:masterfrom
Tboy123-emm:feat/issue-332-smart-contract-template-library
Open

feat(templates): implement smart contract template library (#332)#437
Tboy123-emm wants to merge 1 commit into
Nanle-code:masterfrom
Tboy123-emm:feat/issue-332-smart-contract-template-library

Conversation

@Tboy123-emm

Copy link
Copy Markdown

Summary

Implements the full Smart Contract Template Library as described in issue #332. Adds audited templates, versioning, a testing framework, a documentation generator, contribution guidelines, and a security review process.


Changes

Audited template library

  • sep41-token — full SEP-41 fungible token: initialize, mint (admin-only), transfer, approve, transfer_from, burn, balance, allowance
  • nft — non-fungible token: mint (admin-only), transfer (owner-only), approve, get_approved, owner_of, token_uri, burn
  • staking — DeFi staking/yield: stake, unstake, claim_rewards, configurable reward_rate in basis points per 1 000 ledgers
  • All templates: #![no_std], {{PROJECT_NAME_PASCAL}} placeholder, module-level doc comment, #[cfg(test)] with ≥ 2 tests, README

Template versioning

  • All 12 registry entries now carry a changelog array and a security_review object
  • New Rust types: SecurityReview, ChangelogEntry with serde(default)

Testing framework — starforge template test <name>

  • Locates template directory and runs cargo test; supports --verbose

Documentation generator — starforge template docs <name> [--output FILE]

  • Renders Markdown from registry metadata: badges, metadata table, changelog, usage

Contribution guidelines — TEMPLATE_CONTRIBUTING.md

  • Checklist, template structure, registry fields, tag taxonomy, security review SLA, version-bumping rules, PR process

Security review — starforge template audit [name]

  • Tabular display of audit status, findings, and score for one or all templates

Acceptance criteria

Criterion Status
Comprehensive template library ✓ 3 new audited templates + 9 existing
Versioning and updates ✓ changelog + security_review in all 12 entries
Testing framework starforge template test
Documentation generator starforge template docs
Contribution guidelines TEMPLATE_CONTRIBUTING.md
Security review process starforge template audit + metadata

Closes #332

…e#332)

Comprehensive template library with audited templates, versioning,
testing framework, docs generator, contribution guidelines, and
security review process.

Audited template library
- Add sep41-token: full SEP-41 fungible token (mint, transfer, burn,
  approve, transfer_from) with test suite
- Add nft: non-fungible token with mint, transfer, approve, burn, URI
  metadata and test suite
- Add staking: DeFi staking/yield contract with configurable reward
  rate and test suite
- All templates use #![no_std] + soroban_sdk patterns and include
  README.md files

Template versioning
- registry.json: add 'changelog' array and 'security_review' object
  to all 12 template entries
- registry.schema.json: document the new fields
- TemplateEntry struct: add SecurityReview + ChangelogEntry types with
  serde(default) for backward compatibility

Testing framework
- New 'starforge template test <name>' command: locates template dir
  (builtin examples path or registry path) and runs cargo test

Documentation generator
- New 'starforge template docs <name> [--output FILE]' command: renders
  a Markdown doc page from registry metadata (badges, metadata table,
  security review, changelog, usage snippet)

Contribution guidelines
- TEMPLATE_CONTRIBUTING.md: quick-start checklist, template structure,
  Cargo.toml requirements, registry entry field reference, tag taxonomy,
  security review criteria and SLA, version bumping rules, PR process

Security review process
- New 'starforge template audit [name]' command: tabular display of
  security_review status, findings count, and score for each template
- SecurityReview struct in TemplateEntry covers status, auditor,
  audited_at, findings, score
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Tboy123-emm Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D-16: Implement Smart Contract Template Library

1 participant