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

Improve pay/reimburse/execute flow #64

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
### Devnet
#### Arbitrum Sepolia

- [Escrow](https://sepolia.arbiscan.io/address/0x250AB0477346aDFC010585b58FbF61cff1d8f3ea)
- [EscrowToken](https://sepolia.arbiscan.io/address/0xe7B52a7Bc50cb4Ff13d057629082844780b6E28D)
- [EscrowUniversal](https://sepolia.arbiscan.io/address/0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De)
- [EscrowUniversal](https://sepolia.arbiscan.io/address/0xd3d61eB06c96F69D03B285392C269d5577ff2342)

#### Sepolia

Expand Down
70 changes: 44 additions & 26 deletions contracts/deploy/00-escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,66 @@ import { DeployFunction } from "hardhat-deploy/types";
import { HomeChains, isSkipped } from "./utils";

const disputeTemplate = `{
"title": "{{escrowTitle}}",
"description": "{{deliverableText}}",
"$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."
}
{
"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://TODO",
"attachment": {
"label": "Transaction Terms",
"uri": "{{extraDescriptionUri}}"
"policyURI": "/ipfs/XxxxxXXX/escrow-general-policy.pdf",
"attachment": {
"label": "Transaction Terms",
"uri": "{{extraDescriptionUri}}"
},
"frontendUrl": "https://escrow-v2.kleros.builders/#/myTransactions/%s",
"frontendUrl": "https://escrow-v2.kleros.builders/#/my-transactions/{{externalDisputeID}}",
"arbitrableChainID": "421614",
"arbitrableAddress": "0x250AB0477346aDFC010585b58FbF61cff1d8f3ea",
"arbitrableAddress": "0xFromContext",
"arbitratorChainID": "421614",
"arbitratorAddress": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8",
"arbitratorAddress": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8",
"metadata": {
"buyer": "{{address}}",
"seller": "{{sendingRecipientAddress}}",
"amount": "{{sendingQuantity}}",
"asset": "{{escrowType}}",
"timeoutPayment": "{{timeoutPayment}}",
"transactionUri": "{{transactionUri}}"
"buyer": "{{buyer}}",
"seller": "{{seller}}",
"amount": "{{amount}}",
"token": "{{token}}",
"deadline": "{{deadline}}",
"transactionUri": "{{transactionUri}}"
},
"category": "Escrow",
"specification": "KIPXXX",
"aliases": {
"Buyer": "{{address}}",
"Seller": "{{sendingRecipientAddress}}"
"Buyer": "{{buyer}}",
"Seller": "{{seller}}"
},
"version": "1.0"
}
`;

const mapping = `{}`;
const mapping = `[
{
"type": "graphql",
"endpoint": "https://gateway-arbitrum.network.thegraph.com/api/{{graphApiKey}}/subgraphs/id/3aZxYcZpZL5BuVhuUupqVrCV8VeNyZEvjmPXibyPHDFQ",
"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"]
}
]`;

// General court, 3 jurors
const extraData =
Expand Down
Loading
Loading