near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
108 stars 77 forks source link

sputnikdao2: is it possible to add members in batch? #89

Open netpoe opened 2 years ago

netpoe commented 2 years ago

I know a proposal can be created to add a member, but can add multiple members at the initialization of the contract? Or is there a special function to do this?

If not, in your opinion, would it be a good addition?

I'm currently coming up to a use case where I need to batch add members to a DAO. Say depositors of an Escrow, where the Escrow will transfer the funds to a new DAO contract, and each depositor will become a member of the DAO.

How would you handle this? ☝️

TrevorJTClarke commented 2 years ago

I like the idea here @netpoe, here's a couple thoughts on the matter:

  1. Imagine a single proposal including a batch of adding members - If any 1 of those members shouldn't get added, you now have to allow the DAO to vote with a matching batch, which would get complex/messy quickly. Or in a simple fashion, vote denies all, when only 1 shouldnt be added.
  2. I get the issue here is more of an automation piece, where someone in your DAO doesn't want to manually approve all new members as they do some required action. I believe this will be happening as experimentation in the upcoming weeks/months
TrevorJTClarke commented 2 years ago

Lastly - wanted to note here - initializing the contract is different, and is deployed with a policy from the beginning which can be configured to have many members or even multiple council groups with many members. So if the issue for you is just at initialization you can look at https://github.com/Multi-DAO/ambassadaos for more info

netpoe commented 2 years ago

Lastly - wanted to note here - initializing the contract is different, and is deployed with a policy from the beginning which can be configured to have many members or even multiple council groups with many members. So if the issue for you is just at initialization you can look at https://github.com/Multi-DAO/ambassadaos for more info

@TrevorJTClarke , indeed Here's what it looks like from inside an actual DAO factory contract:

fn get_dao_config(&self, name: String, accounts: String) -> Vec<u8> {
        format!(r#"{{ "policy": {{ "roles": [ {{ "name": "Everyone", "kind": {{ "Group": [ {} ] }}, "permissions": [ "*:Finalize", "*:AddProposal", "*:VoteApprove", "*:VoteReject", "*:VoteRemove" ], "vote_policy": {{}} }}, {{ "name": "all", "kind": "Everyone", "permissions": [ "*:AddProposal" ], "vote_policy": {{}} }} ], "default_vote_policy": {{ "weight_kind": "RoleWeight", "quorum": "0", "threshold": [ 1, 2 ] }}, "proposal_bond": "100000000000000000000000", "proposal_period": "604800000000000", "bounty_bond": "100000000000000000000000", "bounty_forgiveness_period": "604800000000000" }}, "config": {{ "name": "{}", "purpose": "", "metadata": "" }} }}"#, accounts, name).into_bytes()
    }

This is the initial config for creating a SputnikDAO.

TrevorJTClarke commented 2 years ago

This is the initial config for creating a SputnikDAO.

This looks a lot like the default config - https://github.com/near-daos/sputnik-dao-contract/blob/main/sputnikdao2/src/policy.rs#L179-L210 Maybe you can incorporate the defaults somehow. The piece that is missing from the sputnik contracts is how you would issue new members post-DAO creation. One other thing to note, once you create a DAO, there's no way (yet) to remove that DAO, which means it could get quite expensive to spin up a lot of DAOs at 5Near each