Questions tagged [string]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
34 views

Which hash function is used when converting an address from raw bytes?

With the raw address 0x0000861299624c9a3b52be10762c64bac282b1c02316 the first 4 characters (0000 in this case) represent tz1 and the rest of the string is the raw Tezos address. From my research it ...
user avatar
  • 399
2 votes
1 answer
18 views

Why does calling sp.address() with a dynamic value inside an entrypoint fail?

Is there some way to call sp.address inside an entrypoint and pass in a dynamic String? I have created an example contract showing the failing state: import smartpy as sp class ...
user avatar
  • 399
2 votes
0 answers
44 views

How to use internal hacks to convert from String to Address (or from Address to String) in SmartPy

There is a similar question but it does not fully answer this question. In the answer for that question posted here there is mention that while it is officially not possible it is actually technically ...
user avatar
  • 399
2 votes
2 answers
31 views

Smartpy restrict entrypoint for originated addresses (KT1)

I would like to know if the entrypoint of my smart contract is called from an implicit(tz1) or an originated address(KT1). How can i do the check in smartpy? Looking at the Smartpy documentation, it's ...
user avatar
  • 23
2 votes
2 answers
91 views

How do you convert a string sent to an entrypoint into its byte representation?

I want to turn a string into the 0x byte format inside an entrypoint. If I try to use sp.pack() the actual value I want gets prepended with pack instructions as detailed here I'm looking for a runtime ...
user avatar
  • 399
2 votes
1 answer
117 views

How to convert hex string/bytes to ASCII characters

Using Taquito I can load the storage from a smart contract. This storage contains a map called token_info. If I call token_info.get('symbol'), I get a hex string of "4d494e". How do I ...
user avatar
0 votes
2 answers
125 views

How can I do string interpolation on smartpy?

I'm trying to provide better error messages. I've tried several things already that don't work such as regular python fstrings, regular string concatenation. I'm tried to using the sp.string function ...
user avatar
  • 557
2 votes
1 answer
96 views

How do you read and store a UTF-8 value in Michelson

The Michelson document from the Tezos Developers Resources page states the following about the string type: Strings, with some usual escape sequences: \n, \, ". Unescaped line-breaks (both \n ...
user avatar
  • 670
2 votes
1 answer
118 views

Convert address to string in LIGO

How do I convert an address type to a string type in LIGO?
user avatar
1 vote
1 answer
75 views

How are strings serialized in Tezos?

How are strings serialized to byte arrays? I understand that they are treated like strings, and that ASCII (or utf8) encoding is used. But what about the rest of the bytes, what do they mean? Running ...
user avatar
1 vote
1 answer
37 views

Can I use escape characters in LIGO strings?

I would like to insert some special ASCII characters that I only know how to express as numbers. In Python I would for example be able to write the SYN control character as \x16 since 0x16 is SYN in ...
user avatar