Questions tagged [pack]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
68 views

Decoding sp.pack("address") outside of chain

I have a question , While packing the string, "KT1FRoFxDhnKXGPggejHPAnMs27j6rcVfwzV", the output is 0501000000244b543146526f467844686e4b5847506767656a4850416e4d7332376a3672635666777a56 this ...
lee brune's user avatar
0 votes
1 answer
37 views

Why does unpacking a record that has a key containing bounded data fail with `to_value sp.TBounded` in smartpy?

Tests are throwing a to_value error in the scenario when trying to unpack a record that contains a key with a bounded type TNat inside the entrypoint being called. There's a minimal reproduction below,...
0x10's user avatar
  • 359
1 vote
1 answer
127 views

Packing and signing a payload in Taquito

I'm trying to call a contract method that checks a signature against the chain ID, contract address, caller, and params. The contract lives at KT1XoT3RTkXCN2y25e635WeEmjN4xszQWtq6 on mainnet, and here ...
sudo's user avatar
  • 125
2 votes
1 answer
49 views

How are sets serialized in Tezos?

The mathematical structure of a set is an unordered collection. If a set does not have an order, how are they serialized by the PACK instruction? According to this overview set is packable.
Thorkil Værge's user avatar
0 votes
1 answer
93 views

How are pairs serialized in Tezos?

Running the PACK operation on a tuple (represented as a pair in Michelson, I get $ ligo interpret -s pascaligo 'Bytes.pack((1, 2))' 0x05070700010002 The numbers 1 and 2 are serialized as 0001 and ...
Thorkil Værge's user avatar
1 vote
1 answer
89 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
2 votes
1 answer
134 views

How are integers serialized in Tezos?

I think that the int, tez and nat are all serialized the same way. But what is the algorithm? I tried running some examples through the LIGO CLI but couldn't figure out the system $ ligo interpret -s ...
Thorkil Værge's user avatar
3 votes
1 answer
127 views

How to call PACK in JavaScript

In my smart contract in LIGO I serialize some data using Bytes.pack which calls the underlying PACK Michelson instruction. In my case, the function signature is (nat, address, nat) -> bytes. Does ...
Thorkil Værge's user avatar