Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(governance): add delegateVotingPower, getPushTokenAddress, getPushBalance, getVotingPower, and getDelegatedTo functions #453

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wolfcito
Copy link
Contributor

Relates to:

Background

What does this PR do?

This PR introduces several new functionalities for the Push Chain governance system, which include:

  1. delegateVotingPower: Allows users to delegate their voting power to a specified address.
  2. getPushTokenAddress: Retrieves the address of the PUSH token on various chains.
  3. getPushBalance: Fetches the $PUSH token balance of an address.
  4. getVotingPower: Retrieves the current voting power of an address.
  5. getDelegatedTo: Returns the address to which the user's voting power is delegated.

These functions interact with the Push governance contract, providing essential features for managing governance-related actions.

Testing

  1. Import the PushGovernanceService class into the testing environment.
  2. Set up the valid wallet address with sepolia funds
  3. Test each function by calling them with appropriate parameters and ensuring the expected outputs are returned.

Detailed testing results

Method Prompt Screenshot Transaction Link
get_push_balance hat is my balance in $PUSH? image N/A
get_voting_power What is my voting power? image N/A
get_delegated_to To which address have I delegated my voting power? image N/A
delegate_voting_power delegate my voting power to myself image txn

Docs

My changes do not require a change to the project documentation.

Checklist

  • I have tested this change and added the relevant screenshots to the PR description
  • I updated the README if necessary to include the new plugin, wallet, chain, etc.

- Added support for Sepolia network in PushGovernancePlugin.
- Updated getPushTokenAddress method to include walletClient and improved error handling.
- Introduced new methods: getPushBalance, getVotingPower, and getDelegatedTo for enhanced functionality.
- Updated ABI to include Sepolia contract address.
Copy link

changeset-bot bot commented Mar 26, 2025

⚠️ No Changeset found

Latest commit: 5633c47

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Enhanced README with detailed descriptions of new functionalities: delegateVotingPower, getPushTokenAddress, getPushBalance, getVotingPower, and getDelegatedTo.
- Modified delegateVotingPower method to return an object containing transaction hash, chain ID, and new delegate address for improved clarity and usability.
@wolfcito wolfcito requested a review from 0xaguspunk March 29, 2025 02:10
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