Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use ByteString literals in on-chain code #3156

Closed
anton-k opened this issue May 10, 2021 · 5 comments · Fixed by #3327
Closed

Unable to use ByteString literals in on-chain code #3156

anton-k opened this issue May 10, 2021 · 5 comments · Fixed by #3327
Labels

Comments

@anton-k
Copy link
Contributor

anton-k commented May 10, 2021

Area

[*] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code

Summary

I need to append some constant marker to a token name.
But when I use in on-chain code constant string literals that are meant to be ByteString \bs -> "a" <> bs
I get an error of PLC plugin:

Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, 
or an external INLINABLE function: Variable GHC.List.$wlenAcc
           No unfolding

Steps to reproduce

It happens when we use string literals for ByteString in on-chain code.

Expected behavior

I would like to append some data to the ByteString in on-chain code.

System info:

  • OS: Manjaro, Linux
  • Plutus version or commit hash: 62be7a2
@anton-k anton-k added the bug label May 10, 2021
@ghost
Copy link

ghost commented May 11, 2021

Thanks for the issue!

Unfortunately, ByteString literals are not supported at all at the moment.

I may suggest to pass constants as a part of datum (fields in ADT) or as arguments for now.

@ghost ghost self-assigned this May 12, 2021
@kevinhammond
Copy link

Yes, I hit this when trying to prepare the testnet exercises. I worked around it by using an integer literal. I believe you could also use strings in datums and redeemers. The problem I hit is partly down to staging in the Plutus compiler (byte strings have some dynamic component - they are not just calculated as compile-time constants).

@ghost ghost changed the title Unable to use string literals in on-chain code Unable to use ByteString literals in on-chain code Jul 9, 2021
@longngn
Copy link

longngn commented Jul 31, 2021

Hi @ak3n, I know that your team is busy and thank you for all the hard work to put Plutus closer to the production launch. I would like to ask if this issue has a high priority on the roadmap? I believe that having this issue fixed would be a great improvement to the developer experience.

@ghost
Copy link

ghost commented Aug 2, 2021

Hi @longngn, yeah, I'm working on it at the moment, #3327 is active and quite close to the merge. I hope it will land the master this week.

@anton-k
Copy link
Contributor Author

anton-k commented Aug 4, 2021

Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants