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

Improve pay/reimburse/execute flow #64

merged 4 commits into from
Jun 20, 2024

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Jun 19, 2024

contracts to be redeployed


PR-Codex overview

Focus: This PR updates the Escrow system to version 2.0.3 on Arbitrum Sepolia, modifies contract addresses, emits payment events, and enhances dispute templates.

Detailed summary

  • Updated Escrow system to version 2.0.3 on Arbitrum Sepolia.
  • Changed contract addresses and emitted payment events.
  • Modified dispute templates for clarity and added schema.
  • Adjusted IPFS URI and frontend URL.
  • Enhanced GraphQL mapping for transaction details.

The following files were skipped due to too many changes: contracts/deployments/arbitrumSepoliaDevnet/EscrowUniversal.json

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added event emissions for Payment and TransactionResolved in the escrow transactions.
  • Documentation

    • Updated the EscrowUniversal contract address in the documentation for Arbitrum Sepolia.
  • Chores

    • Updated the dispute template schema, policy URI, frontend URL, and metadata fields for escrow deployment.
    • Changed the EscrowUniversal data source address and start block in the subgraph configuration.
    • Bumped the version of @kleros/escrow-v2-subgraph from 2.0.1 to 2.0.3.

Copy link
Contributor

coderabbitai bot commented Jun 19, 2024

Walkthrough

Recent updates to the EscrowUniversal contract enhance functionality with the emission of Payment and TransactionResolved events to track transaction statuses more transparently. Moreover, the project’s documentation, deployment scripts, and subgraph configuration were updated with new addresses, associative metadata, and schema references enhancing the clarity, usability, and operational efficiency of the escrow system.

Changes

File Summary
contracts/src/EscrowUniversal.sol Added event emissions (Payment, TransactionResolved) for payment handling and resolutions.
contracts/README.md Updated EscrowUniversal contract link to the new Sepolia address.
contracts/deploy/00-escrow.ts Modified schema, policy URI, frontend URL, arbitrable address, metadata, and mappings.
subgraph/package.json Incremented version from 2.0.1 to 2.0.3.
subgraph/subgraph.yaml Updated EscrowUniversal address and start block.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EscrowContract as EscrowUniversal
    participant Event as EventHandler
    User->>+EscrowContract: executePayment(transactionID, amount)
    EscrowContract->>Event: emit Payment(transactionID, amount, msg.sender)
    EscrowContract-->>-User: completePayment
    User->>+EscrowContract: reimburse(transactionID, amountReimbursed)
    EscrowContract->>Event: emit Payment(transactionID, amountReimbursed, msg.sender)
    EscrowContract-->>-User: completeReimbursement
    User->>+EscrowContract: resolve(transactionID)
    EscrowContract->>Event: emit TransactionResolved(transactionID, Resolution.TransactionExecuted)
    EscrowContract-->>-User: completeResolution
Loading

Poem

In the code's enchanted garden,
Events now bloom with flair,
Payments flow like rivers,
And Resolutions fill the air.
With links anew, the escrow grew,
More robust, just, and fair.
🌿✨🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7fc6397 and 24d0a04.

Files selected for processing (1)
  • contracts/src/EscrowUniversal.sol (3 hunks)
Files not reviewed due to errors (1)
  • contracts/src/EscrowUniversal.sol (no review received)

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 19, 2024
Copy link

netlify bot commented Jun 19, 2024

Deploy Preview for kleros-escrow-v2 ready!

Name Link
🔨 Latest commit 14f9934
🔍 Latest deploy log https://app.netlify.com/sites/kleros-escrow-v2/deploys/6674538fe9ce9b000819ffd2
😎 Deploy Preview https://deploy-preview-64--kleros-escrow-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kemuru kemuru requested a review from unknownunknown1 June 19, 2024 16:22
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 24d0a04 and 4b11b6b.

Files selected for processing (2)
  • contracts/README.md (1 hunks)
  • contracts/deploy/00-escrow.ts (1 hunks)
Additional context used
LanguageTool
contracts/README.md

[uncategorized] ~69-~69: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... env vars are required: - PRIVATE_KEY: the private key of the deployer account...


[uncategorized] ~70-~70: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...or the testnets. - MAINNET_PRIVATE_KEY: the private key of the deployer account...


[uncategorized] ~71-~71: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...unt used for Mainnet. - INFURA_API_KEY: the API key for infura. The ones below...


[uncategorized] ~75-~75: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...low are optional: - ETHERSCAN_API_KEY: to verify the source of the newly deplo...


[uncategorized] ~76-~76: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...s on Etherscan. - ARBISCAN_API_KEY: to verify the source of the newly deplo...


[uncategorized] ~77-~77: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... on Arbitrum. - GNOSISSCAN_API_KEY: to verify the source of the newly deplo...


[uncategorized] ~81-~81: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short). (COMMA_COMPOUND_SENTENCE_2)
Context: ...ed for the kleros-v2 contracts currently so this would fail. For now consider deplo...


[typographical] ~81-~81: Consider adding a comma here. (FOR_NOW_COMMA)
Context: ...contracts currently so this would fail. For now consider deploying to a testnet fork (n...


[grammar] ~89-~89: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)? (PREPOSITION_VERB)
Context: ...node --tags nothing **Shell 2: the deploy script** bash yarn deploy --network...


[grammar] ~105-~105: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)? (PREPOSITION_VERB)
Context: ... start-testnet-fork **Shell 2: the deploy script** bash yarn deploy-devnet-fo...


[uncategorized] ~123-~123: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... on Public Testnets Same steps as above but append Devnet to the --network para...

Markdownlint
contracts/README.md

12-12: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


15-15: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


9-9: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


10-10: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


16-16: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


17-17: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


83-83: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


89-89: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


97-97: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


105-105: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


127-127: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


133-133: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Additional comments not posted (3)
contracts/README.md (1)

19-19: Updated deployment link to the new contract address.

Please verify that the provided link is correct and active.

contracts/deploy/00-escrow.ts (2)

6-42: Updated dispute template with new schema, dynamic titles, and additional metadata fields.

Consider adding comments in the code to explain how template variables like {{escrowTitle}} and {{deliverableText}} are replaced at runtime.


48-65: Enhanced mapping configuration with GraphQL and IPFS integration.

Ensure that the GraphQL endpoint and IPFS URI are correctly configured and operational.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 20, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4b11b6b and 14f9934.

Files selected for processing (2)
  • subgraph/package.json (1 hunks)
  • subgraph/subgraph.yaml (1 hunks)
Files skipped from review due to trivial changes (1)
  • subgraph/package.json
Additional comments not posted (2)
subgraph/subgraph.yaml (2)

9-9: Updated contract address to '0xd3d61eB06c96F69D03B285392C269d5577ff2342'.

Ensure this address is correct and consistent with other parts of the project where the contract address is used.


11-11: Updated startBlock to 56637255.

Verify this block number corresponds to the block at which the updated contract was deployed.

@jaybuidl jaybuidl merged commit 659d346 into master Jun 20, 2024
5 of 6 checks passed
@jaybuidl jaybuidl deleted the feat/pay-improvement branch June 20, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compatibility: ABI change 🗯 Smart contract ABI is changing. Package: Contracts Escrow smart contracts Type: Enhancement ✨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant