mesh
mesh copied to clipboard
giftcard redeem: Insufficient input in transaction
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
- go to https://meshjs.dev/smart-contracts/giftcard
- connect using
solutionwallet - 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
- [x] Node.js
- [x] Browser
- [ ] Browser Extension
- [ ] Other
Environment details
No response
It seems like the giftcard redemption intakes an incorrect (or previously) utxo ref for parameter.
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
It looks like erroreous parsing of output info, technically wont have 0 lovelace utxo on cardano. @twwu123 can you help check