hypha-dao / hypha-smart-contracts

Smart contracts for the Hypha DAO
MIT License
0 stars 1 forks source link

Auto enroll function #10

Open n13 opened 1 year ago

n13 commented 1 year ago

Add auto enroll to join.hypha

It works as follows:

Anyone can add an invite code to the contract, like this

addinvite(enroller name, dao name, code checksum256)

Anyone can claim invite

claim(account name, code checksum 256)

This checks the code, pulls enroller and dao from that, triggers a call to autoenroll on dao.hypha

autorneoll(enroller, dao, account)

dao.hypha checks if enroller has enroll rights on the dao, and enrolls the member if yes.

fails if not.

Permissions Changes

join.hypha changes

table with enroller, dao, code action addinvite and claiminvite - checks enroller active permission proving that account called it claiminvite checks account permission active, and checks the secret vs the code - the code is hashed, see seeds how to do this.

dao.hypha changes

add autoenroll action - there already is one, modify if needed.

Wallet change

Wallet gets secret, sends secret to join.hypha's claim action

n13 commented 1 year ago

https://linear.app/hypha/issue/DEV-833/auto-enroll-contract-and-wallet-work