-
Notifications
You must be signed in to change notification settings - Fork 92
Description
๐๐ฃ Good First Issue โ Create Example Demonstrating Token Pause Key in Python SDK
First Timers Only
This issue is reserved for people who have never contributed or have made minimal contributions to Hiero or to open-source in general.
The goal of this issueโand all other issues labeled good first issueโis to help you make your first contribution to Hiero. We know that making your first pull request can feel intimidating; this issue is intentionally small, self-contained, and beginner-friendly.
๐พ Description of the Issue
In the Hiero Python SDK, Hedera tokens can define several administrative keys with different capabilities.
One key that currently lacks an example in the repository is the pause key.
What the pause key does
From the Hedera Token Service spec:
https://github.com/hashgraph/hedera-protobufs/blob/8c27786cec93abab974309074feaef9b48a695b7/services/token_create.proto
- pause may authorize a token pause or token unpause transaction.
- If this key is not present, the token cannot be paused (preventing any account from transacting in that token) or resumed.
- If this key is removed while the token is paused, the token cannot be unpaused and SHALL remain paused.
๐ก Solution
Create a new example file:
examples/token_create_transaction_pause_key.py
What the example should demonstrate:
- Creating a token without a pause key
- Attempt to pause it โ this should fail, because no pause key exists.
- Creating a token with a pause key
- Successfully pause the token.
- Show that transfers involving the token fail while paused.
- Successfully unpause the token.
Bonus tasks (optional but encouraged):
- Remove the pause key while the token is paused.
- Demonstrate that the token is now permanently paused (cannot be unpaused anymore).
This is similar in spirit to the existing example
examples/token_create_transaction_admin_key.py
and should follow the same demonstration style and structure, but improvements are welcome, such as with logging or handling.
๐ฉโ๐ป Implementation Steps
- Copy the client setup from existing examples (e.g., admin key demo).
- Generate a pause key using PrivateKey.generate_ed25519().
- Create a token without the pause key.
- Attempt to pause โ catch and print the expected failure.
- Create a second token with a pause key.
- Pause successfully.
- Demonstrate that transfers fail while paused (small transfer between OPERATOR and a newly-created account is enough).
- Unpause successfully.
- (Optional) Remove pause key and show that unpause becomes impossible if paused.
You are advised to look at other examples that use the required operations, such as TokenPauseTransaction.
Console log messages should be friendly and informative
๐ Step-by-Step Guide for New Contributors
If this is your first time contributing to open source, here is the expected workflow:
- Comment below that you would like to work on this issue.
- A maintainer will assign the issue to you.
- Implement the example following the instructions above.
- Run the example locally:
uv run examples/token_create_transaction_pause_key.py - Regularly pull changes from main so your branch stays up to date.
- Submit your pull request.
- Address any reviewer comments.
- Celebrate your first contribution! ๐
๐ Important Requirements for PRs
Your pull request cannot be merged until you:
- Use verified signed commits (git commit -S -s)
(See: docs/sdk_developers/signing.md) - Add a CHANGELOG entry
(See: docs/sdk_developers/changelog_entry.md)
Also read the top-level /README.md and the docs/sdk_developers/ directory for workflow details.