Questions tagged [michelson]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
15 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
49 views

Can't get tzBTC out of the tzBTC Granadanet contract

i'm trying to (eventually) add liquidity to the Liquidity Baking CPMM contract on Granadanet. In order to add liquidity, I need some tzBTC from the tzBTC contract here.. I cannot, for the life of me, ...
1
vote
1answer
16 views

Is the data held within a ticket publicly visible in any way?

I'm talking about the tickets feature introduced in Edo. Is it safe to hold private data in a ticket basically - I'm talking about this in the context of a game where there is certain information that ...
0
votes
1answer
15 views

Why does SOURCE instruction push not a key_hash value but an address one?

In my understanding, only implicit accounts can initiate a transaction. Then, if I am correct, the destination of SOURCE must be an implicit account, and the question arises. I know various ways to ...
2
votes
1answer
23 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
16 views

What is the current block level pushed by the Michelson instruction `LEVEL`?

What is the meaning of "current" in the description of the michelson instruction LEVEL: LEVEL: Push the current block level
0
votes
3answers
51 views

Is there an equivalent of the Ethereum “selfdestruct” opcode in Tezos?

In Ethereum you can implement a selfdestruct opcode in a smart contract to remove its code from the blockchain and free up storage space. Is there an equivalent on Tezos ?
1
vote
3answers
77 views

Is there a way to view the stack during development with Michelson?

Is there some kind of debugger tool to view the stack while developing with Michelson (other than try-michelson.com)? Thanks.
0
votes
2answers
23 views

Timestamp in mock-up mode

Is there a way to control what NOW returns in the mock-up mode? If not, this could be done via a special command in the client to increase it. This seems important for testing.
0
votes
1answer
18 views

decidability of real world contracts

I'm wondering if there has been any work done on the decidability of real world, legal contracts. Michelson is great because it lends itself to users bring able to write smart contracts that are ...
1
vote
1answer
18 views

Trouble Initializing Contract with Lists

I am trying to learn smart contracts on Tezos and decided to originate my own. The contract is expecting the following storage: pair (pair (address %owner) (list %received ...
1
vote
2answers
71 views

Why is this big map update using up so many bytes?

In this question I asked why so much Tezos was burned when updating 380 cells in a grid. It's surprising to see how many bytes it actually took though. If you look at the transaction, there were 380 ...
1
vote
1answer
17 views

Questionable typecheck script result of some michelson code

I've tried to type check create_contract.tz in mini_scenarios and had the following result. It is well-typed, but I'm wondering if the occurrence of the last comment /* [ pair (list operation) (...
0
votes
0answers
67 views

FA 1.2 Token contract interaction

I want to call an Approve method on a FA1.2 token contract. Michelson code of Approve method at FA1.2 token contract: (pair %approve (address %spender) (nat %value)) My PascaLigo code: type ...
0
votes
1answer
40 views

Get entrypoint operation (get_entrypoint_opt) fails

I have some troubles to call a contract. This is the scenario: Contract B (Entrypoint method "transfer"): (pair %transfer (bytes %args1) (pair (string %args2) ...
1
vote
2answers
95 views

Best Language to Use with Tezos

There are a lot of options when it comes to coding Smart Contracts on Tezos. My question is simple, which of the supported languages is the best in terms of support, east of use, documentation, and ...
2
votes
1answer
15 views

What is the format of valid entrypoint names?

Are there any constraints on valid entrypoint names?
2
votes
1answer
35 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 ...
2
votes
1answer
40 views

Support for emojis in LIGO?

Is LIGO going to get native support for emojis? When I tried compiling a contract with the classic 🚀 (rocketship emoji) inside a string, I got the error Unexpected character '\240'. Honestly, without ...
0
votes
1answer
19 views

Does LIGO support parameterized types?

Does LIGO support parameterized types? Consider rcons, which is like cons (::) but with the arguments flipped. I'd like to be able to write something like: let rcons((xs, x): T list * T): T list = x ...
1
vote
0answers
21 views

Can a Edo Sapling Smart Contract, Emit a FA2 token? with the message from the payload_enc?

Can Edo Sapling Smart Contract, implement some kind of logic to emit a FA2 NFT ticket with metadata coming from the sapling message ?
1
vote
2answers
64 views

Michelson gas cost optimizations: any techniques, patterns and rules of thumb

Gas cost is an important topic in smart contract development. We want to maintain the costs as low as possible to allow for more operations in a block. There is a handy gas consumption reference, but ...
3
votes
1answer
45 views

Max stack depth of a Michelson program?

Is it possible to determine an upper bound for the (runtime) max stack depth that a given Michelson program will use? I'm thinking here in terms of static analysis of the program. So, 'given a ...
1
vote
1answer
44 views

Design an oracle that provides random values to a contract

This answer mentions an improved way for an oracle to provide random numbers to a contract. use commitments, i.e. the oracle would push a hash in the contract before the game, and send the random ...
1
vote
1answer
37 views

How are tickets passed to and read by contracts in the Edo protocol?

The Michelson documentation for the Edo protocol mentions four new operations for tickets and this blog post has an example of how tickets are used. I see that the contract in that example can take a ...
1
vote
1answer
29 views

How un/reliable is the timestamp provided by NOW in Michelson?

To which extend can bakers manipulate the timestamp Michelson uses for NOW? I am not really sure how this value is provided to the smart contract and how reliable/unreliable it can be... Is it safe to ...
2
votes
2answers
85 views

Passing parameters in truffle tests

I have this parameter for a function: type modify_list is | Add of list(address) | Remove of list(address) type modify_list_michelson is michelson_or_right_comb(modify_list) When I try to supply ...
1
vote
1answer
29 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
2answers
67 views

How to Integrating SmartPy compiler within the browser?

I have been trying to integrate the SmartPy compiler toolchain within Cryptoverse wars Learning interface and have been going through this video (OCaml Under The Hood: SmartPy) and have encountered ...
0
votes
0answers
34 views

signing and broadcasting operations sdks and other methods?

I'm trying to broadcast an operation using the following method in pytezos as a backend for a dapp: forge -> receive signature (from thanos) -> reconstruct operation group -> inject this ...
1
vote
2answers
86 views

How can I write On Chain Contract Calls in Tezos Sandbox?

I am trying to write a test case in Tezos Sandbox that uses an On Chain Contract Call. To start with, I am trying to implement the example from SmartPy "On Chain Contract Calls - Collatz" ...
0
votes
1answer
43 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 ...
0
votes
1answer
54 views

Handling floating point numbers in decentralized exchanges

I am writing a contract in Ligo that manages FA2 fungible tokens with an interface that lets users easily create new tokens. I am building a very simple exchange where the users can create orders to ...
1
vote
1answer
49 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 ...
1
vote
1answer
74 views

Batching Transactions FA2

On the Tzip for FA2, I read that Every transfer operation MUST happen atomically and in order. If at least one transfer in the batch cannot be completed, the whole transaction MUST fail, all token ...
1
vote
1answer
36 views

Maximum value for Nat in michelson

Hello what is the maximum value for natrual number in michelson or what a bigmap can handle. I am trying to write a FA1.2 contract and is concerned if there will be a maximum amount an account can ...
2
votes
1answer
34 views

What are the changes in Michelson in Dalphanet?

Dalphanet introduces quite a few new primitives and types. What are these primitives and types? What are their typing rules?
1
vote
1answer
20 views

How does sp.record arrange data into pairs?

For example if I have the following code: sp.record(one = one, two = two, three = three, four = four, five = five) Would the format of the result be pair(one pair(two pair(three pair(four five)))) or ...
3
votes
1answer
144 views

Gas costs types in Michelson

Gas cost is an important topic in tezos and I would like to understand better the different types of it that occur in michelson how they are calculated Could someone offer me a pointer ?
2
votes
1answer
32 views

Overflow/ Underflow in Smart Contract

Is Tezos vulnerable to overflow/ underflow attacks on the smart contracts? If yes, how do you recommend to test whether a particular smart contract suffers from it.
1
vote
1answer
37 views

Michelson: Parameter vs Storage

I'm struggling to process what the difference between parameter and storage is in Michelson. From what I've been reading, it just looks like two different types of inputs to a contract. So how should ...
2
votes
1answer
25 views

Timestamps overflow/underflow errors

In the list of possible errors in RPC: http://tezos.gitlab.io/api/errors.html#michelson-parsing-macros, there are timestamp_add and timestamp_sub errors, that could happen in arithmetic instructions ...
3
votes
1answer
105 views

How do I call the FA2 balance_of endpoint through Truffle?

I have written a contract to implement FA2 and I have a Truffle/JavaScript setup to test this contract while running against a sandboxed node. I can test the transfer endpoint and the update_operators ...
3
votes
1answer
36 views

Call method taking unit type as parameter from JavaScript

I have a Truffle instance of the contract and I call the method like this contract_instance.method(); This gives me this error message: method Received 0 arguments while expecting on of the follow ...
2
votes
4answers
96 views

Is there a formula to build parameter messages to be passed to smart contract entrypoints?

When calling a smart contract entrypoint, it is required to pass the needed entrypoint parameters. This is done through a message that must be sent in JSON/Pairs format. My doubt is: Is there a ...
1
vote
1answer
22 views

Contract calling convention for sum type

burn function in KT_token contract can be called with arg format: burn: (pair (or (unit %uSD) (unit %xTZ)) mutez) so I tried, ./tezos-client transfer 0 from alice to KT_token --entrypoint burn --...
3
votes
1answer
53 views

Why does michelson have no heap?

I have read a recent article about juvix optimizations to adjust for michelson specifics https://research.metastate.dev/juvix-compiling-juvix-to-michelson/ And saw that michelson has 2 features ...
1
vote
1answer
56 views

how to encode contract invoke parameter to json code? ConseilJS not support parameter of tyep List Signature

ConseilJS seems not support parameter type List Signature, see at https://github.com/Cryptonomic/ConseilJS/issues/261. So I want to encode my parameter to JSON code that I can change parameterType ...
3
votes
2answers
266 views

What are the differences between key, key_hash, address, contract and signature in Michelson?

There is a related question, but the differences are still not clear. These five types are mentioned in the Michelson whitedoc with the following definitions: address: An untyped address (implicit ...
1
vote
2answers
184 views

Pretty-printing Micheline JSON

How can I pretty-print a Michelson contract in JSON to concrete syntax?