sputnik-dao-contract icon indicating copy to clipboard operation
sputnik-dao-contract copied to clipboard

sputnikdao2: RoleKind::Everyone, can't set ProposalStatus::Approved

Open Buckram123 opened this issue 3 years ago • 0 comments

Imagine that scenario:

  1. We have a policy like that:
roles: [
            {
                name: "all",
                kind: "Everyone",
                permissions: ["*:AddProposal",
                    "*:VoteApprove"],
                vote_policy: {}
            }
];
...
default_vote_policy:  
{
            weight_kind: "TokenWeight",
....

So all that matters is delegaions 2. Delegaions on 'alice' >= threshold 3. Some proposal 4. And 'alice' tries to VoteApprove via act_proposal(). The issue is that this part is unreachable for RoleKind::Everyone(alice) https://github.com/near-daos/sputnik-dao-contract/blob/372df7d715c4c7c06ba14a3ba5b4db65f50b81f9/sputnikdao2/src/policy.rs#L383 Because of continue here. https://github.com/near-daos/sputnik-dao-contract/blob/372df7d715c4c7c06ba14a3ba5b4db65f50b81f9/sputnikdao2/src/policy.rs#L366

So RoleKind::Everyone can't execute proposal it seems

Buckram123 avatar Dec 15 '21 13:12 Buckram123