Skip to content

Comments

Implement token burn and deflationary mechanism#112

Open
Richiey1 wants to merge 1 commit intoMindFlowInteractive:mainfrom
Richiey1:feature/token-burn
Open

Implement token burn and deflationary mechanism#112
Richiey1 wants to merge 1 commit intoMindFlowInteractive:mainfrom
Richiey1:feature/token-burn

Conversation

@Richiey1
Copy link

Overview

This PR implements a robust token burn and deflationary mechanism for the Quest project. It introduces a central token_burn controller and integrates it into the RewardToken contract.

Key Changes

  • New token_burn Contract: Manages burn configurations (rate, enabled status), tracks total burned tokens by category (fees, voluntary, unlocks), and stores a paginated history of burn events.
  • RewardToken Integration:
    • Added set_burn_controller to link the token to the burn mechanism.
    • Updated transfer and transfer_from to automatically apply transaction fee burns.
    • Updated burn and spend_for_unlock to record burns in the controller.
  • Security & Stability:
    • Fixed deprecated invoker() method usage for Soroban v21.
    • Implemented dynamic contract invocation for cross-contract calls.
    • Added comprehensive unit and integration tests.

Verification

  • Unit tests for token_burn passed.
  • Integration tests for RewardToken burn flow passed.
  • Verified total supply reduction on every burn event.

@Richiey1
Copy link
Author

Important: Post-Deployment Activation

IMPORTANT
To activate the burn mechanism on-chain, ensure to call set_burn_controller on the RewardToken contract with the deployed token_burn contract address.
The deflationary logic remains dormant until this link is established, allowing for a two-stage deployment (Contract Deployment -> Controller Activation).

@Mkalbani
Copy link
Contributor

@Richiey1 Please resolve conflict

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.

2 participants