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

ethernaut-optigov delegates task #43

Open
wants to merge 1 commit into
base: retro/ci
Choose a base branch
from
Open

Conversation

luisvid
Copy link
Collaborator

@luisvid luisvid commented Oct 28, 2024

Add Delegates Task to optigov plugin

This PR introduces the Delegates Task to the optigov plugin, providing functionality to list voting delegates on Agora or retrieve detailed information on specific delegates. The task includes options for displaying related data, such as vote history or delegator information.

Usage

$ ethernaut optigov delegates [--address <STRING>] [--limit <INT>] [--offset <INT>] [--related-data <STRING>]
  • related-data: Determines whether additional information (e.g., votes or delegators) should be fetched. Options include votes, delegators, or leave empty for no additional data.

Examples

List All Delegates

$ ethernaut optigov delegates

Result:

╭ Delegates ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                       │
│   - Address: 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466                                                               │
│     Voting Power: 10920168244107760559999921                                                                          │
│     Twitter: N/A                                                                                                      │
│     Discord: N/A                                                                                                      │
│     Statement: **The Anticapture Commission (ACC)  is a key tokenholder group, mandated to prevent the capture of t   │
│                                                                                                                       │
│   - Address: 0x1b686ee8e31c5959d9f5bbd8122a58682788eead                                                               │
│     Voting Power: 5862501513969821025206137                                                                           │
│     Twitter: @l2beat                                                                                                  │
│     Discord: _krst                                                                                                    │
│     Statement: ### Intro to L2Beat                                                                                    │
│                                                                                                                       │
│   L2BEAT is an independent, public goods company who acts as an impartial watchdo                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Retrieve Detailed Information on a Specific Delegate

$ ethernaut optigov delegates --address 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466

Result:

╭ Delegate 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466 ─────╮
│                                                          │
│   Address: 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466    │
│      Voting Power (Advanced): 0                          │
│      Voting Power (Direct): 10919292330056592337989904   │
│      Voting Power (Total): 10919292330056592337989904    │
╰──────────────────────────────────────────────────────────╯

Retrieve Vote History for a Specific Delegate

$ ethernaut optigov delegates --address 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466 --related-data votes

Result:

╭ Votes for Delegate 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466 ───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                  │
│   - Voter: 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466, Support: FOR, Weight: 10864250128773317019992561, Proposal: Governor Update Proposal      │
│   #3: Enable Onchain Treasury Execution (ID: 50775220738623167695573388814398057544437236582252674861818535424434586434657), Timestamp:          │
│   2024-10-25T17:37:13.000Z                                                                                                                       │
│                                                                                                                                                  │
│   - Voter: 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466, Support: FOR, Weight: 10630853974769195903528775, Proposal: Upgrade Proposal #10:         │
│   Granite Network Upgrade (ID: 46514799174839131952937755475635933411907395382311347042580299316635260952272), Timestamp:                        │
│   2024-08-26T19:32:19.000Z                                                                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Retrieve Delegator Information for a Specific Delegate

$ ethernaut optigov delegates --address 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466 --related-data delegators

Result:

╭ Delegators for Delegate 0x3eee61b92c36e97be6319bf9096a1ac3c04a1466 ──────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                  │
│   - From: 0x99e9586bbf15cda76fbf2bcd045e2b56e7f8d7a9, Allowance: 11000000000000000000, Type: DIRECT, Amount: FULL, Timestamp:                    │
│   2024-10-28T12:26:15.000Z                                                                                                                       │
│                                                                                                                                                  │
│   - From: 0xd339aa7a909ce0daed2c2cf7717c0795fa0ceb43, Allowance: 11000000000000000000, Type: DIRECT, Amount: FULL, Timestamp:                    │
│   2024-10-28T12:24:03.000Z                                                                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

@luisvid luisvid self-assigned this Oct 28, 2024
@luisvid luisvid changed the base branch from feature/optigov to retro/ci October 28, 2024 13:20
@coveralls
Copy link

Coverage Status

coverage: 67.059% (-1.2%) from 68.218%
when pulling 1b426fa on retro/delegates
into ff7214e on feature/optigov.

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