@@ -72,6 +72,12 @@ contract CurateV2 is IArbitrableV2 {
7272 EvidenceModule evidenceModule; // The evidence module for the arbitrator.
7373 }
7474
75+ struct TemplateRegistryParams {
76+ address templateRegistry; // Dispute Template registry address
77+ string [2 ] registrationTemplateParameters; // Template and data mappings json for registration requests.
78+ string [2 ] removalTemplateParameters; // Template and data mappings json for removal requests.
79+ }
80+
7581 // ************************************* //
7682 // * Storage * //
7783 // ************************************* //
@@ -119,7 +125,7 @@ contract CurateV2 is IArbitrableV2 {
119125
120126 /// @dev Emitted when someone submits an item for the first time.
121127 /// @param _itemID The ID of the new item.
122- /// @param _data The item data URI .
128+ /// @param _data Stringified JSON Object containing item data. Example at :- https://cloudflare-ipfs.com/ipfs/QmTypFX9416z5V87Fsnf6A89rrskh2X8BSVdaKhwzXNiDb/item.json .
123129 /// @param _addedDirectly Whether the item was added via `addItemDirectly`.
124130 event NewItem (bytes32 indexed _itemID , string _data , bool _addedDirectly );
125131
@@ -146,28 +152,29 @@ contract CurateV2 is IArbitrableV2 {
146152 /// @param _arbitratorExtraData Extra data for the trusted arbitrator contract.
147153 /// @param _evidenceModule The evidence contract for the arbitrator.
148154 /// @param _connectedList The address of the Curate contract that stores related Curate addresses. This parameter can be left empty.
149- /// @param _registrationTemplateParameters Template and data mappings json for registration requests.
150- /// @param _removalTemplateParameters Template and data mappings json for removal requests.
151- /// @param _templateRegistry The dispute template registry.
155+ /// @param _templateRegistryParams The dispute template registry.
156+ /// - templateRegistry : The dispute template registry.
157+ /// - registrationTemplateParameters : Template and data mappings json for registration requests.
158+ /// - removalTemplateParameters : Template and data mappings json for removal requests.
152159 /// @param _baseDeposits The base deposits for requests/challenges as follows:
153160 /// - The base deposit to submit an item.
154161 /// - The base deposit to remove an item.
155162 /// - The base deposit to challenge a submission.
156163 /// - The base deposit to challenge a removal request.
157164 /// @param _challengePeriodDuration The time in seconds parties have to challenge a request.
158165 /// @param _relayerContract The address of the relayer contract to add/remove items directly.
166+ /// @param _listMetadata Stringified JSON object containing list metadata (title, description, isListOfLists, etc.). Example at :- https://cloudflare-ipfs.com/ipfs/QmekLsbXtQfm2jJjdeC5TF1cJcr5qxarZ9bhKmCS9s3ebK/list-metadata.json
159167 function initialize (
160168 address _governor ,
161169 IArbitratorV2 _arbitrator ,
162170 bytes calldata _arbitratorExtraData ,
163171 EvidenceModule _evidenceModule ,
164172 address _connectedList ,
165- string [2 ] calldata _registrationTemplateParameters ,
166- string [2 ] calldata _removalTemplateParameters ,
167- address _templateRegistry ,
173+ TemplateRegistryParams calldata _templateRegistryParams ,
168174 uint256 [4 ] calldata _baseDeposits ,
169175 uint256 _challengePeriodDuration ,
170- address _relayerContract
176+ address _relayerContract ,
177+ string calldata _listMetadata
171178 ) external {
172179 require (! initialized, "Already initialized. " );
173180 initialized = true ;
@@ -180,16 +187,16 @@ contract CurateV2 is IArbitrableV2 {
180187 challengePeriodDuration = _challengePeriodDuration;
181188 relayerContract = _relayerContract;
182189
183- templateRegistry = IDisputeTemplateRegistry (_templateRegistry );
190+ templateRegistry = IDisputeTemplateRegistry (_templateRegistryParams.templateRegistry );
184191 templateIdRegistration = templateRegistry.setDisputeTemplate (
185192 "Registration " ,
186- _registrationTemplateParameters [0 ],
187- _registrationTemplateParameters [1 ]
193+ _templateRegistryParams.registrationTemplateParameters [0 ],
194+ _templateRegistryParams.registrationTemplateParameters [1 ]
188195 );
189196 templateIdRemoval = templateRegistry.setDisputeTemplate (
190197 "Removal " ,
191- _removalTemplateParameters [0 ],
192- _removalTemplateParameters [1 ]
198+ _templateRegistryParams.removalTemplateParameters [0 ],
199+ _templateRegistryParams.removalTemplateParameters [1 ]
193200 );
194201
195202 arbitrationParamsChanges.push (
@@ -203,6 +210,8 @@ contract CurateV2 is IArbitrableV2 {
203210 if (_connectedList != address (0 )) {
204211 emit ConnectedListSet (_connectedList);
205212 }
213+
214+ emit ListMetadataSet (_listMetadata);
206215 }
207216
208217 // ************************************* //
@@ -317,7 +326,7 @@ contract CurateV2 is IArbitrableV2 {
317326 // ************************************* //
318327
319328 /// @dev Directly add an item to the list bypassing request-challenge. Can only be used by the relayer contract.
320- /// @param _item The URI to the item data.
329+ /// @param _item Stringified JSON Object containing Item data
321330 function addItemDirectly (string calldata _item ) external onlyRelayer {
322331 bytes32 itemID = keccak256 (abi.encodePacked (_item));
323332 Item storage item = items[itemID];
@@ -334,7 +343,7 @@ contract CurateV2 is IArbitrableV2 {
334343 }
335344
336345 /// @dev Directly remove an item from the list bypassing request-challenge. Can only be used by the relayer contract.
337- /// @param _itemID The ID of the item to remove.
346+ /// @param _itemID The ID of the item to remove. Example at :- https://cloudflare-ipfs.com/ipfs/QmTypFX9416z5V87Fsnf6A89rrskh2X8BSVdaKhwzXNiDb/item.json
338347 function removeItemDirectly (bytes32 _itemID ) external onlyRelayer {
339348 Item storage item = items[_itemID];
340349 require (item.status == Status.Registered, "Item must be registered to be removed. " );
@@ -345,7 +354,7 @@ contract CurateV2 is IArbitrableV2 {
345354 }
346355
347356 /// @dev Submit a request to register an item. Accepts enough ETH to cover the deposit, reimburses the rest.
348- /// @param _item The URI to the item data.
357+ /// @param _item Stringified JSON object containing item data. Example at :- https://cloudflare-ipfs.com/ipfs/QmTypFX9416z5V87Fsnf6A89rrskh2X8BSVdaKhwzXNiDb/item.json
349358 function addItem (string calldata _item ) external payable {
350359 bytes32 itemID = keccak256 (abi.encodePacked (_item));
351360 Item storage item = items[itemID];
0 commit comments