Questions tagged [types]

The tag has no usage guidance.

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

How much storage do numbers take?

I'm trying to figure out how byte storage works for numbers. What size is a Nat vs an Int in bytes? Or, is there a way to encode a u8 vs a u64?
1
vote
1answer
49 views

value is invalid for type

I'm trying to call the addLiquidity entrypoint of this contract, which is a copy of the Liquidity Baking CPMM contract, which is itself a copy of the Dexter contract. The original Dexter docs give an ...
2
votes
1answer
37 views

Smartpy Michelson errors only on deployment (inconsistent_annotations, inconsistent_types)

Getting this error ONLY when deploying the smartpy contract. There are otherwise no errors when testing/compiling the code. Is there a way to get a better error message? Is there a way to trigger ...
0
votes
1answer
32 views

error Type sp.TInt / sp.TNat mismatch

Error: Type sp.TInt / sp.TNat mismatch sp.is_nat expects a sp.TInt Got: sp.TNat line 119 Line: 119 self.data.shop_items[item_to_purchase.key].amount -= sp.as_nat(item_to_purchase.value) I'm ...
1
vote
2answers
51 views

What is a 'valid case' for bls12_381_fr?

I am trying to originate a contract using bls12_381_fr types and am running into an error. The same contract originated successfully on the edo branch of the Metastate repository. Now I am running the ...
2
votes
2answers
54 views

How can I avoid sp.TOption type when using sp.unpack()?

Within my smartpy contract, I want to convert from one type into another using sp.pack() and sp.unpack. Below is an example of the method I am trying to use, converting a string to bytes. ...
1
vote
1answer
55 views

What's the best way to convert from TMutez to TBytes?

Previously when I asked about converting types, I got this useful suggestion: For mutez, you could start to convert to int (by dividing by 1 mutez) and then use the same techniques. I'm wondering if ...
1
vote
1answer
31 views

How to format storage for a contract call with parameters?

I am trying to construct the storage needed to do an on chain contract call but I'm having trouble passing in the parameters. What is making it tricky is that one of the parameters is of type ...
2
votes
1answer
103 views

Is it possible to convert types in SmartPy?

For example, converting a TMutez into a TString?
1
vote
1answer
88 views

Convert address to string in LIGO

How do I convert an address type to a string type in LIGO?