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

Quitting the DAO #67

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

Conversation

swfsql
Copy link
Collaborator

@swfsql swfsql commented Nov 25, 2021

Partial implementation of #41
Has updated binaries. For changes, please see previous commits where the new binaries would not have been committed yet.

  • Currently this doesn't make any changes to policies (nor any kind of cleanup) when a user quits.
  • Quitting is the direct wasm function quit_from_all_roles that a user can call, alongside add_proposal and act_proposal.
  • For sanity check, it requires two arguments user: AccountId and dao: String, for checking against the user that called and also against the DAO name that the user is quitting from.

/// https://github.com/near-daos/sputnik-dao-contract/issues/41#issuecomment-971474598
#[test]
#[ignore]
fn test_quit_removes_votes2() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test requires the quitter's votes to be removed in order to pass, so it's currently ignored

Copy link
Contributor

@TrevorJTClarke TrevorJTClarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swfsql Woah - its been a while on this one, but really like the feature here. Its def something thats come up as a need, and is a step in the right direction on governance upgrades. Thank you for starting this!

}

let mut new_policy = self.policy.get().unwrap().to_policy();
let removed = new_policy.remove_member_from_all_roles(&quitting_member);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swfsql I think it should check that this DAO wouldn't lock, like if this was the last council / etc. Would be sad to have a user quit and lock the DAO for scenarios with diff groups or token weights that leave a community hanging.

use crate::proposals::VersionedProposal;
pub use crate::proposals::{Proposal, ProposalInput, ProposalKind, ProposalStatus};
pub use crate::types::{Action, Config};

mod basic_action;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit pick here - but can this file be called "council" or something, so its a file dedicated to council actions/abilities/controls?

);

// ok: user2 quits again
// (makes no change)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this error if user tries to quit that isnt council?

("has_23", vec![]),
("has_234", vec![&user4.account_id])
]
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test for ensuring non-locking quit

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.

3 participants