<p>I am running my smart contract on the <code>plutus-playground</code> and getting the error below:</p>
<pre><code>Contract instance stopped with error: &quot;WalletError (InsufficientFunds \&quot;Total: Value (Map [(,Map [(\\\&quot;\\\&quot;,100000000)]),(66,Map [(\\\&quot;ElysiumTitanBid0\\\&quot;,1),(\\\&quot;ElysiumTitanBid1\\\&quot;,1),(\\\&quot;ElysiumTitanBid2\\\&quot;,1)])]) expected: Value (Map [(6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3,Map [(\\\&quot;ElysiumTitanBid0\\\&quot;,1),(\\\&quot;ElysiumTitanBid1\\\&quot;,1),(\\\&quot;ElysiumTitanBid2\\\&quot;,1)])])\&quot;)&quot; ]
</code></pre>
<p>The script is <a href="https://github.com/naeri-kailash/elysium-plutus/blob/master/src/Cardano/PlutusExample/Trade.hs" rel="nofollow noreferrer">here</a></p>
<p>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?</p>
<p>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.</p>
<p><strong>Update:</strong></p>
<p>I've tried changing  to this:</p>
<pre><code>tkSymbol :: CurrencySymbol tkSymbol = currencySymbol &quot;6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3&quot; 
mkSchemaDefinitions ''TradeSchema elysiumtitan0 = KnownCurrency (fromSymbol tkSymbol) &quot;Token&quot; (TokenName &quot;ElysiumTitan0&quot; :| []) 
</code></pre>
<p>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?:</p>
<pre><code>Contract instance stopped with error: &quot;WalletError (InsufficientFunds \&quot;Total: Value (Map [(,Map [(\\\&quot;\\\&quot;,100000000)]),(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\&quot;ElysiumTitanBid0\\\&quot;,1),(\\\&quot;ElysiumTitanBid1\\\&quot;,1),(\\\&quot;ElysiumTitanBid2\\\&quot;,1)])]) expected: Value (Map [(6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3,Map [(\\\&quot;ElysiumTitanBid0\\\&quot;,1),(\\\&quot;ElysiumTitanBid1\\\&quot;,1),(\\\&quot;ElysiumTitanBid2\\\&quot;,1)])])\&quot;)&quot; ]
</code></pre>
<p><a href="https://i.sstatic.net/8FR9r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8FR9r.png" alt="screenshot of initialising wallet" /></a>
<a href="https://i.sstatic.net/rKaZj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rKaZj.png" alt="screenshot of running the init action and then a wait" /></a></p>

CC BY-SA 4.0
2022-09-26T08:47:56.273Z
It would be helpful if you would provide the actions you are trying to run and what inputs you entered for the actions.
eddex
CC BY-SA 4.0
2022-09-26T20:20:18.173Z
Have edited, thanks @eddex
NaeriKailash
CC BY-SA 4.0
2022-09-26T20:53:30.133Z
The init params schema is being defined here https://github.com/naeri-kailash/elysium-plutus/blob/a26b033f5dacee3f3c9303d4f75096517ade57f4/src/Cardano/PlutusExample/Trade.hs#L325, 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.
Walker Leite
CC BY-SA 4.0
2022-09-26T21:02:11.153Z
@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 https://github.com/naeri-kailash/elysium-plutus/blob/a26b033f5dacee3f3c9303d4f75096517ade57f4/src/Cardano/PlutusExample/Trade.hs#L593 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 :)
NaeriKailash
CC BY-SA 4.0
2022-09-26T21:38:37.017Z
Yeah, `66` feels not right. It works on EmulatorTrace?
Walker Leite
CC BY-SA 4.0
2022-09-26T21:45:35.180Z
@WalkerLeite
I've tried changing to this:
```
tkSymbol :: CurrencySymbol
tkSymbol = currencySymbol "6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3"

mkSchemaDefinitions ''TradeSchema
elysiumtitan0 = KnownCurrency (fromSymbol tkSymbol) "Token" (TokenName "ElysiumTitan0" :| [])
```
NaeriKailash
CC BY-SA 4.0
2022-09-26T21:46:27.613Z
And the error changes to this, which seems a step closer:


```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)])])\")" ]```
NaeriKailash
<plutus><smart-contract><plutus-playground>
Plutus Playground WalletError: InsufficientFunds
# Plutus Playground WalletError: InsufficientFunds

(Asked by: username_0 on 2022-09-26)

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)])])\")" ]

**Tags:** plutus, smart-contract, plutus-playground
> **Comments:**
> **username_1**: It would be helpful if you would provide the actions you are trying to run and what inputs you entered for the actions.  
> **username_0**: Have edited, thanks @eddex  
> **username_2**: The init params schema is being defined here https://github.com/naeri-kailash/elysium-plutus/blob/a26b033f5dacee3f3c9303d4f75096517ade57f4/src/Cardano/PlutusExample/Trade.hs#L325, 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.  
> **username_0**: @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 https://github.com/naeri-kailash/elysium-plutus/blob/a26b033f5dacee3f3c9303d4f75096517ade57f4/src/Cardano/PlutusExample/Trade.hs#L593 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 :)  
> **username_2**: Yeah, `66` feels not right. It works on EmulatorTrace?  
> **username_0**: @WalkerLeite I've tried changing to this: ``` tkSymbol :: CurrencySymbol tkSymbol = currencySymbol "6db9b46374a778b2e2d2142ca25bc3bfcd4216dc42ebcefcc54ee4d3"  mkSchemaDefinitions ''TradeSchema elysiumtitan0 = KnownCurrency (fromSymbol tkSymbol) "Token" (TokenName "ElysiumTitan0" :| []) ```  
> **username_0**: And the error changes to this, which seems a step closer:   ```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)])])\")" ]```  

---

## 0 answers

