I am running my smart contract on the plutus-playground and getting the error below:

Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"\\\",100000000)]),(66,Map [(\\\"ElysiumTitanBid0\\\",1),(\\\"ElysiumTitanBid1\\\",1),(\\\"ElysiumTitanBid2\\\",1)])]) expected: Value (Map [(6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3,Map [(\\\"ElysiumTitanBid0\\\",1),(\\\"ElysiumTitanBid1\\\",1),(\\\"ElysiumTitanBid2\\\",1)])])\")" ]

The script is here

It looks like the output is expected to contain something related to the policyID that I had declared in the script, how do I initialise this as a test value so I don't get this InsufficientFunds error?

I'm running the basic init action, and then a wait. I believe the init action is where the policyID is being required, my vague understanding is that the token should somehow be associated with the policyID? I'm not sure if this is correct or how to reflect that in the code.


I've tried changing to this:

tkSymbol :: CurrencySymbol tkSymbol = currencySymbol "6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3" 
mkSchemaDefinitions ''TradeSchema elysiumtitan0 = KnownCurrency (fromSymbol tkSymbol) "Token" (TokenName "ElysiumTitan0" :| []) 

And the error changes to this, which seems a step closer. However the policyId is coming through strangely, perhaps it is being encoded or something?:

Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"\\\",100000000)]),(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\"ElysiumTitanBid0\\\",1),(\\\"ElysiumTitanBid1\\\",1),(\\\"ElysiumTitanBid2\\\",1)])]) expected: Value (Map [(6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3,Map [(\\\"ElysiumTitanBid0\\\",1),(\\\"ElysiumTitanBid1\\\",1),(\\\"ElysiumTitanBid2\\\",1)])])\")" ]

screenshot of initialising wallet screenshot of running the init action and then a wait

  • It would be helpful if you would provide the actions you are trying to run and what inputs you entered for the actions.
    – eddex
    Commented Sep 26, 2022 at 8:47
  • Have edited, thanks @eddex Commented Sep 26, 2022 at 20:20
  • The init params schema is being defined here github.com/naeri-kailash/elysium-plutus/blob/…, as you can see, it's (). If you need to pass a policy id you should define it there. But looking at your code, policy id is already hard-coded in the init function. Commented Sep 26, 2022 at 20:53
  • @WalkerLeite so it seems like while the expectation is for the policyID to be attached as stated in the init functions, when the test values are created github.com/naeri-kailash/elysium-plutus/blob/… it is with 66 rather than the policyID. Is the only way to amend this through the init function? I will make that change and test it now. Thanks for taking a look :) Commented Sep 26, 2022 at 21:02
  • Yeah, 66 feels not right. It works on EmulatorTrace? Commented Sep 26, 2022 at 21:38


Your Answer

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