Skip to content

docs: correct Token-2022 extension policy and credit Moonsong Labs#151

Merged
dev-jodee merged 1 commit into
mainfrom
docs/correct-t22-extension-policy
Jun 3, 2026
Merged

docs: correct Token-2022 extension policy and credit Moonsong Labs#151
dev-jodee merged 1 commit into
mainfrom
docs/correct-t22-extension-policy

Conversation

@dev-jodee
Copy link
Copy Markdown
Collaborator

Summary

  • Correct the README's Token-2022 extension claim: the program only rejects a configured `TransferHook` (hook `authority` or `program_id` set), not the seven extensions previously listed. The other six error codes (`MintHasPermanentDelegate`, `MintHasTransferFee`, etc.) are reserved and never fire — see `program/src/instructions/helpers/token.rs` `validate_mint_extensions`.
  • Add an Acknowledgments section crediting Moonsong Labs for the initial design and implementation.

Test Plan

  • Docs-only change. Behavior is already covered by `tests/integration-tests/src/test_initialize_subscription_authority.rs` (`initialize_subscription_authority_token_2022`), which asserts PermanentDelegate / TransferFee / unconfigured-TransferHook mints succeed and a configured TransferHook is rejected.

The README listed seven extensions as rejected during SA initialization,
but the program only rejects a configured TransferHook (hook authority or
program_id set). The other six error codes are reserved and never fire.

Also add an Acknowledgments section crediting Moonsong Labs for the
initial design and implementation.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 3, 2026

Greptile Summary

This PR corrects the README's Token-2022 extension policy and adds an Acknowledgments section. The previous text incorrectly listed seven rejected extensions; the actual validate_mint_extensions function in program/src/instructions/helpers/token.rs only checks for extension type 14 (TransferHook) and only rejects it when any of its 64 bytes are non-zero (i.e., when the hook authority or program_id is set).

  • README correction: Replaces the inaccurate seven-extension list with the precise rule: only a configured TransferHook is rejected; an inert one (both fields unset/zero) is allowed. This matches the existing wording already in CLAUDE.md and the actual on-chain logic.
  • Acknowledgments section: Adds credit to Moonsong Labs for the initial design and implementation, inserted before the existing CI Pipeline section.

Confidence Score: 5/5

Documentation-only change with no modifications to program logic, state, or client code — safe to merge.

The updated README wording is consistent with both the actual validate_mint_extensions implementation in token.rs (which checks only extension type 14 and only rejects non-zero data) and the existing CLAUDE.md policy note. The Acknowledgments section is a straightforward prose addition. No code paths are touched.

No files require special attention.

Important Files Changed

Filename Overview
README.md Docs-only update: corrects Token-2022 extension rejection policy to match actual code behavior and adds Moonsong Labs acknowledgment. Both changes are accurate and consistent with CLAUDE.md and the implementation in token.rs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Token-2022 mint account] --> B{Has extensions?}
    B -- No extensions --> C[✅ Accepted]
    B -- Has extensions --> D[Iterate TLV entries]
    D --> E{ext_type == 0?}
    E -- Yes --> C
    E -- No --> F{ext_type == TransferHook\next_type == 14?}
    F -- No --> G[Skip extension]
    G --> D
    F -- Yes --> H{Any byte != 0 in\n64-byte extension data?}
    H -- No --> I[Inert hook:\nboth authority and\nprogram_id are unset]
    I --> C
    H -- Yes --> J[❌ MintHasTransferHook error\nConfigured hook rejected]
Loading

Reviews (1): Last reviewed commit: "docs: correct Token-2022 extension polic..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Compute Unit Report

Instruction Samples Min CUs Max CUs Avg CUs Est Cost (Low) [SOL] Est Cost (Med) [SOL] Est Cost (High) [SOL]
cancel_subscription 22 1720 2030 1919 0.000005000 0.000005076 0.000005959
close_subscription_authority 10 1803 1833 1806 0.000005000 0.000005072 0.000005903
create_fixed_delegation 41 3522 15522 5265 0.000005001 0.000005210 0.000007632
create_plan 97 3436 12436 4846 0.000005001 0.000005193 0.000007423
create_recurring_delegation 29 3553 9555 4487 0.000005001 0.000005179 0.000007243
delete_plan 9 359 359 359 0.000005000 0.000005014 0.000005179
init_subscription_authority 173 6226 20968 9187 0.000005002 0.000005367 0.000009593
resume_subscription 3 1723 1723 1723 0.000005000 0.000005068 0.000005861
revoke_delegation 19 255 519 353 0.000005000 0.000005014 0.000005176
subscribe 32 6485 16985 8273 0.000005002 0.000005330 0.000009136
transfer_fixed 9 5479 11466 7364 0.000005002 0.000005294 0.000008682
transfer_recurring 19 5591 14452 7229 0.000005002 0.000005289 0.000008614
transfer_subscription 10 5838 10341 7943 0.000005002 0.000005317 0.000008971
update_plan 22 424 503 477 0.000005000 0.000005019 0.000005238

Generated: 2026-06-03

@dev-jodee dev-jodee merged commit 468847b into main Jun 3, 2026
14 of 15 checks passed
@dev-jodee dev-jodee deleted the docs/correct-t22-extension-policy branch June 3, 2026 13:18
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.

1 participant