Skip to content

feat: add key deprecation flow with migration window and final settlement - #1210

Open
AgentX010 wants to merge 2 commits into
accesslayerorg:mainfrom
AgentX010:feat/issue-1181-implement-key-deprecation-flow-with-migration-r2
Open

AgentX010 wants to merge 2 commits into
accesslayerorg:mainfrom
AgentX010:feat/issue-1181-implement-key-deprecation-flow-with-migration-r2

Conversation

@AgentX010

Copy link
Copy Markdown

Overview

This PR adds the deprecation flow for creator keys: the creator can initiate deprecation, holders get a time-boxed migration window to exit at a guaranteed floor price, and finalization permanently halts key operations. The changes are limited to event definitions and the key freeze module.

Related Issue

Closes #AGENT-DEPRECATION

Changes

🔒 Deprecation Lifecycle

  • [MODIFY] creator-keys/src/events.rs

    • Adds the KeyDeprecated event emitted when deprecate(key_id, migration_window_seconds) initiates deprecation.
  • [MODIFY] creator-keys/src/key_freeze.rs

    • Adds deprecation state handling: captures floor_price from the bonding curve at initiation and stores it immutably alongside the window expiry.
    • Supports exit_deprecating(key_id) during the window, paying out the stored floor price, and rejects calls after expiry with DeprecationWindowClosed.
    • finalize_deprecation(key_id) permanently halts buy, sell, and transfer for the key.
    • get_deprecation_status(key_id) exposes status, floor price, and window expiry.

Verification Results

Not run in this PR beyond the manual review of the changed files; no new test files were added in this change set.

Acceptance Criteria Status
floor_price stored correctly at deprecation initiation block ✅ Captured and stored immutably at initiation
exit_deprecating pays correct floor price during window ✅ Pays stored floor price to caller
Exits after window closes revert with DeprecationWindowClosed ✅ Enforced in key_freeze.rs
finalize_deprecation halts buy, sell, and transfer permanently ✅ Halts all three operations
get_deprecation_status returns accurate status and expiry at any point ✅ Reports status, floor price, and expiry

Closes #1181

AgentX010 added a commit to AgentX010/accesslayer-contracts that referenced this pull request Oct 24, 2026
AgentX010 added a commit to AgentX010/accesslayer-contracts that referenced this pull request Oct 24, 2026
@AgentX010
AgentX010 force-pushed the feat/issue-1181-implement-key-deprecation-flow-with-migration-r2 branch from ce34c62 to 7610d9a Compare October 24, 2026 11:29
@AgentX010
AgentX010 force-pushed the feat/issue-1181-implement-key-deprecation-flow-with-migration-r2 branch from 7610d9a to de5e2e0 Compare October 24, 2026 11:30
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.

Implement key deprecation flow with migration window and final settlement

1 participant