Skip to content

feat: add set_account_index instruction#28

Open
0xLeo-sqds wants to merge 1 commit intopoliciesfrom
feat/set-account-index
Open

feat: add set_account_index instruction#28
0xLeo-sqds wants to merge 1 commit intopoliciesfrom
feat/set-account-index

Conversation

@0xLeo-sqds
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new set_account_index instruction that allows a hardcoded paymaster key to set the account_utilization field on any Settings account
  • The instruction validates the index is capped at 249 (FREE_ACCOUNT_MAX_INDEX) and emits a SetAccountIndexEvent via self-CPI containing the full Settings account data
  • Includes a testing paymaster keypair in tests/fixtures/ with #[cfg(feature = "testing")] toggle (same pattern as INITIALIZER)

Reason

Needed to set correct account utilization indices on existing mainnet smart accounts before the full account index feature goes live.

@0xLeo-sqds 0xLeo-sqds force-pushed the feat/set-account-index branch from b3b0549 to d9a347d Compare March 3, 2026 16:34
@0xLeo-sqds 0xLeo-sqds changed the base branch from main to policies March 3, 2026 16:34
@0xLeo-sqds 0xLeo-sqds changed the base branch from policies to main March 3, 2026 16:36
@0xLeo-sqds 0xLeo-sqds force-pushed the feat/set-account-index branch 2 times, most recently from b3b0549 to d391c77 Compare March 3, 2026 16:45
Paymaster-only instruction to set account_utilization on Settings
accounts. Emits SetAccountIndexEvent with full account data via
self-CPI. Capped at index 249 (FREE_ACCOUNT_MAX_INDEX).
@0xLeo-sqds 0xLeo-sqds force-pushed the feat/set-account-index branch from d391c77 to 710cb51 Compare April 3, 2026 15:43
@0xLeo-sqds 0xLeo-sqds changed the base branch from main to policies April 3, 2026 15:43
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