You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data mappings describe how the variables from the dispute templates are populated from a data source.
The following data sources are initially supported: json (=hardcoded), subgraph, abi/call, abi/event, fetch/ipfs/json
A generic fetch might be added if really necessary, but likely requires additional security considerations to prevent XSS.
Example
Input 1: Dispute Template
{
"title": "A reality.eth question",
"description": "A reality.eth question has been raised to arbitration.",
"frontendUrl": "https://reality.eth.limo/app/#!/question/{{ realityAddress }}-{{ questionId }}",
}
Input 2: Dispute Template Mappings
This is a basic mapping with hardcoded data (json type). A more advanced example would retrieve the values from an onchain event or a subgraph endpoint.
{
"title": "A reality.eth question",
"description": "A reality.eth question has been raised to arbitration.",
"frontendUrl": "https://reality.eth.limo/app/#!/question/0x14a6748192aBC6E10CA694Ae07bDd4327D6c7A51-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39",
}
API
typeSubgraphMapping={endpoint: string;// Subgraph endpointquery: string;// Subgraph queryseek: string[];// Subgraph query parameters value used to populate the template variablespopulate: string[];// Populated template variables};typeAbiEventMapping={abi: string;// ABI of the contract emitting the eventaddress: string;// Address of the contract emitting the eventeventFilter: {// Event filter (eg. specific parameter value, block number range, event index)fromBlock: BigInt|string;// Block number range starttoBlock: BigInt|string;// Block number range endargs: any;// Event parameter value to filter on};seek: string[];// Event parameters value used to populate the template variablespopulate: string[];// Populated template variables};typeAbiCallMapping={abi: string;// ABI of the contract emitting the eventaddress: string;// Address of the contract emitting the eventargs: any[];// Function argumentsseek: string[];// Call return parameters used to populate the template variablespopulate: string[];// Populated template variables};typeJsonMapping={value: object;// Hardcoded object, to be stringified.seek: string[];// JSON keys used to populate the template variablespopulate: string[];// Populated template variables};typeFetchIpfsJsonMapping={ipfsUri: string;// IPFS URLseek: string[];// JSON keys used to populate the template variablespopulate: string[];// Populated template variables};
This specification and implementation must accommodate complex use cases such as mappings for a Reality dispute.
⚠️ Disambiguation: the "Reality template" and "Reality question" are part of the Reality datamodel designed by Reality and outside the control of Kleros. In contrast, the "dispute template" and "dispute question" are part of the Kleros datamodel and are the subject of this specification.
For a Reality dispute:
first the Reality question must be retrieved,
then the Reality template,
then they must be executed (=populated),
then finally it can be used as an input to the dispute template. The steps in more details can be found here.
Overview
The data mappings describe how the variables from the dispute templates are populated from a data source.
The following data sources are initially supported:
json
(=hardcoded),subgraph
,abi/call
,abi/event
,fetch/ipfs/json
A generic
fetch
might be added if really necessary, but likely requires additional security considerations to prevent XSS.Example
Input 1:
Dispute Template
Input 2:
Dispute Template Mappings
This is a basic mapping with hardcoded data (
json
type). A more advanced example would retrieve the values from an onchain event or a subgraph endpoint.Output:
Dispute Details
API
Full JSON Example
Acceptance Criteria
This specification and implementation must accommodate complex use cases such as mappings for a Reality dispute.
For a Reality dispute:
Here is an example of Reality question created on Arbitrum Goerli which can be used for testing:
0x1747ed3af678c3d8415171a0f8453e38a9de4cf37aed83f1d477218d194c5f4b
question_text : {"title": "%s", "type": "bool", "category": "%s", "lang": "%s"}
The text was updated successfully, but these errors were encountered: