Skip to content

Conversation

@krishnaagrawal7508
Copy link

  1. Anchor program that allows for the toggling of transfer capabilities for a specific token mint. The implementation includes a transfer switch that can be enabled or disabled based on a specific account's state. When the switch is enabled, token transfers can proceed; when disabled, token transfers are halted, allowing for enhanced control over token management.

  2. The tests included utilize solana-bankrun to simulate token transfers under various conditions. The tests cover the following scenarios:

  • Successful Token Transfer: A token transfer is executed when the transfer switch is enabled. The test checks that the transfer completes successfully and that balances are updated accordingly.
  • Transfer Denied: A token transfer attempt is made with the transfer switch disabled. The test verifies that the transaction fails as expected, demonstrating that the toggle effectively prevents transfers.
  • Toggle Functionality: Tests for toggling the transfer switch, ensuring that the switch can be enabled and disabled appropriately and that the correct state is maintained.

@heyAyushh heyAyushh added contribute:poseidon Adds a poseidon example contribution to the repository. contribute:anchor Adds anchor example contribution to repo and removed contribute:poseidon Adds a poseidon example contribution to the repository. labels Nov 5, 2024
@heyAyushh heyAyushh closed this Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribute:anchor Adds anchor example contribution to repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants