Questions tagged [string]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
79 views

Concat Address to String in smartpy

My use case is, I need to concat address with string this way, "ab" + sp.self_address + "cd" . How to achieve this in smartpy ?
lee brune's user avatar
0 votes
0 answers
31 views

Manipulation of string in smartpy

Hey I have a string "Hello World ". I want to change it to helloworld. Is there any efficient way to do it on smartpy without looping over each characters ?
Kin's user avatar
  • 184
1 vote
1 answer
97 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 ...
0x10's user avatar
  • 359
1 vote
1 answer
64 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 ...
0x10's user avatar
  • 359
2 votes
1 answer
127 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 ...
0x10's user avatar
  • 359
2 votes
2 answers
58 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 ...
Nik's user avatar
  • 23
2 votes
2 answers
167 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 ...
0x10's user avatar
  • 359
3 votes
1 answer
189 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 ...
Thorkil Værge's user avatar
0 votes
2 answers
178 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 ...
JJJ's user avatar
  • 557
2 votes
1 answer
128 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 ...
MCH's user avatar
  • 680
2 votes
1 answer
195 views

Convert address to string in LIGO

How do I convert an address type to a string type in LIGO?
Thorkil Værge's user avatar
1 vote
1 answer
93 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 ...
Thorkil Værge's user avatar
0 votes
1 answer
47 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 ...
Thorkil Værge's user avatar