NEAR-DevHub / neardevhub-treasury-dashboard

Frontend for Treasury Dashboard Product (includes DevHub, Infinex) + Testing front end. Note – we leverage Sputnik DAO contract.
MIT License
3 stars 0 forks source link

Dev: Self Create Flow Contract #89

Open ori-near opened 1 month ago

ori-near commented 1 month ago

Problem

Self Create flow should end up with the user signing, ideally, a single transaction. We will need a helper contract (the self create flow contract) so user signs this one transaction and we do the rest through cross-contract calls.

Solution

Is a helper contract that does these 4 steps in a single tx. The transaction should accomplish the following:

  1. Deploy a DAO. Create and configure a new Sputnik DAO subaccount using the Sputnik factory create method. The create method on contract sputnik-dao.near should be used for this. It costs between 5 and 6 Near to deploy a DAO. The DAO contract will be a sub account of sputnik-dao.near. For example new-treasury.sputnik-dao.near.

  2. Create a new account, for example new-treasury.near This new account can be used to deploy the front end on but in order to store the components it needs a storage deposit. As a callback for making this new account we can do step 3.

  3. Pay for SocialDB storage + deploy BOS components These interactions are with the social-db contract

  4. On this new account we can deploy the web4 contract that is defined here with BOS gateway. Checkout web4 for more info.

Tguntenaar commented 1 month ago

UI perspective

To add some more context to the first two steps:

  1. the DAO policy and name will be passed from the UI
  2. the new account name devhub.near will also be passed as a parameter to the self create flow contract.

Image

ori-near commented 1 week ago

Moving this to sprint 3 and assigned to @petersalomonsen

petersalomonsen commented 4 days ago

Depends on https://github.com/near/near-linkdrop/pull/28 to be merged