massalabs / massalabs/DeWeb

Create SC for Decentralized lists

Open
#139 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Description

A simple decentralized list tool

A simple decentralized tool to make lists.

Smart contract

Datastore layout

In the datastore we simply have one entry per entry of the list list_name:

["dlist"][len(list_name)][list_name][key] -> [value]  // note that len(list_name) is a constant-size integer that prevents key collisions when we have list names of various lengths
Smart contract interface:
read_item(list: Vec<u8>, key: Vec<u8>) -> Vec<u8>
    reads the value of an item, fails if does not exist

item_exists(list: Vec<u8>, key: Vec<u8>) -> bool
    checks if an item exists

remove_item(list: Vec<u8>, key: Vec<u8>)
    owner only
    removes an item, fails if does not exist

insert_item(list: Vec<u8>, key: Vec<u8>, value: Vec<u8>)
    owner only
    overwrites if exists

Web interface

A simple two-step interface:

  • step 1: the list name is taken from a URL parameter https://zzzzzzzzz.zzzzz/yyy/?list=xxxxx and displayed in the frontend. The user is asked to enter a key
    • if key exists in the datastore at ["dlist"][len(list_name)][list_name][key] (do not use the item_exists function, directly read the datastore):
      • step 2:
        • Display that the key is in the list
        • Show the associated value in a multiline textarea and allow the user to update it
        • Display a Remove from list button to remove the item
    • if the key is not in the list
      • step 2:
        • Display the key.
        • Allow the user to enter a value in a multiline textarea. Max len = 10 megabytes when encoded to utf8
        • Have a "Insert to list" button to insert the new value in the list

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.

Research direction

Start by locating the existing smart-contract and frontend entry points in the repository, then compare their conventions with the specified datastore layout and interface. Done means the decentralized list contract supports all four operations and the two-step web flow reads, inserts, updates, and removes values with the stated size limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.