-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1165 from kleros/feat(sdk)/data-mappings
SDK: data mappings (WIP)
- Loading branch information
Showing
62 changed files
with
3,317 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALCHEMY_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"subCategory": "General Service", | ||
"arbitrableAddress": "0x0d67440946949fe293b45c52efd8a9b3d51e2522", | ||
"title": "Liquidity Withdrawal Transfer Ownership Agreement ", | ||
"description": "PARTIES:\nParty 1 (hereinafter referred to as the \"Seller\"):\n* Ethereum Address: 0xc4c4e8144823000d97310756d3237B305E967a09\n\nParty 2 (hereinafter referred to as the \"Buyer\"):\n* Ethereum Address: 0x213fea050A0dA676E97B4dc40e37E985008EA1a0\n\nRECITALS\n\nA. The Seller is the owner of an ERC-20 token contract, whose liquidity is locked on the UNCX.network platform.\nB. The \"Rights'' herein refer to the ability to demand liquidity withdrawal of the aforementioned ERC-20 token through the UNCX.network service by having the designated rights-holder's address assigned to the Gudetama in the contract 0x257EeF05f232B566cD0aF298Ec0B45C2C18d16c7 on the Ethereum chain.\n\nAGREEMENT\n\nTransfer of Rights:\n1.1. The transfer shall be completed by 12:00, Wednesday 20, December 2023 EDT, to the Buyer at the ETH wallet address: 0x8e6f7b23Cdf06db96FD96F4aF8369c0131FAf0F6.\n\nPayment:\n2.1. Upon successful fulfillment of 1.1, the Buyer shall transfer the full amount of 1,4 ETH to the Seller.\n\nNo Partial Payment:\n3.1. There shall be no conditions under which partial payment can be demanded by the Seller, unless the Buyer chooses to do so voluntarily through the Escrow contract.\n\nKleros Escrow:\n4.1. Any disputes arising from this Agreement shall be automatically escalated to the Court of Kleros after both parties fund the dispute resolution deposit. Should one side fail to do so in full, the other party will automatically win the dispute.", | ||
"sender": "0x213fea050A0dA676E97B4dc40e37E985008EA1a0", | ||
"receiver": "0xc4c4e8144823000d97310756d3237B305E967a09", | ||
"amount": "1.4", | ||
"timeout": 8640000000000000, | ||
"token": { | ||
"name": "Ethereum", | ||
"ticker": "ETH", | ||
"symbolURI": "/static/media/eth.33901ab6.png", | ||
"address": null, | ||
"decimals": 18 | ||
}, | ||
"extraData": { | ||
"Contract Information": "PARTIES:\nParty 1 (hereinafter referred to as the \"Seller\"):\n* Ethereum Address: 0xc4c4e8144823000d97310756d3237B305E967a09\n\nParty 2 (hereinafter referred to as the \"Buyer\"):\n* Ethereum Address: 0x213fea050A0dA676E97B4dc40e37E985008EA1a0\n\nRECITALS\n\nA. The Seller is the owner of an ERC-20 token contract, whose liquidity is locked on the UNCX.network platform.\nB. The \"Rights'' herein refer to the ability to demand liquidity withdrawal of the aforementioned ERC-20 token through the UNCX.network service by having the designated rights-holder's address assigned to the Gudetama in the contract 0x257EeF05f232B566cD0aF298Ec0B45C2C18d16c7 on the Ethereum chain.\n\nAGREEMENT\n\nTransfer of Rights:\n1.1. The transfer shall be completed by 12:00, Wednesday 20, December 2023 EDT, to the Buyer at the ETH wallet address: 0x8e6f7b23Cdf06db96FD96F4aF8369c0131FAf0F6.\n\nPayment:\n2.1. Upon successful fulfillment of 1.1, the Buyer shall transfer the full amount of 1,4 ETH to the Seller.\n\nNo Partial Payment:\n3.1. There shall be no conditions under which partial payment can be demanded by the Seller, unless the Buyer chooses to do so voluntarily through the Escrow contract.\n\nKleros Escrow:\n4.1. Any disputes arising from this Agreement shall be automatically escalated to the Court of Kleros after both parties fund the dispute resolution deposit. Should one side fail to do so in full, the other party will automatically win the dispute." | ||
}, | ||
"invoice": false, | ||
"category": "Escrow", | ||
"question": "Which party abided by terms of the contract?", | ||
"rulingOptions": { | ||
"type": "single-select", | ||
"titles": [ | ||
"Refund Sender", | ||
"Pay Receiver" | ||
], | ||
"descriptions": [ | ||
"Select to return funds to the Sender", | ||
"Select to release funds to the Receiver" | ||
] | ||
}, | ||
"evidenceDisplayInterfaceURI": "/ipfs/QmfPnVdcCjApHdiCC8wAmyg5iR246JvVuQGQjQYgtF8gZU/index.html", | ||
"aliases": { | ||
"0x213fea050A0dA676E97B4dc40e37E985008EA1a0": "sender", | ||
"0xc4c4e8144823000d97310756d3237B305E967a09": "receiver" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
kleros-sdk/config/v2-disputetemplate/escrow/DataMappings.escrow.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ | ||
"type": "abi/event", | ||
"abi": "event TransactionCreated(uint256 indexed _transactionID, string _transactionUri, address indexed _buyer, address indexed _seller, uint256 _amount, string _asset, uint256 _deadline)", | ||
"address": "[FIX AFTER DEPLOY]", | ||
"eventFilter": { | ||
"fromBlock": "[FIX AFTER DEPLOY]", | ||
"toBlock": "latest", | ||
"args": { | ||
"_transactionID": "[FROM EXTERNAL DISPUTE ID]" | ||
} | ||
}, | ||
"seek": [ | ||
"transactionUri", | ||
"buyer", | ||
"seller", | ||
"amount", | ||
"asset", | ||
"deadline" | ||
], | ||
"populate": [ | ||
"_transactionUri", | ||
"_buyer", | ||
"_seller", | ||
"_amount", | ||
"_asset", | ||
"_deadline" | ||
] | ||
}, | ||
{ | ||
"type":"fetch/ipfsJson", | ||
"todo": "get title, description, extraDescriptionUri from _transactionUri" | ||
} | ||
] |
41 changes: 41 additions & 0 deletions
41
kleros-sdk/config/v2-disputetemplate/escrow/DisputeDetails.escrow.jsonc.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$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", // 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}}", // in Wei or ERC20 units | ||
"asset": "{{asset}}", // "0" or "native" or "0x1234..." or "erc20:0x1234...", cf. CAIP-19,20,21 | ||
"deadline": "{{deadline}}", | ||
"transactionUri": "{{transactionUri}}" // transaction-specific | ||
}, | ||
"category": "Escrow", | ||
"specification": "KIPXXX", | ||
"aliases": { | ||
"Buyer": "{{buyer}}", | ||
"Seller": "{{seller}}" | ||
}, | ||
"version": "1.0" | ||
} |
7 changes: 7 additions & 0 deletions
7
kleros-sdk/config/v2-disputetemplate/escrow/DisputeRequest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type DisputeRequest = { | ||
arbitrator: string; // klerosCore address | ||
arbitrableDisputeID: number; // dispute id | ||
externalDisputeID: number; // Escrow transaction id | ||
templateId: number; // Escrow configuration | ||
templateUri: string; // empty | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.