feat(templates): implement smart contract template library (#332)#437
Open
Tboy123-emm wants to merge 1 commit into
Open
feat(templates): implement smart contract template library (#332)#437Tboy123-emm wants to merge 1 commit into
Tboy123-emm wants to merge 1 commit into
Conversation
…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
|
@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! 🚀 |
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
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
initialize,mint(admin-only),transfer,approve,transfer_from,burn,balance,allowancemint(admin-only),transfer(owner-only),approve,get_approved,owner_of,token_uri,burnstake,unstake,claim_rewards, configurablereward_ratein basis points per 1 000 ledgers#![no_std],{{PROJECT_NAME_PASCAL}}placeholder, module-level doc comment,#[cfg(test)]with ≥ 2 tests, READMETemplate versioning
changelogarray and asecurity_reviewobjectSecurityReview,ChangelogEntrywithserde(default)Testing framework —
starforge template test <name>cargo test; supports--verboseDocumentation generator —
starforge template docs <name> [--output FILE]Contribution guidelines —
TEMPLATE_CONTRIBUTING.mdSecurity review —
starforge template audit [name]Acceptance criteria
starforge template teststarforge template docsTEMPLATE_CONTRIBUTING.mdstarforge template audit+ metadataCloses #332