Questions tagged [michelson]

The tag has no usage guidance.

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

With the addition of LAMBDA_REC does anyone know a better way of compiling mutually recursive functions?

[mutually recursive functions] With the addition of LAMBDA_REC does anyone know a better way of compiling mutually recursive functions than the following (example w/ is_odd and is_even): let rec fix f ...
Ron's user avatar
  • 35
2 votes
1 answer
92 views

Extracting entropy from bytes

most smart contracts that rely on "randomness", will require said entropy to be in a number format. A practical way to extract entropy from a arbitrary payload is by using a hashing function....
adc's user avatar
  • 21
1 vote
0 answers
23 views

Baked block hash information on smart-contracts

It seems the passed baked blocks hashes are not available on-chain in LIGOLang or Michelson. Why is that and will it come later ?
Mieus's user avatar
  • 121
0 votes
1 answer
31 views

Translate SmartPy expression into Michelson

import smartpy as sp def logic(data): t = sp.TRecord(x=sp.TNat, y=sp.TNat, z=sp.TNat) unpacked = sp.unpack(data, t).open_some(message="Can't unpack!!") sp.result(unpacked.x ...
Roshan Parajuli's user avatar
1 vote
1 answer
46 views

Is there a Michelson to Archetype (or other higher-level language) transcompiler/decompiler?

Given an arbitrary smart contract address or Michelson code, for example: parameter (or (contract %push (big_map string (pair timestamp ...
Aurélien's user avatar
1 vote
1 answer
108 views

Difference between EVM Bytecode and Tezos Michelson

Solidity compiles into Bytecode. Smart Contract languages on Tezos compile into Michelson. Ethereum uses EVM(Ethereum Virtual Machine) as the system, smart contract code written in high-level ...
user avatar
1 vote
1 answer
86 views

Are contract views typechecked when only the main contract code is called?

I have been contemplating replacing off-chain views entirely with on-chain views in my contracts since the former leads to unnecessary work of having an otherwise redundant metadata big-map with a ...
Anshu Jalan's user avatar
1 vote
2 answers
112 views

How to retrive parameters from a Michelson function?

I'm developing a Flutter application and used Dartez plugin to transfer token contracts from one wallet to another wallet. The Dartez package has a function named sendContractInvocationOperation for ...
Taleb's user avatar
  • 177
0 votes
0 answers
65 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 ...
tinuggunit's user avatar
1 vote
2 answers
63 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/...
PEC's user avatar
  • 139
2 votes
1 answer
80 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 ...
Aron's 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
Kamran Shahid's user avatar
2 votes
2 answers
67 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 ...
DEVensiv's user avatar
1 vote
1 answer
33 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 ...
2learn's user avatar
  • 11
0 votes
2 answers
94 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 ?
arumichi's user avatar
1 vote
1 answer
53 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 (...
oriana's user avatar
  • 119
1 vote
1 answer
45 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 ...
OrderAndChaos's user avatar
0 votes
1 answer
20 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 ...
HKOB's user avatar
  • 133
0 votes
2 answers
56 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 ...
Nox's user avatar
  • 131
1 vote
1 answer
149 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 ...
HKOB's user avatar
  • 133
2 votes
2 answers
100 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 ...
emchristiansen's user avatar
0 votes
1 answer
80 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 ...
Vedran Kajic's user avatar
1 vote
1 answer
46 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 ...
Whirlybird's user avatar
1 vote
1 answer
52 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 ...
Whirlybird's user avatar
0 votes
1 answer
161 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 ...
Whirlybird's user avatar
1 vote
1 answer
78 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 ...
Whirlybird's user avatar
2 votes
1 answer
101 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, ...
Whirlybird's user avatar
1 vote
1 answer
23 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 ...
wyn's user avatar
  • 45
0 votes
1 answer
20 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 ...
Yuki's user avatar
  • 15
2 votes
1 answer
81 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 ...
JJJ's user avatar
  • 557
0 votes
1 answer
31 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
arvidj's user avatar
  • 2,378
0 votes
3 answers
91 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 ?
clement's user avatar
  • 103
1 vote
3 answers
99 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.
moncada's user avatar
  • 13
0 votes
2 answers
40 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.
Arthur B's user avatar
  • 4,609
0 votes
1 answer
26 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 ...
callipygous's user avatar
1 vote
1 answer
39 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 ...
JellyMan's user avatar
1 vote
2 answers
124 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 ...
JJJ's user avatar
  • 557
1 vote
1 answer
33 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) (...
Yuki's user avatar
  • 15
0 votes
1 answer
89 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) ...
Stiflers Mum's user avatar
1 vote
2 answers
317 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 ...
Hassaan Ahmed's user avatar
2 votes
1 answer
46 views

What is the format of valid entrypoint names?

Are there any constraints on valid entrypoint names?
arvidj's user avatar
  • 2,378
2 votes
1 answer
123 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
59 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 ...
emchristiansen's user avatar
0 votes
1 answer
27 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 ...
emchristiansen's user avatar
1 vote
0 answers
30 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 ?
dolpsdw's user avatar
  • 11
2 votes
2 answers
105 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 ...
MCH's user avatar
  • 680
3 votes
1 answer
51 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 ...
wyn's user avatar
  • 45
1 vote
1 answer
121 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 ...
MCH's user avatar
  • 680
1 vote
1 answer
70 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 ...
MCH's user avatar
  • 680
1 vote
1 answer
58 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 ...
Claude Barde's user avatar