Joystream / Joystream/joystream

Content directory smart contracts: Create bridge contracts

Open
#1,677 0 comments 0 reactions 1 assignee View on GitHub

@Lezek123 is already working on this.

Since Nov 11, 2020.

smart-contract-content-directory
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Create bridge contracts for Membership and ContentWorkingGroup module accoring to the initial design (https://github.com/Joystream/joystream/issues/1520#issuecomment-724227857)

Those contract can be managed only by a specific address hardcoded in the runtime. For the purpose of initial tests we should be able to provide the "runtime address" during contract deployment.

Initialization

In order to initialize bridge contracts on the actual Joystream chain we woiuld need to:

  1. Deploy the contracts
  2. Export current members / CWG data
  3. Initialize the data in the bridge contracts (using standard initalization process with batchInsert)
  4. Make runtime aware of bride contract addresses (ie. we would need a SetBridgeContractAddresses proposal)

The problem in this scenario is that between steps 2 and 4, the memberships and curator working group state may (and most likely will) undergo some changes that the bridge contract will then not be aware of (since the runtime only starts to interact with it at after step 4).

This means we probably need to change the order of steps to 1, 4, 2, 3 order and make sure the contract is able to handle initialization and new changes coming from the runtime at the same time (ie. ignore member address provided in batchInsert if we already have one assigned)

This will make implementing a bridge contract a little more complex, but it should be plausible and it's probably worth the effort.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.