Description
Document the contract architecture and the subscriber/merchant interaction flow, including why subscribers approve the token contract directly rather than through subscribe(). This is not obvious from reading the code alone and will confuse new contributors without it.
Requirements and Context
- The original design had subscribe() call token.approve() internally, which caused persistent Unauthorized errors due to a Soroban limitation: cross-contract nested auth is unreliable
- The correct pattern - and the one currently implemented - has subscribers call approve directly on the token contract as a separate prior transaction, before calling subscribe()
- This architectural decision should be documented so contributors do not attempt to "fix" it by reintroducing nested auth
- The protocol uses flat recurring billing in v1 (not usage-metering) as a deliberate scope decision - this should be documented as intentional, not a missing feature
- Must cover the full lifecycle: create_plan -> approve -> subscribe -> charge
Suggested Execution
Branch name: docs/architecture
Files to touch:
- docs/ARCHITECTURE.md (new)
- README.md (add link to new doc)
Example commit message: docs(architecture): document contract architecture and interaction flow
Test and Commit
Guidelines
Complexity
Trivial - 100 points
Description
Document the contract architecture and the subscriber/merchant interaction flow, including why subscribers approve the token contract directly rather than through subscribe(). This is not obvious from reading the code alone and will confuse new contributors without it.
Requirements and Context
Suggested Execution
Branch name: docs/architecture
Files to touch:
Example commit message: docs(architecture): document contract architecture and interaction flow
Test and Commit
Guidelines
Complexity
Trivial - 100 points