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.
Update:
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)])])\")" ]
()
. 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.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 :)66
feels not right. It works on EmulatorTrace?