2

Here is a trace for wallet1:

[ Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Contract instance started
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Current requests (3):   Iteration 1 request ID 3
                                    Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 2
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
              Iteration 1 request ID 1
              Request: "{\"contents\":{\"aeMetadata\":null,\"aeDescriptio
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            No requests handled
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Receive endpoint call on 'start' for Object (fromList [("contents",Array [Object (fromList [("getEndpointDescription",String "start")]),Object (fromList [("unEndpointValue",Object (fromList [("spCurrency",Object (fromList [("unCurrencySymbol",String "66")])),("spDeadline",Number 1.596059101e9),("spMinBid",Number 1.0e8),("spToken",Object (fromList [("unTokenName",String "T")]))]))])]),("tag",String "ExposeEndpointResp")])
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Handled request:   Iteration 1 request ID 1
                               Response: "{\"contents\":[{\"getEndpointDescription\":\"star
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Current requests (1):   Iteration 2 request ID 1
                                    Request: "{\"tag\":\"OwnPublicKeyHashReq\"}"
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Handled request:   Iteration 2 request ID 1
                               Response: "{\"contents\":{\"getPubKeyHash\":\"a2c20c77887ace
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Current requests (1):   Iteration 3 request ID 1
                                    Request: "{\"contents\":{\"unBalancedTxTx\":{\"txData\":[[\
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Handled request:   Iteration 3 request ID 1
                               Response: "{\"contents\":{\"contents\":{\"contents\":{\"cont
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Current requests (0): 
, Slot 1: 00000000-0000-4000-8000-000000000001 {Wallet W872c}:
            Contract instance stopped with error: "WalletError (ValidationError (ValueContainsLessThanMinAda (Tx {txInputs = fromList [TxIn {txInRef = TxOutRef {txOutRefId = 183d5544f89d5e0a5cfcbd8330c73a5f629925ed5f076b5a1b06e60a35147d4c, txOutRefIdx = 2}, txInType = Just ConsumePublicKeyAddress}], txCollateral = fromList [], txOutputs = [TxOut {txOutAddress = Address {addressCredential = PubKeyCredential a2c20c77887ace1cd986193e4e75babd8993cfd56995cd5cfce609c2, addressStakingCredential = Nothing}, txOutValue = Value (Map [(,Map [(\"\",100000000000)])]), txOutDatumHash = Nothing},TxOut {txOutAddress = Address {addressCredential = ScriptCredential 8c770b7ff9ed4a5df36ca914d18723596df69556597678d9872e2158, addressStakingCredential = Nothing}, txOutValue = Value (Map [(66,Map [(\"T\",1)])]), txOutDatumHash = Just 50536f27f0948527e1df0489a97781d16155f92623b8559e00e7341f2fb0f24d}], txMint = Value (Map []), txFee = Value (Map []), txValidRange = Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True}, txMintScripts = fromList [], txSignatures = fromList [(8d9de88fbf445b7f6c3875a14daba94caee2ffcbc9ac211c95aba0a2f5711853,b129c9922646ca3d0b1fb5349ce515d4b4aca392825794478df4479182f8e2d53c5157829cf1c72628bb7b419cafd131cfcab251188af2c9e9c5064e03045d08)], txRedeemers = fromList [], txData = fromList [(50536f27f0948527e1df0489a97781d16155f92623b8559e00e7341f2fb0f24d,Datum {getDatum = Constr 0 [Constr 0 [B \"\\162\\194\\fw\\136z\\206\\FS\\217\\134\\EM>Nu\\186\\189\\137\\147\\207\\213i\\149\\205\\\\\\252\\230\\t\\194\",I 1596059101,I 100000000,B \"f\",B \"T\"],Constr 1 []]})]}) (Lovelace {getLovelace = 2000000})))" ]

Why I am getting this error, how to avoid it?

1 Answer 1

1

The last line indicates the issue. It shows the transaction you build:

Tx {
  txInputs = fromList [
    TxIn {txInRef = TxOutRef {txOutRefId = 183d5..47d4c, txOutRefIdx = 2}, txInType = Just ConsumePublicKeyAddress}
  ], 
  txCollateral = fromList [],
  txOutputs = [
      TxOut {
        txOutAddress = Address {addressCredential = PubKeyCredential a2c20c778..09c2, addressStakingCredential = Nothing},
        txOutValue = Value (Map [(,Map [(\"\",100000000000)])]),
        txOutDatumHash = Nothing
      },
      TxOut {
        txOutAddress = Address {addressCredential = ScriptCredential 8c770b7ff9..158, addressStakingCredential = Nothing},
        txOutValue = Value (Map [(66,Map [(\"T\",1)])]),
        txOutDatumHash = Just 50536f27f0948..2fb0f24d
      }
  ],
  txMint = Value (Map []),
  txFee = Value (Map []),
  txValidRange = Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True},
  txMintScripts = fromList [],
  txSignatures = fromList [(8d9de8..711853, b129c992..e03045d08)],
  txRedeemers = fromList [],
  ...
}

You can see in the field txOutputs the second output value is txOutValue = Value (Map [(66,Map [(\"T\",1)])]). You are trying to put a native asset into a UTxO without also including Ada.

On Cardano, UTxO always need to include Ada. You cannot just send some tokens. You can find how much Ada is needed here in the documentation: minimum-ada-value-requirement

2
  • I was following the steps from the plutus-pioneer-program.readthedocs.io/en/latest/pioneer/… Yes, there was mention that I must include Adas to UTxO, OK. But I'm just a beginner. I wanted to test the smart contract. Dec 8, 2021 at 10:22
  • 1
    I think it worked in the Plutus Pioneer Program because this restriction was not enforced. This probably changed.
    – Jey
    Dec 8, 2021 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.