konoha icon indicating copy to clipboard operation
konoha copied to clipboard

ODHack: Discussion with onchain data

Open ondrejsojka opened this issue 1 year ago • 11 comments

Implement a comment submission and retrieval feature for proposals in the Konoha governance toolkit. This feature should allow govtoken holders to submit IPFS addresses as comments on proposals and retrieve these comments. Ensure this functionality integrates with the Proposals component to only allow commenting on live proposals and handles only the IPFS hashes, not the actual content.

Expected skill: Cairo developer medior

Steps:

Implement a new component (discussion.cairo) with add and retrieve comment functions, ensuring proposals that are being commented on are live. It should depend on the Proposals component for fetching get_live_proposals(). Implement storage mechanisms for IPFS hashes of comments. Update tests in tests/proposals.cairo to cover the new functionality. This clear and structured approach should help a newcomer understand and implement the feature effectively. For more details, please refer to the repository

Definition of Done

The Cairo code works as expected, has nearly full test coverage, is reasonably documented (docstrings or similar suffice) and readable.

Refer to CONTRIBUTING.md for information on claiming the task.

ondrejsojka avatar May 22 '24 16:05 ondrejsojka

@tensojka let me hop on this

EjembiEmmanuel avatar May 22 '24 16:05 EjembiEmmanuel

@EjembiEmmanuel Refer to https://github.com/CarmineOptions/konoha/blob/master/CONTRIBUTING.md please, you are missing an estimated delivery timeline. I would also appreciate a brief summary of your relevant skills, though not strictly required.

It would also be nice of you to join the Konoha Dev Telegram group for faster communication.

ondrejsojka avatar May 22 '24 16:05 ondrejsojka

i will like to jump on it

vibenedict avatar May 23 '24 02:05 vibenedict

@vibenedict You are also missing an estimated delivery timeline, see message above.

ondrejsojka avatar May 23 '24 09:05 ondrejsojka

@tensojka I should be able to get in done in 5 working days.

EjembiEmmanuel avatar May 23 '24 09:05 EjembiEmmanuel

mplement a comment submission and retrieval feature for proposals in the Konoha governance toolkit. This feature should allow govtoken holders to submit IPFS addresses as comments on proposals and retrieve these comments. Ensure this functionality integrates with the Proposals component to only allow commenting on live proposals and handles only the IPFS hashes, not the actual content.

Step 1: Set up the backend

  1. Create a new contract or modify an existing one to store comments for proposals. This contract should have the following functions:
    • createComment(ipfsHash: string, proposalId: uint256): adds a new comment to the proposal with the given IPFS hash.
    • getComments(proposalId: uint256): retrieves all comments associated with the given proposal ID.
    • isAdmin(user: address): checks whether the user is an admin, returning a boolean value.
  2. Deploy the contract on a blockchain platform of your choice (e.g., Ethereum, BSC, or polygon).

Step 2: Integrate with the Proposals component

  1. Modify the Proposals component to include a comment submission functionality. When a proposal is created or updated, trigger the createComment function to add a comment with a unique IPFS hash.
  2. Modify the Proposals component to display a "Comments" section for each live proposal. This section should list all comments associated with the proposal, including the IPFS hash.

I will carryout the task in five days

vibenedict avatar May 23 '24 10:05 vibenedict

@vibenedict Is this written with chatgpt? The function signatures aren't Cairo 1. there are no strings, we use underscore_case, uint256>u256 and others. Why the admin check??

Integration with Proposals makes no sense.

ondrejsojka avatar May 23 '24 10:05 ondrejsojka

Hi @tensojka, I would love to give this issue a try.

What I understood form your description is to create a new starknet component(discussion) which would have two functions for adding and retrieving IPFS addresses as comments. Comments should only be added for live proposals.

I will be needing 5 working days to tackle this.

manlikeHB avatar May 23 '24 23:05 manlikeHB

@manlikeHB Assigned you, sorry for missing this!

ondrejsojka avatar May 27 '24 12:05 ondrejsojka

Thank you @tensojka, is it alright to reach out to you on telegram if I have any issues?

manlikeHB avatar May 27 '24 13:05 manlikeHB

@manlikeHB Yes, please reach out, preferably in the konoha development group (see link in readme)

ondrejsojka avatar May 27 '24 13:05 ondrejsojka

@manlikeHB You haven't created a draft PR and it's been five days with no update from you, zero commits in your fork. Unassigning you.

ondrejsojka avatar Jun 01 '24 11:06 ondrejsojka

Hi @tensojka, I'll make a draft PR today.

manlikeHB avatar Jun 01 '24 11:06 manlikeHB

@manlikeHB Can you at least push the code you have?

ondrejsojka avatar Jun 01 '24 11:06 ondrejsojka

@tensojka Yes, I will.

manlikeHB avatar Jun 01 '24 11:06 manlikeHB