docs(stablecoin): document the CLOCK_01 clock account - #342
Merged
Conversation
The spec used `now` throughout without ever saying where it comes from, and omitted the clock account from every time-dependent instruction's input list. Adds §5.4 and corrects the nine affected lists.
0x-r4bbit
approved these changes
Aug 28, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the Stablecoin program design spec to explicitly document the source of now as the system CLOCK_01 account, and propagates that account through the instruction documentation where wall-clock time is required.
Changes:
- Adds §5.4 “Wall-clock time” explaining how programs read
nowviaCLOCK_01and the resulting account/post-state implications. - Updates affected instruction account lists and mermaid diagrams to include a trailing
clockaccount and fixes the corresponding account counts. - Updates the admin setter documentation to reflect that
set_stability_fee_per_millisecondrequires the clock account.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1164
to
1166
| subgraph In["Base inputs (2 + 0..2)"] | ||
| a1[admin<br/>auth, == admin_account_id] ~~~ a2[protocol_parameters<br/>write] ~~~ ax[stability_fee_accumulator<br/>write — only set_stability_fee] ~~~ ay[new_oracle<br/>read — only set_market_price_oracle] | ||
| end |
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.
nowis used throughout the spec but its source was never documented: it is thesystem
CLOCK_01account, passed as an ordinary account input.Adds §5.4 "Wall-clock time", and adds the
clockentry plus the correctedaccount count to the nine instructions that need it (mermaid diagrams included).
Verified against
artifacts/stablecoin-idl.json— §10.1, §10.2, §10.3 and§10.3a were each off by one.
§10.4, §10.6, §10.7, §10.8 and setter 10 are updated too, but aren't implemented
yet, so those entries document intent. Instructions that don't reference time
are unchanged.