NEAR-DevHub / neardevhub-bos

DevHub Portal Product UI (Hosted BOS) – Includes other instances (e.g. Infrastructure, Events)
https://neardevhub.org
MIT License
24 stars 23 forks source link

Locations still using legacy devhub contract (devgovgigs.near) #640

Open elliotBraem opened 9 months ago

elliotBraem commented 9 months ago

Recently we've migrated contract data from devgovgigs.near to devhub.near (all access control, addons, and communities)

Posts are still stored on devgovgigs.near.

These are the remaining functions in code using the legacy contract:

We should migrate the data on the contract and then fix the usage in code when ready.

Legacy code for posts and labels should utilize the devhub-adapter rather than duplicate Near.call.

ailisp commented 9 months ago

Of these list, the following ones are available and related data has migrated in the new contract:

get_root_members -- admin panel
remove_member
has_moderator
get_access_control_info -- was causing failing tests in funding and create
add_member (teams via admin panel)
edit_member

The others related to posts are not going to be migrated, as we'll launch proposal to replace posts.

However, there is a tricky part about labels. Access control are based on labels, but labels are created when add_post. Given old posts in legacy contract therefore also the labels, the new contract does not have labels to properly support add_member etc. functionality. Fortunately, most permissions are for creating and editing posts, and posts are going to be deprecated. The only affected thing is the moderators - if we need to update moderator, we should do that for both legacy contract and new contract. And moderators are not frequently changed so we can make a proper solution with this issue mind

I think a proper solution to this this problem, is to rewrite current access control system. Since there will be no posts (old posts migrated to proposal or simply make it read-only mode, a separate issue) and trustee & proposal workflow will be permissioned by the SputnikDAO contract, the access control part of devhub.near contract will only need to keep track of moderators. And that is pretty straightforward to implement. I'll create a separate issue to track this problem.

With the deprecate posts, new access control that only manages moderators, we will avoid migrating these methods. There is one exception: get_featured_communities, which we definitely need it in new contract