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

giftcard redeem: Insufficient input in transaction #496

Open
2 of 4 tasks
jinglescode opened this issue Feb 5, 2025 · 3 comments
Open
2 of 4 tasks

giftcard redeem: Insufficient input in transaction #496

jinglescode opened this issue Feb 5, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jinglescode
Copy link
Member

jinglescode commented Feb 5, 2025

Summary

error:

txBuildResult error: JsValue("Insufficient input in transaction. shortage: {policy id: "0666d7533c9942b63cefc1d2751fdf046d41e11be7343d4abe3992f1", asset name: "4d6573684769667443617264" coins in inputs: 0, coins in outputs: 1
 }")

Steps to reproduce the bug

  1. go to https://meshjs.dev/smart-contracts/giftcard
  2. connect using solution wallet
  3. txhash of create tx: c678860a8e51ddfca45f7dbc5609259cc7ee9b25825a4af0f13e418a9633a83b

Can also reproduce https://github.com/MeshJS/examples/tree/main/aiken-giftcard/src

Actual Result

txBuildResult error: JsValue("Insufficient input in transaction. shortage: {policy id: "0666d7533c9942b63cefc1d2751fdf046d41e11be7343d4abe3992f1", asset name: "4d6573684769667443617264" coins in inputs: 0, coins in outputs: 1
 }")

Expected Result

successful redeem

SDK version

1.9.0-beta.0

Environment type

  • Node.js
  • Browser
  • Browser Extension
  • Other

Environment details

No response

@jinglescode jinglescode added the bug Something isn't working label Feb 5, 2025
@HinsonSIDAN
Copy link
Member

It seems like the giftcard redemption intakes an incorrect (or previously) utxo ref for parameter.

@jinglescode
Copy link
Member Author

same for vesting withdraw https://meshjs.dev/smart-contracts/vesting#withdrawFund:

(400)
failed:
a40630d3b730bc415cb8782dba7d99c1fc19cd2ce941033bd59b21fc84fb1d1e
Some outputs have an insufficient amount of Ada attached to them. In fact, any new output created in a system must pay for the resources it occupies. Because user-created assets are worthless (from the point of view of the protocol), those resources must be paid in the form of a Ada deposit. The exact depends on the size of the serialized output: the more assets, the higher the amount. The field 'data.insufficientlyFundedOutputs.[].output' contains a list of all transaction outputs that are insufficiently funded. Starting from the Babbage era, the field 'data.insufficientlyFundedOutputs.[].minimumRequiredValue' indicates the required amount of Lovelace (1e6 Lovelace = 1 Ada) needed for each output.
Data: {"insufficientlyFundedOutputs":[{"output":{"address":"addr_test1qp56g0ny6ehduvm6hc2pc7g5avlfuvs868l00tr432w725q6dp5tx7w58ass4welxeprut7uh3wkjelph0pzrggezrzsfrrd4u","value":{"ada":{"lovelace":0}}},"minimumRequiredValue":{"ada":{"lovelace":952510}}}]}

Test tx hash: e257352d5365d5d1d4e031ad1bf86440a6f272df6d9c9b1f22dd2222acc6d02f

@HinsonSIDAN
Copy link
Member

It looks like erroreous parsing of output info, technically wont have 0 lovelace utxo on cardano. @twwu123 can you help check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants