-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add DAO data model architecture #165
base: main
Are you sure you want to change the base?
Conversation
Can we take a more granular approach and only focus on the governance module for now? There are too many big changes happening at the same time (governance + extension + user). I would start a different thread on |
What voting mechanisms can we have for a given proposal? I can only think of 3:
|
pub votes: HashMap<AccountId, Vote>, | ||
// ---- NEW PROPOSAL DATA ---------------------------- | ||
/// The module used to compute data against | ||
pub governance_module: AccountId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only need governance_module
and the existing votes
here. I don't see ballots
, outcome
, metadata
as necessary.
Then, in the governance_module
you would have a method called compute(votes)
and also a state (to represent the weights for each member, the governance token etc.).
With that in mind, you would call compute(votes)
every time when act_proposal
is called. Basically, this portion of the code will be replaced with a call to compute(votes)
:
Action::VoteApprove | Action::VoteReject | Action::VoteRemove => {
assert!(
matches!(proposal.status, ProposalStatus::InProgress),
"ERR_PROPOSAL_NOT_READY_FOR_VOTE"
);
proposal.update_votes(
&sender_id,
&roles,
Vote::from(action),
&policy,
self.get_user_weight(&sender_id),
);
// Updates proposal status with new votes using the policy.
proposal.status =
policy.proposal_status(&proposal, roles, self.total_delegation_amount);
// no owners allowed, confirm no access keys before use | ||
pub trait Governance { | ||
/// Implements a function that call tally a set of data, returning the collated value | ||
pub fn compute(&self, ballots: Base64VecU8) -> PromiseOrValue<Outcome>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this interface, but Outcome
can be replace by the existing ProposalStatus
.
To conclude on this PR, I would strip out the extension module logic and put it in a different PR. Also, I feel the governance module is more complicated than it should be. You only need the account id of the gov module to offload the logic there. How would it work:
Then, the gov_module would know the weights for |
Note that I did not review the extension module. I feel that we should have a separate topic on that. |
This PR is a 1:1 copy of https://github.com/near-daos/sputnik-dao-contract/wiki/%5BDRAFT%5D-DAO-Data-Model-Architectures to allow easy feedback (via PR comments) on the original proposal.