<p>I am a bit confused about this part:</p>
<pre><code>&quot;ElysiumTitan&quot; &lt;&gt; id
</code></pre>
<p>In normal Haskell <code>id</code> is the <a href="https:///https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html#v:id" rel="nofollow noreferrer">identity function</a>, but I could not see how that would type check if it was. However, in this case it seems to by the <code>id</code> field of the <code>TradeParams</code> struct (which is also of type <code>BuiltInByteString</code>). I can't seem to find where that value is constructed, but somewhere or other, the <code>id</code> field of the <code>TradeParams</code> struct is initialized to <code>&quot;\NUL\\NUL\\SOH\\\</code>.</p>
<p>Also, just as an aside. I highly recommend against using the <code>RecordWildCards</code> language pragma as it makes code more difficult to read, especially for someone not the author.</p>

CC BY-SA 4.0
2022-09-30T05:28:29.047Z
Thanks, I've removed the recordwildcards pragma although it still compiles the same and doesnt seem to require code changes for that. 

Im wondering why the id field is being initialised to `"\NUL\\NUL\\SOH\\\"` as this is preventing me from passing that condition... I didn't write most of this contract I've just been adapting it to my needs but it is proving very challenging. I haven't seen any other example contracts where there's bidding integrated though, do you know of any?
NaeriKailash
CC BY-SA 4.0
2022-09-30T09:10:50.807Z
Do you have a link to your new version of the code?
Erik de Castro Lopo
CC BY-SA 4.0
2022-10-06T03:56:13.200Z
Hey Erik sorry for late response, I've given up on the plutus-playground and am using the cli instead as it has been too much of a struggle. Thanks so much, I appreciate your input
NaeriKailash
CC BY-SA 4.0
2022-09-30T04:04:35.660Z
2022-09-30T04:04:35.660Z
Erik de Castro Lopo
<p>I am having trouble with the mustPayToTheScript function - I am getting this error</p>
<pre><code>Contract instance stopped with error: &quot;WalletError (InsufficientFunds \&quot;Total: Value (Map [(,Map [(\\\&quot;\\\&quot;,93999990)]),(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\&quot;ElysiumTitan1\\\&quot;,1)])]) 
expected: Value (Map [(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\&quot;ElysiumTitan\\NUL\\NUL\\SOH\\\&quot;,1)])])\&quot;)&quot; ]
</code></pre>
<p>However, the value on the first line is what I'd would like to expect <code>&quot;ElysiumTitan1&quot;</code> - the expected value is strange and undesirable <code>&quot;ElysiumTitan\\NUL\\NUL\\SOH\\\&quot;</code>.</p>
<p>From a google it looks like there's a character escape happening or something. Does anyone know why this is happening and how to prevent it?</p>
<p>Here is the line of code where i assume its happening: <a href="https://github.com/naeri-kailash/elysium-plutus/blob/master/src/Cardano/PlutusExample/Trade.hs#L524" rel="nofollow noreferrer">https://github.com/naeri-kailash/elysium-plutus/blob/master/src/Cardano/PlutusExample/Trade.hs#L524</a></p>
<p><a href="https://i.sstatic.net/g5Pig.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/g5Pig.png" alt="screenshot of inputs" /></a></p>
<p>If I just put <code>1</code> I get this error:</p>
<pre><code>Contract instance stopped with error: &quot;OtherError \&quot;Error in $.id: invalid bytestring size\&quot;&quot; ]
</code></pre>
<p><a href="https://i.sstatic.net/X8waN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/X8waN.png" alt="enter image description here" /></a></p>

<plutus><smart-contract><plutus-playground><haskell>
Plutus Playground - mustPayToTheScript - unexpected char escapes - 0 converted to \NUL, 1 to \SOH
# Plutus Playground - mustPayToTheScript - unexpected char escapes - 0 converted to \NUL, 1 to \SOH

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

I am having trouble with the mustPayToTheScript function - I am getting this error
Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"\\\",93999990)]),(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\"ElysiumTitan1\\\",1)])]) 
expected: Value (Map [(3664623962343633373461373738623265326432313432636132356263336266636434323136646334326562636566636335346565346433,Map [(\\\"ElysiumTitan\\NUL\\NUL\\SOH\\\",1)])])\")" ]

However, the value on the first line is what I'd would like to expect "ElysiumTitan1" - the expected value is strange and undesirable "ElysiumTitan\\NUL\\NUL\\SOH\\\".
From a google it looks like there's a character escape happening or something. Does anyone know why this is happening and how to prevent it?
Here is the line of code where i assume its happening: https://github.com/naeri-kailash/elysium-plutus/blob/master/src/Cardano/PlutusExample/Trade.hs#L524

If I just put 1 I get this error:
Contract instance stopped with error: "OtherError \"Error in $.id: invalid bytestring size\"" ]

**Tags:** plutus, smart-contract, plutus-playground, haskell

---

## 1 answers

### Answer by username_1 on 2022-09-30. Score: 0

I am a bit confused about this part:
"ElysiumTitan" <> id

In normal Haskell id is the identity function, but I could not see how that would type check if it was. However, in this case it seems to by the id field of the TradeParams struct (which is also of type BuiltInByteString). I can't seem to find where that value is constructed, but somewhere or other, the id field of the TradeParams struct is initialized to "\NUL\\NUL\\SOH\\\.
Also, just as an aside. I highly recommend against using the RecordWildCards language pragma as it makes code more difficult to read, especially for someone not the author.

> **Comments:**
> **username_0**: Thanks, I've removed the recordwildcards pragma although it still compiles the same and doesnt seem to require code changes for that.   Im wondering why the id field is being initialised to `"\NUL\\NUL\\SOH\\\"` as this is preventing me from passing that condition... I didn't write most of this contract I've just been adapting it to my needs but it is proving very challenging. I haven't seen any other example contracts where there's bidding integrated though, do you know of any?  
> **username_1**: Do you have a link to your new version of the code?  
> **username_0**: Hey Erik sorry for late response, I've given up on the plutus-playground and am using the cli instead as it has been too much of a struggle. Thanks so much, I appreciate your input  

---

