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

Dev: Governance Setting – Vote Duration #116

Closed
15 of 16 tasks
ori-near opened this issue Nov 7, 2024 · 3 comments · Fixed by #121
Closed
15 of 16 tasks

Dev: Governance Setting – Vote Duration #116

ori-near opened this issue Nov 7, 2024 · 3 comments · Fixed by #121
Assignees

Comments

@ori-near
Copy link

ori-near commented Nov 7, 2024

See #86 for Governance Settings background.

Background

Our Treasury App currently lacks a dedicated section for admins to configure governance settings (see #86 for background). Specifically, there is no way for admins to adjust the "voting duration," or the number of days a vote is active before it expires. This limits the flexibility of governance processes, especially when there’s a need to adapt voting periods to different requirements

This ticket focuses on implementing a "Voting Duration" component within the Settings page, which would allow admins to configure the number of days a vote is open for proposals before it expires.

User Story

As an admin (user with permissions to manage members & setting), I want the ability to configure the voting duration so that I can choose the number of days a vote remain active before it expires, allowing me to manage voting timelines that work for my team.

Acceptance Criteria

1. Voting Duration Configuration Section

  • A new "Voting Duration" section is added to the Treasury settings
    • Title: "Voting Duration"
    • Instructions text: "Set the number of days a vote is active. A decision expires if voting is not completed within this period."
    • Input feed: Admin can input the number of days for the voting duration
      • Admin can only enter a number
      • Default value is 7 days
    • Button
      • Cancel: Cancels any changes and leaves the voting duration unchanged
      • Submit Requests: Confirm the changes and submits the request

2. Warning Message for Impact on Existing Requests

  • Admin sees a warning message if the voting duration changes will impact any existing requests. See mock up below.

3. Submit Request to Update Voting Duration

  • When admin clicks Submit Request, a new policy change request is added to the "Pending Requests" section of the Settings page.
  • The requests will need to be voted on before the change is implemented. The voting thresholds for this policy change will be follow the "Manage Members & Settings" permission group. So if 1 vote is required, after 1 vote that policy change will take effect.
  • Once the votes are cast, the new voting duration policy will take effect.

4. Handling of Existing Requests

  • Once policy change takes effect, all existing requests that had the old vote duration policy will inherit the new voting duration policy:
    • Pending Requests: All pending requests that were created under the previous duration will inherit the new voting period
    • Expired Requests: Any requests that were expired under the old voting duration but fall under the new voting duration will automatically move to the Pending Requests tab and be available for voting again

Voting Duration Mockup

Image

Voting Duration Warning Mockup

@FREZZZBE will add once #119 is complete.

@ori-near
Copy link
Author

Moving this into sprint 3

@petersalomonsen
Copy link
Collaborator

@ori-near Regarding this point:

"Expired Requests: Any requests that were expired under the old voting duration but fall under the new voting duration will automatically move to the Pending Requests tab and be available for voting again"

The sputnik-dao contract works this way that the "Expired" state will only be applied if you act on a proposal ( if you vote ). So proposals that are not voted for, and if they are expired by the current duration setting, will be available for voting if the duration is extended.

If the proposal was voted for after expiry, and the "Expired" state was set on the proposal, then this change is irreversible, and changing the duration setting will not fix it.

@petersalomonsen petersalomonsen moved this from 🏗 In progress to 👀 In review in 🚀 DevHub Products Nov 17, 2024
@ori-near
Copy link
Author

@petersalomonsen – understood this is the behavior on the contract side. That point was written from point of view of the user.

petersalomonsen added a commit that referenced this issue Nov 25, 2024
https://github.com/user-attachments/assets/af591569-480e-4e9b-aa9e-16304380e33b

Lowering voting duration should warn and show proposals that will expire
because of the change


https://github.com/user-attachments/assets/d5829905-0643-4f57-96fe-b4abebe52c60

When a voting duration change proposal is submitted, a toast will show:


https://github.com/user-attachments/assets/1f004b39-d66c-4b1d-aa4a-57d5ed2047b2

The last test here uses a RPC sandbox, interacting with a real instance
of the smart contract. Not on the mainnet, but in a near-workspaces-rs
sandbox. This new sandbox facilitates real interaction with the smart
contracts in tests, without having to do real mainnet transactions. Also
there is a "playground" script which you can use to check how a contract
works. Currently only the sputnik-dao contract is deployed.



resolves #116
resolves #127
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in 🚀 DevHub Products Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants