Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escrow dispute template and mappings #12

Open
jaybuidl opened this issue Jan 3, 2024 · 2 comments
Open

Escrow dispute template and mappings #12

jaybuidl opened this issue Jan 3, 2024 · 2 comments
Labels

Comments

@jaybuidl
Copy link
Member

jaybuidl commented Jan 3, 2024

Blocked by kleros/kleros-v2#1082, kleros/kleros-v2#1083, kleros/kleros-v2#1111
Relates to kleros/kleros-v2#1353

Draft Specification

disputeDetails.jsonc

{
  "$schema": "../NewDisputeTemplate.schema.json",
  "title": "{{title}}", // from the form
  "description": "{{description}}", // from the contract terms form
  "question": "Which party abided by the terms of the contract?",
  "answers": [
    {
      "title": "Refund the Buyer",
      "description": "Select this to return the funds to the Buyer."
    },
    {
      "title": "Pay the Seller",
      "description": "Select this to release the funds to the Seller."
    }
  ],
  "policyURI": "/ipfs/XxxxxXXX/escrow-general-policy.pdf", // not transaction-specific
  "attachment": { // transaction-specific
    "label": "Transaction Terms",
    "uri": "{{extraDescriptionUri}}"
  },
  "frontendUrl": "https://escrow-v2.kleros.builders/#/myTransactions/%s/overview", // deployment specific, might break over time
  "arbitrableChainID": "421614",
  "arbitrableAddress": "0x??", // Escrow, hardcode after deploy-time
  "arbitratorChainID": "421614",
  "arbitratorAddress": "0x??", // KlerosCore, hardcode after deploy-time
  "metadata": {
    "buyer": "{{buyer}}",
    "seller": "{{seller}}",
    "amount": "{{amount}}",
    "currency": "{{currency}}",
    "deadline": "{{deadline}}",
    "transactionUri": "{{transactionUri}}" // transaction-specific
  },
  "category": "Escrow",
  "specification": "KIPXXX",
  "aliases": {
    "Buyer": "{{buyer}}",
    "Seller": "{{seller}}"
  },
  "version": "1.0"
}

mappings.jsonc

[
  {
    "type": "abi/event",
    "abi": "event TransactionCreated(uint256 indexed _transactionID, string _transactionUri, address indexed _buyer, address indexed _seller, uint256 _amount, uint256 _currency, uint256 deadline)",
    "address": "[FIX AFTER DEPLOY]",
    "eventFilter": {
      "fromBlock": "[FIX AFTER DEPLOY]",
      "toBlock": "latest",
      "args": {
        "_transactionID": "[FROM EXTERNAL DISPUTE ID]"
      }
    },
    "seek": [
      "transactionUri",
      "buyer",
      "seller",
      "amount",
      "currency",
      "deadline"
    ],
    "populate": [
      "_transactionUri",
      "_buyer",
      "_seller",
      "_amount",
      "_currency",
      "_deadline"
    ]
  },
  {
    "type":"fetch/ipfsJson",
    "todo": "get title, description, extraDescriptionUri from _transactionUri"
  }
]
@kemuru
Copy link
Contributor

kemuru commented Apr 28, 2024

LATEST ESCROW V2 TEMPLATE AND DATA MAPPINGS AS OF 25th June 2024:

externalDisputeID:

0

template:

{
  "$schema": "../NewDisputeTemplate.schema.json",
  "title": "Escrow dispute: {{escrowTitle}}", 
  "description": "{{deliverableText}}", 
  "question": "Which party abided by the terms of the contract?",
  "answers": [
    {
      "title": "Refund the Buyer",
      "description": "Select this to return the funds to the Buyer."
    },
    {
      "title": "Pay the Seller",
      "description": "Select this to release the funds to the Seller."
    }
  ],
  "policyURI": "/ipfs/XxxxxXXX/escrow-general-policy.pdf", 
  "attachment": { 
    "label": "Transaction Terms",
    "uri": "{{{extraDescriptionUri}}}"
  },
  "frontendUrl": "https://escrow-v2.kleros.builders/#/transactions/{{externalDisputeID}}", 
  "arbitrableChainID": "421614",
  "arbitrableAddress": "0x??", 
  "arbitratorChainID": "421614",
  "arbitratorAddress": "0x??", 
  "metadata": {
    "buyer": "{{buyer}}",
    "seller": "{{seller}}",
    "amount": "{{amount}}",
    "token": "{{token}}",
    "deadline": "{{deadline}}",
    "transactionUri": "{{{transactionUri}}}" 
  },
  "category": "Escrow",
  "specification": "KIPXXX",
  "aliases": {
    "Buyer": "{{buyer}}",
    "Seller": "{{seller}}"
  },
  "version": "1.0"
}

data mappings:

[
  {
    "type": "graphql",
    "endpoint": "https://api.studio.thegraph.com/query/61738/escrow-v2-devnet/version/latest",
    "query": "query GetTransaction($transactionId: ID!) { escrow(id: $transactionId) { transactionUri buyer seller amount token deadline } }",
    "variables": {
      "transactionId": "{{externalDisputeID}}"
    },
    "seek": ["escrow.transactionUri", "escrow.buyer", "escrow.seller", "escrow.amount", "escrow.token", "escrow.deadline"],
    "populate": ["transactionUri", "buyer", "seller", "amount", "token", "deadline"]
  },
  {
    "type": "fetch/ipfs/json",
    "ipfsUri": "{{{transactionUri}}}",
    "seek": ["title", "description", "extraDescriptionUri"],
    "populate": ["escrowTitle", "deliverableText", "extraDescriptionUri"]
  }
]

@jaybuidl
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants