clrfund / monorepo

clr.fund dapp
https://clr.fund/
GNU General Public License v3.0
190 stars 91 forks source link

Insufficient recipient metadata for Kleros registry recipients #480

Open yuetloo opened 2 years ago

yuetloo commented 2 years ago

This issue was discovered testing PR #473.

When the UI is setup to use the Kleros recipient registry, noticed errors in the console log and the project profile is missing tagline, and other information.

Sample error in the console looks like this:

[Vue warn]: Error in render: "Error: Input data should be a String"

found in

---> <Transaction> at src/components/Markdown.vue
       <ProjectProfile> at src/components/ProjectProfile.vue
         <ProjectView> at src/views/Project.vue
           <Clr.fund> at src/App.vue
             <Root>

The issue appeared to be that the UI had evolved over time and added more field for project profile but the mapping of Kleros metadata was not updated.

Following lines showed only name, address, imageUrl and description fields are available for Kleros project. https://github.com/clrfund/monorepo/blob/develop/vue-app/src/api/recipient-registry-kleros.ts#L51-L55

yuetloo commented 2 years ago

I tested Kleros registry using the mock Kleros contract https://github.com/clrfund/monorepo/blob/develop/contracts/contracts/recipientRegistry/KlerosGTCRMock.sol

  1. deploy contract KlerosGTCRMock
  2. deploy contract KlerosGTCRAdapter
  3. call fundingRoundFactory.setRecipientRegistry(klerosRegistry)
  4. start new round (this is import because the subgrouph uses this event to trigger the indexing of KlerosRegistry)
  5. add recipient to the Kleros registry using the same method as the unit tests. https://github.com/clrfund/monorepo/blob/develop/contracts/tests/recipientRegistry.ts#L311

contracts are deployed on Rinkeby:

  1. Kleros recipient registry : https://rinkeby.etherscan.io/address/0x22ff798925a76b21f8122c04d10f177ea52d6411#code
  2. KlerosGTCRMock contract: https://rinkeby.etherscan.io/address/0x9C3cAB2780ABA806Cc221DF0fA9a259499aD1B14#code
  3. funding round factory: https://rinkeby.etherscan.io/address/0x93A990D939Ca592cD8cCa47b7a0c3F590A598F9d#code