Hot answers tagged

10 votes
Accepted

Ethereum/Solidity dev here, looking to migrate some Solidity contracts onto Tezos. Was hoping to have some light shed on a few questions

In response to question 4: Reuse and modularity We discuss reuse and modularity, of which inheritance is one of many mechanisms: Michelson has no mechanism for code reuse, except for calling existing ...
user avatar
  • 2,348
6 votes

Testing frameworks for tezos smart-contracts

Ad 1. I am not sure whether it is what you look for, but look at: https://smartpy.io/demo/ SmartPy offers different tools: Analytics: elements of the UI in SmartPy.io to analyse smart contracts and ...
user avatar
6 votes

Ethereum/Solidity dev here, looking to migrate some Solidity contracts onto Tezos. Was hoping to have some light shed on a few questions

Here is a complement to Arvid's answer regarding Archetype: Reuse and modularity Indeed Archetype's extensions are reusable codes to add features to a contract. For example, using the 'transferable' ...
user avatar
5 votes

Ethereum/Solidity dev here, looking to migrate some Solidity contracts onto Tezos. Was hoping to have some light shed on a few questions

Do Archetype/Ligo provide everything that Michelson can currently do, or are there limitations with either? I think if something is possible in Michelson and not in Ligo, it is probably a bug worth ...
user avatar
5 votes
Accepted

Calling contract without knowing contract parameter type

I believe this is not possible, one solution would be to use a parameter of type bytes that would be the result of a pack, then your unknown future contracts will know how to unpack this param.
user avatar
  • 146
4 votes
Accepted

Testing frameworks for tezos smart-contracts

Here is the preview version of truffle tools for working with smart contacts in Tezos: https://www.trufflesuite.com:8443/docs/tezos/truffle/quickstart
user avatar
  • 2,327
4 votes
Accepted

Best Language to Use with Tezos

First of all, Fi is no longer updated and Liquidity no longer supports Tezos, which leaves Ligo, SmartPy, Michelson and Morley. To this list, I would also add Archetype. All of these languages can be ...
user avatar
  • 2,348
4 votes

Ethereum/Solidity dev here, looking to migrate some Solidity contracts onto Tezos. Was hoping to have some light shed on a few questions

With respect to question 3, following @ezy remark, SmartPy has some inlining capabilities including with new opcodes as shown in the Inline Michelson template (of the new version, currently https://...
user avatar
  • 3,185
4 votes
Accepted

In List.fold, does accumulator have to be the same type as list?

The type signature for List.fold_left is val fold_left : ('acc * 'item -> 'acc) -> 'acc -> 'item list -> 'acc That means 'acc can be of any type, e.g. let fn = fun (acc, a: (int, int) map ...
user avatar
3 votes
Accepted

Understanding Calling limit of entry-point in Tezos smart-contract until the previous request to the contract is confirmed (block backed)

In your example, you send a transaction that calls the increment entry point of the contract. For that to happen, the transaction will have to be included in a block and, as you mention, blocks come ...
user avatar
  • 4,409
3 votes
Accepted

Error: ligo: generated. untyped BIG_MAP_EMPTY

You should type the Big_map.empty. For instance (I do not know the type of your big map): (Big_map.empty : (nat , token) big_map)
user avatar
3 votes

Size of Big_map or Big_map is empty?

You can use this RPC endpoint to retrieve big_map size in bytes: /chains/main/blocks/${level}/context/raw/json/big_maps/index/${big_map_id}/total_bytes
user avatar
3 votes
Accepted

How to get the owner of an FA2 token on chain

The specification does not enforce an implementation for this. You can only verify if a given address owns the token by calling balance_of callback view. In the case of an NFT, balance 1 would mean ...
user avatar
2 votes
Accepted

How to add add a record to a map in CameLIGO

Here is the corrected version of createArtwork: let createArtwork (store, id, ihash : artwork_storage * artworkId * ipfsHash) : artwork_storage = Map.update (id : artworkId) (Some ({ artist = ...
user avatar
  • 2,348
2 votes

Deploy FA1.2 Ligo token contract

Here's the parameter values to initialize storage for the fa1.2 contract. It is working well on my side. If you want to more look at pascaligo syntax, you can visit ligolang doc pages on https://...
user avatar
2 votes
Accepted

Convert address to string in LIGO

You cannot convert an address to a string in Michelson. You could cheat by going through pack and inspecting the binary representation but it is unlikely something you would want to do.
user avatar
  • 3,185
2 votes

Can I use escape characters in LIGO strings?

Yes, you can, using exactly the same syntax. For instance, in CameLIGO, you could write let x = Bytes.pack "toto\n\x53woo".
user avatar
2 votes
Accepted

What's an elegant way to write "take" in CameLIGO?

Accumulating the results to a linked list, and reversing the result would be more concise (and efficient, because your implementation traverses the entire input list, while this only looks at the ...
user avatar
  • 136
2 votes

Is SmartPy package inside All Michaelson Supported Languages?

SmartPy is a smart-contract programming language on its own. You can use the Online IDE or use your local IDE and test the contracts with the CLI. You can find more information here: Help Section ...
user avatar
2 votes
Accepted

Support for emojis in LIGO?

Unfortunately, the string type in Michelson is restricted to : [...] the printable subset of 7-bit ASCII, namely characters with codes from within [32, 126] range, plus the following escape ...
user avatar
  • 2,348
2 votes

Cannot get to initialize empty list in CameLIGO

If you want the voters to be optional then you need to initialize it with either the Some or None value constructors: voters = Some ([] : address list) or voters = (None : address list option)
user avatar
  • 131
2 votes
Accepted

Ligo address being interpreted as string

The address itself should be annotated as address, like this: { host = Some ("tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb" : address); } See successful deployment: https://ide.ligolang.org/p/...
user avatar
2 votes
Accepted

How to write function that uses polymorphic types

The problem here is that LIGO usually tries to prevent you from seeing Michelson typechecking errors, by raising errors early when you do something that might cause a Michelson typechecking error. If ...
user avatar
  • 2,526
2 votes
Accepted

Size of Big_map or Big_map is empty?

No, it's not possible due to the way bigmaps are stored on-chain, so you can't know it by asking a node or within a smart contract, but indexers generally keep track of how many entries there are in a ...
user avatar
2 votes
Accepted

Truffle is not working for compiling and deploying

Dont use Truffle. Truffle stopped updating the Tezos Suite after they were bought by Consensys. (Tezos Truffle Issues on Github: Truffle, Trufflesuite) Their only focus is Ethereum. At this point they ...
user avatar
  • 141
1 vote
Accepted

JSLigo Error: Invalid record field in record

The problem came from the [store]:[storage] which is accepted but not well managed by the compiler. An issue has been open for this purpose. Anyway if you want your code to compile remove the opening ...
user avatar
1 vote

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

You don't need to know the position of an entrypoint to call it. For this reason, the position does not matter much so it is not imposed by the standard.
user avatar
1 vote

what is the equivalent of ligo "compile-parameter" for smartpy?

On top of Rodrigo’s answer. In scenarios, every call generates the corresponding Michelson parameters. https://smartpy.io/docs/scenarios/testing#registering-and-displaying-calls-to-entry-points
user avatar
  • 3,185
1 vote
Accepted

Does LIGO support parameterized types?

Not yet. This is in the works though, and you are welcome to help if you are interested :)
user avatar
1 vote

"Invalid bytes error" on migration of PascalLigo contract

It worked as soon as I provided the HEX of the addressSet[] values. Maybe someone can explain why this is the case. I stumbled upon this solution after trying out for hours by accident.
user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible