Skip to content

Write architecture decision records (ADRs) for key design choices #39

Description

@prodbycorne

Overview

Several non-obvious design decisions in the contracts lack documentation. Future contributors and auditors cannot determine whether a choice was intentional or accidental. Architecture Decision Records (ADRs) capture the why behind key choices.

ADRs Required

ADR-001: Dual Credit Systems (Boost/Stake vs Lock/Unlock)

  • Why does the pool have two independent credit accrual mechanisms?
  • When should a user use stake/unstake vs lock_assets/unlock_assets?
  • How are credits from both systems intended to be combined?

ADR-002: Factory-Deployed vs Standalone Pool Deployment

  • Why are pools deployed via a factory rather than standalone?
  • What is the security model for verifying a pool's authenticity (pool_wasm_hash check)?
  • Trade-offs of deterministic salt vs random salt

ADR-003: TTL Extension Strategy

  • Why are TTLs extended on every read/write rather than only on writes?
  • What are the cost implications?
  • What happens to user data when TTL expires?

ADR-004: Credit Accrual without On-Chain Token Minting

  • Why do credits exist as a counter rather than as minted tokens?
  • How does the credit-to-reward conversion work (planned or current)?
  • Why not use a standard Soroban token for credits?

ADR-005: Pause Mechanism Scope

  • Why does pause block user functions but not admin functions?
  • What is the intended recovery procedure after a pause?

Format

Store ADRs as docs/decisions/ADR-00N-title.md using the standard format:

# ADR-NNN: Title
## Status: Accepted
## Context
## Decision
## Consequences

Acceptance Criteria

  • docs/decisions/ directory created
  • All 5 ADRs above written
  • Each ADR includes Status, Context, Decision, and Consequences sections
  • docs/README.md links to all ADRs
  • ADR-002 includes a diagram or table of the factory-pool relationship

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaigndocumentationImprovements or additions to documentation

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