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

Return assets to initiator if cancelled at the stage of Initiation #485

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leomayleomay
Copy link

@leomayleomay leomayleomay commented Jan 22, 2025

Summary

Return the assets to initiator when cancelled at the stage of Initiation, otherwise the assets will be locked forever

Affect components

Please indicate which part of the Mesh Repo

  • @meshsdk/common
  • @meshsdk/contract
  • @meshsdk/core
  • @meshsdk/core-csl
  • @meshsdk/core-cst
  • @meshsdk/provider
  • @meshsdk/react
  • @meshsdk/svelte
  • @meshsdk/transaction
  • @meshsdk/wallet
  • Mesh playground (i.e. https://meshjs.dev/)
  • Mesh CLI

Type of Change

Please mark the relevant option(s) for your pull request:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Code refactoring (improving code quality without changing its behavior)
  • Documentation update (adding or updating documentation related to the project)

Related Issues

Please add the related issue here if any

Checklist

Please ensure that your pull request meets the following criteria:

  • My code is appropriately commented and includes relevant documentation, if necessary
  • I have added tests to cover my changes, if necessary
  • I have updated the documentation, if necessary
  • All new and existing tests pass (i.e. npm run test)
  • The build is pass (i.e. npm run build)

Additional Information

If you have any additional information or context to provide, such as screenshots, relevant issues, or other details, please include them here.

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mesh-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 11:24am

Copy link

vercel bot commented Jan 22, 2025

@leomayleomay is attempting to deploy a commit to the MeshJS Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@HinsonSIDAN HinsonSIDAN left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! The output value check is indeed intentionally ignored since it is implicitly guarded.

Imagine you are the escrow creator and you want to cancel, since you are building the tx to cancel, the value locked would implicitly going to your change address.

This unguarded pattern is also intentionally implemented so that to prevent permanent lock of circulation due to careless offchain construction at initiation.

Thus, the change would not be merged. But we do appreciate your attempt. Alternatively you can revert the change and add a comment on this pattern and i would approve the PR accordingly, otherwise i would discard this PR.

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

Successfully merging this pull request may close these issues.

2 participants