Questions tagged [michelson]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
33 views

ListValidationError on interacting with contract using Taquito

I'm trying to interact with this entrypoint using taquito parameter pair token_assets list($token_assets_item) trigger_time timestamp token_assets_item pair amount nat asset_id string ...
user avatar
1 vote
2 answers
36 views

Tezos - smart contract byte code to michelson

I am trying to figure out the SpicySwap swap fees. Since there is no public implementation available to my knowledge, I am studying the michelson code. For example: https://tzkt.io/...
user avatar
  • 139
2 votes
1 answer
35 views

Pytezos for originating contracts

I am quite new to Pytezos and I have a few questions and would be very happy if you could help me. I want to make my script buy NFT, I know the smart contract address, how could I get from smart ...
user avatar
  • 21
1 vote
0 answers
8 views

Suggestion more then question about tezos course on plural sight

There is a good course about BlockChain fundamentals on Plural sight but addressing ethereum. It could be great if someone can create similar curse there with targeting tezos with
user avatar
2 votes
2 answers
33 views

encoding of addresses in optimized micheline representation

While examining the json rpc response I encountered a transaction inside of "internal_operation_results" which has parameters (its inside of a tokenToCash contract call). Addresses specified ...
user avatar
1 vote
1 answer
29 views

Help understanding smart contract - why is this one different?

I'm trying to understand why this smart contract appears different compared to the majority that I've seen when viewing the code section of the smart contract on tzkt.io. I assume the smart contract ...
user avatar
  • 11
0 votes
1 answer
37 views

How to raise or emit an event?

In Solidity there's emit keyword for raising an event. How to do it in Tezos in a smart contract? Namely, a) define b) emit an event ?
user avatar
1 vote
1 answer
44 views

Storage settings

I would like to deploy my smart contract but I don't know what to put as parameters in the storage (I'm new to tezos). Thank you very much to those who will take the time to help me :) //FA2 '(pair (...
user avatar
  • 129
1 vote
1 answer
17 views

How can I debug "Error in generated Michelson contract" SmartPy CLI compilation error

I'm trying to compile a script locally, it doesn't throw any errors in the online SmartPy terminal, but when I try to compile locally with add_compilation_target and SmartPy CLI I get: "Error in ...
user avatar
0 votes
1 answer
18 views

Has human-readable feedback from contract simulation been considered?

I am wondering if feedback to wallet-users from Michelson contracts has been considered previously in the development of Tezos, and where is it / why is it not being considered ? I am thinking it ...
user avatar
  • 113
0 votes
2 answers
42 views

Do FA2 entrypoints need to be at the top level in order to comply with the spec?

Most of the example FA2 implementations I've found, as well as the deployed contracts I've investigated have the required FA2 entrypoints (transfer, balance_of, update_operators) buried in the second ...
user avatar
  • 131
1 vote
1 answer
137 views

Is it possible to break out / access storage from a michelson lambda?

I am new to Michelson and Smartpy so forgive if I have any mistakes, I will try to correct them. I have not been able to find an answer to the question if a function like the below, prevents the ...
user avatar
  • 113
1 vote
2 answers
73 views

In Michelson, is it possible to get the balance of an arbitrary contract?

In Michelson, is it possible to get the balance of a contract other than the current one? According to the Michelson reference, it's possible for a contract to get its own balance. But, is it possible ...
user avatar
0 votes
1 answer
53 views

Packing args in taquito to match sp.pack / PACK

How can i pack on taquito side params so that they match what i would get in smartpy with sp.pack? Say i have params two ints and a string: 1, 3, "something" What do i need to do in taquito ...
user avatar
1 vote
1 answer
44 views

how does the liquidity baking CPMM round up or down?

I'm not sure how to ask this and I may mess up my mathematical terms, if you think I have then please correct me. When I call addLiquidity on the CPMM, I know that I will be sending tez, and that ...
user avatar
1 vote
1 answer
41 views

how to calculate current storage values for liquidity baking CPMM

In looking at the storage values of the CPMM one can see that as of right now the CPMM has the following amounts of tzBTC (represented by the contract as tokenPool), xtz (represented as xtzPool), and ...
user avatar
0 votes
1 answer
124 views

how to send a nat value other than a whole number

How can I send a nat value to a contract that represents a data type which is not a whole number? For example, the xtzToToken entrypoint of the tzBTC contract allows a user to call the xtzToToken ...
user avatar
1 vote
1 answer
58 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 ...
user avatar
2 votes
1 answer
95 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, ...
user avatar
1 vote
1 answer
20 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 ...
user avatar
  • 45
0 votes
1 answer
19 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 ...
user avatar
  • 15
2 votes
1 answer
58 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 ...
user avatar
  • 557
0 votes
1 answer
28 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
user avatar
  • 2,348
0 votes
3 answers
79 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 ?
user avatar
  • 103
1 vote
3 answers
91 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.
user avatar
  • 13
0 votes
2 answers
36 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.
user avatar
  • 4,409
0 votes
1 answer
23 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 ...
user avatar
1 vote
1 answer
34 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 ...
user avatar
1 vote
2 answers
117 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 ...
user avatar
  • 557
1 vote
1 answer
28 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) (...
user avatar
  • 15
0 votes
1 answer
68 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) ...
user avatar
1 vote
2 answers
257 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 ...
user avatar
2 votes
1 answer
40 views

What is the format of valid entrypoint names?

Are there any constraints on valid entrypoint names?
user avatar
  • 2,348
2 votes
1 answer
95 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
57 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 ...
user avatar
0 votes
1 answer
25 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 ...
user avatar
1 vote
0 answers
28 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 ?
user avatar
  • 11
2 votes
2 answers
93 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 ...
user avatar
  • 670
3 votes
1 answer
50 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 ...
user avatar
  • 45
1 vote
1 answer
93 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 ...
user avatar
  • 670
1 vote
1 answer
60 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 ...
user avatar
  • 670
1 vote
1 answer
54 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 ...
user avatar
2 votes
2 answers
128 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 ...
user avatar
1 vote
1 answer
68 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 ...
user avatar
  • 647
1 vote
2 answers
81 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 ...
user avatar
1 vote
2 answers
118 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" ...
user avatar
  • 647
0 votes
1 answer
72 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 ...
user avatar
0 votes
1 answer
83 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 ...
user avatar
2 votes
1 answer
91 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 ...
user avatar
2 votes
1 answer
139 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 ...
user avatar
  • 495