1

currently in the 3rd cohort and doing week 2 HW, specifically Homework1.hs. My code compiles, but when I run in the local playground and try the 'give' endpoint, I just keep getting 'Contract instance stopped with error: "WalletError (ValidationError (ValueContainsLessThanMinAda...' which from what I can find means I need to send a certain ADA value as a transaction fee along with the lovelace amount specified in 'give'.

This seems like an error in the playground or in the rest of the provided code for this homework as there is no option to do so. Can anyone confirm? Below is the scenario I'm running.

enter image description here

Here also is the error I'm getting:

Contract instance stopped with error: "WalletError (ValidationError (ValueContainsLessThanMinAda (Tx {txInputs = fromList [TxIn {txInRef = TxOutRef {txOutRefId = 6945becead343ee16a04848adee6d24bcf05129b355021411a0b65eca6e6624e, txOutRefIdx = 1}, txInType = Just ConsumePublicKeyAddress}], txCollateral = fromList [], txOutputs = [TxOut {txOutAddress = Address {addressCredential = PubKeyCredential a2c20c77887ace1cd986193e4e75babd8993cfd56995cd5cfce609c2, addressStakingCredential = Nothing}, txOutValue = Value (Map [(,Map [(\"\",99900000)])]), txOutDatumHash = Nothing},TxOut {txOutAddress = Address {addressCredential = ScriptCredential 847f43379bc66c74dcbe4b92912dd88a44eaa66cde36c55b9d082365, addressStakingCredential = Nothing}, txOutValue = Value (Map [(,Map [(\"\",100000)])]), txOutDatumHash = Just 923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec}], txMint = Value (Map []), txFee = Value (Map []), txValidRange = Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True}, txMintScripts = fromList [], txSignatures = fromList [(8d9de88fbf445b7f6c3875a14daba94caee2ffcbc9ac211c95aba0a2f5711853,5a77c67d8fa23cd9a1f2a3e496a323ce8ffd0468d99491e4b651ea6b385a34dc6dc9085d812cbb00ccb95bdc9946ad9c1d8cffae640ecb82c2bfdc1794c0d907)], txRedeemers = fromList [], txData = fromList [(923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec,Datum {getDatum = Constr 0 []})]}) (TxOut {txOutAddress = Address {addressCredential = ScriptCredential 847f43379bc66c74dcbe4b92912dd88a44eaa66cde36c55b9d082365, addressStakingCredential = Nothing}, txOutValue = Value (Map [(,Map [(\"\",100000)])]), txOutDatumHash = Just 923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec})))" ]

Edit to add: here's my code as well, the parts that I edited at least enter image description here

1 Answer 1

1

There's a constraint that an UTXO must have at least 2 ADA (2.000.000 lovelaces).

I guess that because you are giving less than this value (100.000 lovelaces) you get that error.

1
  • Retried with 2 ADA, and it worked. One other thing I did though was do a 'cabal update' and 'cabal build' before starting the playground. I might have missed doing that when switching to week 2 Commented Jan 31, 2022 at 21:46

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.