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

bug: Newly created DAOs cannot initiate proposals due to no initial members #159

Closed
yubing744 opened this issue Sep 27, 2022 · 22 comments
Closed
Labels
bug Something isn't working

Comments

@yubing744
Copy link
Collaborator

Bug Report

branch: master
commit: d2c4f5c

Current behavior:

When I created the DAO, I did not have the ability to specify initial members. After the DAO was created successfully, no one could initiate a proposal to add new members.

Expected behavior:

DAOSpace provides methods to add members based on root_cap

@yubing744 yubing744 added the bug Something isn't working label Sep 27, 2022
@yubing744
Copy link
Collaborator Author

@jolestar

@WGB5445
Copy link
Collaborator

WGB5445 commented Sep 27, 2022

It may be necessary to register DAOT as a member plugin when creating DAO
and add the caller as the first DAO member

@jolestar
Copy link
Member

first member need to init in the template

@yubing744
Copy link
Collaborator Author

how about add script function join_member_with_root_cap in DAOSpace?

@yubing744
Copy link
Collaborator Author

@yubing744
Copy link
Collaborator Author

The current logical caller account will be upgraded to DAO, is it possible to create a new account here for DAO creation

@WGB5445
Copy link
Collaborator

WGB5445 commented Sep 27, 2022

In the previous logic, you can use ${daoName} as a plugin to apply for member_cap permission to make an account a member

@WGB5445
Copy link
Collaborator

WGB5445 commented Sep 27, 2022

There is no way to specify other accounts as members when the account is upgraded. Here is a solution. Member can be issued through the Offer mechanism, and a member Offer can be issued to an address when it is created.

@yubing744
Copy link
Collaborator Author

yubing744 commented Sep 27, 2022

I found a way to create a new account, I don't know if it will work?

public fun create_account(creator: &signer): DAOAccountCap {
let (_dao_address, signer_cap) = Account::create_delegate_account(creator);
upgrade_to_dao_with_signer_cap(signer_cap)
}

Adding join_member_with_root_cap to the DAOSpace feels simpler if this approach works.

@yubing744
Copy link
Collaborator Author

Like this:

image

@yubing744
Copy link
Collaborator Author

After changing from DAOAccount::upgrade_to_dao to DAOAccount::create_account, creating DAO reports an error:

ALERT: Starmask: contract.dry_run_raw failed. Error: {"MoveAbort":{"abort_code":25858,"explain":{"category_code":2,"category_name":"REQUIRES_ADDRESS","reason_code":101,"reason_name ":"ETOKEN_REGISTER"},"location":{"Module":{"address":"0x00000000000000000000000000000001","name":"Token"}}}}

@jolestar
Copy link
Member

Like this:

image
  1. if upgrade the sender to DAO account, need to use another account as the first member.
  2. if the sender creates a new DAO account, the sender can be the first member.

I think in the DAOSpace web scenario, 2 is the right approach.

@yubing744
Copy link
Collaborator Author

yubing744 commented Sep 27, 2022

@jolestar 2 will Abort, when create Token in DAOSpace::create_dao, the error is: {"MoveAbort":{"abort_code":25858,"explain":{"category_code":2,"category_name":"REQUIRES_ADDRESS","reason_code":101,"reason_name ":"ETOKEN_REGISTER"},"location":{"Module":{"address":"0x00000000000000000000000000000001","name":"Token"}}}}

code:

assert!(Signer::address_of(account) == token_address, Errors::requires_address(ETOKEN_REGISTER));

@jolestar
Copy link
Member

After changing from DAOAccount::upgrade_to_dao to DAOAccount::create_account, creating DAO reports an error:

ALERT: Starmask: contract.dry_run_raw failed. Error: {"MoveAbort":{"abort_code":25858,"explain":{"category_code":2,"category_name":"REQUIRES_ADDRESS","reason_code":101,"reason_name ":"ETOKEN_REGISTER"},"location":{"Module":{"address":"0x00000000000000000000000000000001","name":"Token"}}}}

The right approach:

  1. Alice creates a DAO account.
  2. Alice builds a package with the DAOTemplate. The module address should be the DAO account address.
  3. Alice submit an upgrade plan for DAOAccount.
  4. Alice deploys the package to DAOAccount and initiates the DAO.

@yubing744
Copy link
Collaborator Author

After changing from DAOAccount::upgrade_to_dao to DAOAccount::create_account, creating DAO reports an error:
ALERT: Starmask: contract.dry_run_raw failed. Error: {"MoveAbort":{"abort_code":25858,"explain":{"category_code":2,"category_name":"REQUIRES_ADDRESS","reason_code":101,"reason_name ":"ETOKEN_REGISTER"},"location":{"Module":{"address":"0x00000000000000000000000000000001","name":"Token"}}}}

The right approach:

  1. Alice creates a DAO account.
  2. Alice builds a package with the DAOTemplate. The module address should be the DAO account address.
  3. Alice submit an upgrade plan for DAOAccount.
  4. Alice deploys the package to DAOAccount and initiates the DAO.

It seems that this also requires DAOSpace to provide the join_member_with_root_cap method to add Alice as a member.

@yubing744
Copy link
Collaborator Author

@jolestar I found a new way to skip the upgrade plan:

  1. Alice creates a DAO account, and holds DAOAccountCap
  2. Alice builds a package with the DAOTemplate. The module address should be the DAO account address.
  3. Alice deploys the package to DAOAccount and initiates the DAO with DAOAccountCap.

@jolestar
Copy link
Member

@jolestar I found a new way to skip the upgrade plan:

  1. Alice creates a DAO account, and holds DAOAccountCap
  2. Alice builds a package with the DAOTemplate. The module address should be the DAO account address.
  3. Alice deploys the package to DAOAccount and initiates the DAO with DAOAccountCap.

if there is no Upgrade Plan, Alice can not deploy the package to DAOAccount.

@yubing744
Copy link
Collaborator Author

@jolestar I found a new way to skip the upgrade plan:

  1. Alice creates a DAO account, and holds DAOAccountCap
  2. Alice builds a package with the DAOTemplate. The module address should be the DAO account address.
  3. Alice deploys the package to DAOAccount and initiates the DAO with DAOAccountCap.

if there is no Upgrade Plan, Alice can not deploy the package to DAOAccount.

I thought about it, it is true

@yubing744
Copy link
Collaborator Author

@jolestar How to deploy a Package to DAOAccount, is there a sample program?

@jolestar
Copy link
Member

@jolestar How to deploy a Package to DAOAccount, is there a sample program?

@0xpause can help to write an integration-test for give a example for this?

@pause125
Copy link
Collaborator

pause125 commented Sep 27, 2022

@jolestar How to deploy a Package to DAOAccount, is there a sample program?

@0xpause can help to write an integration-test for give a example for this?

I'll try to write one. For now, you can have a look at the exampels dao_proposal.move and dao_upgrade.move. @yubing744

@jolestar
Copy link
Member

@jolestar How to deploy a Package to DAOAccount, is there a sample program?

@0xpause can help to write an integration-test for give a example for this?

I'll try to write one. For now, you can have a look at the exampels dao_proposal.move and dao_upgrade.move. @yubing744

@WGB5445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants