Skip to content

[Contract] Implement Detokenization Proposal and Execution Flow#493

Merged
truthixify merged 1 commit intoDistinctCodes:mainfrom
Josue19-08:feat/detokenization-flow
Feb 22, 2026
Merged

[Contract] Implement Detokenization Proposal and Execution Flow#493
truthixify merged 1 commit intoDistinctCodes:mainfrom
Josue19-08:feat/detokenization-flow

Conversation

@Josue19-08
Copy link
Contributor

Summary

This PR implements the complete detokenization proposal and execution flow as specified in #473.

Changes

  • ✅ Enhanced execute_detokenization() to fully eliminate tokens from circulation
  • ✅ Complete cleanup of tokenization records:
    • Token holder balances
    • Token locks
    • Unclaimed dividends
    • Token holders list
    • Transfer restrictions
    • Whitelist
    • Token metadata
    • TokenizedAsset record
  • ✅ Added comprehensive tests for token elimination
  • ✅ All 41 contract tests passing

Implementation Details

propose_detokenization()

  • Verifies asset is tokenized
  • Prevents simultaneous proposals
  • Creates proposal structure integrated with voting module
  • Returns unique proposal ID

execute_detokenization()

  • Confirms associated vote passed (>50% threshold)
  • Removes all issued tokens from circulation
  • Clears all tokenization records
  • Prevents execution when voting has not concluded successfully
  • Triggers completion event

Supporting Functions

  • get_detokenization_proposal() - Retrieves current proposal details
  • is_detokenization_active() - Boolean status check

Acceptance Criteria Met

  • ✅ Execution is prevented when voting has not concluded successfully
  • ✅ Token elimination occurs upon successful execution completion
  • ✅ Simultaneous proposals are blocked

Tests Added

  • test_token_elimination_on_execution - Verifies complete token removal and record cleanup
  • test_cannot_propose_after_execution - Ensures no re-proposals after execution

All existing tests continue to pass (41/41).

Related Issue

Closes #473

🤖 Generated with Claude Code

Enhance execute_detokenization() to fully eliminate tokens from circulation and clear all tokenization records:
- Remove all token holder balances
- Clear token locks for all holders
- Remove unclaimed dividends
- Delete token holders list
- Remove transfer restrictions and whitelist
- Clear token metadata
- Remove TokenizedAsset record (eliminates all tokens)
- Clear voting records before removal

Add comprehensive tests:
- test_token_elimination_on_execution: Verifies complete token removal
- test_cannot_propose_after_execution: Ensures no re-proposals after execution

Fixes DistinctCodes#473

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Feb 22, 2026

@Josue19-08 is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@truthixify truthixify merged commit fba0f1f into DistinctCodes:main Feb 22, 2026
3 of 5 checks passed
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.

[Contract] Implement Detokenization Proposal and Execution Flow

2 participants