Skip to content

Conversation

minhchau1112
Copy link

@minhchau1112 minhchau1112 commented Jul 4, 2025

Thank you for contributing to Mesh! We appreciate your effort and dedication to improving this project. To ensure that your contribution is in line with the project's guidelines and can be reviewed efficiently, please fill out the template below.

Remember to follow our Contributing Guide before submitting your pull request.

Summary

This pull request improves the hUTxO.toUTxO() function by accurately computing the scriptHash from the CBOR hex of the Plutus V3 script and adding the scriptRef field to the resulting UTxO.

Previously, the script hash was derived using .toString(), which might not yield a valid hash required for contract execution. By switching to resolveScriptHash(scriptRef, "V3"), we ensure that the script hash is consistent with on-chain expectations. Additionally, the returned UTxO now includes the actual script reference (scriptRef), which is required when submitting reference script-based transactions.

These changes make the UTxO structure more robust and compatible with Plutus V3 and reference script workflows.

Affect components

Please indicate which part of the Mesh Repo

  • @meshsdk/common
  • @meshsdk/contract
  • @meshsdk/core
  • @meshsdk/core-csl
  • @meshsdk/core-cst
  • @meshsdk/hydra
  • @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

This change does not introduce breaking behavior. It ensures the returned UTxO data is structurally accurate and consistent for Plutus smart contract transactions involving reference scripts.

Copy link

vercel bot commented Jul 4, 2025

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

Name Status Preview Comments Updated (UTC)
mesh-docs ❌ Failed (Inspect) Jul 16, 2025 8:44am

Copy link

vercel bot commented Jul 4, 2025

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

A member of the Team first needs to authorize it.

@HinsonSIDAN
Copy link
Member

@minhchau1112 can you pull main branch resolve conflict? Its ready to merge except that, thanks!

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.

4 participants