As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [ligo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7 votes
4 answers
331 views

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

Was hoping to have some light shed on a few questions. Narrowing in on using Ligo, Archetype, or Liquidity. Is Liquidity kind of a dead-end right now? I noticed it's not listed on developeres.tezos....
Justin's user avatar
  • 173
5 votes
3 answers
1k views

Testing frameworks for tezos smart-contracts

I did few smart contracts with Ligo, but now looking for more productionize setup. Is there a test framework one can use for Tezos? I'm looking for something like waffle + mocha in Ethereum, or ...
Robert Zaremba's user avatar
3 votes
3 answers
118 views

Smart contract availability and diversity on Tezos

I am researching about Tezos to what smart contract language there are available to use. When I look at the TezosWiki and other sources I came up to with this list: Tezos Smart Contract Languages: ...
user avatar
3 votes
1 answer
242 views

Does Ligo Lang run on OSX?

I tried installing ligo lang following the instructions here: https://ligolang.org/docs/intro/installation/ I have docker running, the bash install script runs fine, but I still get -bash: ligo: ...
tezosdev's user avatar
2 votes
1 answer
188 views

Convert address to string in LIGO

How do I convert an address type to a string type in LIGO?
Thorkil Værge's user avatar
2 votes
1 answer
134 views

How to get the owner of an FA2 token on chain

For an FA2 nft contract, how can I get the address of the owner of token_id 0 from inside another contract?
tinuggunit's user avatar
2 votes
1 answer
63 views

Cannot get to initialize empty list in CameLIGO

I'm trying to write a smart contract in CameLIGO that looks like this parameters "Hello world" storage [{ text = "Blob"; voters = ["tz1TKc3zQBMv7Rez77sX4JNdqMvG33LQrURk"]}...
inpace's user avatar
  • 21
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
2 votes
1 answer
49 views

Writing SmartPy tests along with LIGO contracts

I have a set of smart contracts coded in SmartPy. They are heavily interdependent and some of them also interact with cTez contracts. I need to write SmartPy tests to check if everything is working ...
Ojuswi Rastogi's user avatar
2 votes
1 answer
54 views

Ligo Lang "unbound variable fail"

When I try to compile this contract https://github.com/stove-labs/nft.stove-labs.com/blob/master/src/contracts/nft.ligo using the command ligo compile-contract nft.ligo main > nft.tz per the ...
tezosdev's user avatar
2 votes
0 answers
47 views

How to set `contract` as input argument

I have a method Token_metadata_registry which takes contract(address) as input parameter and I would like to call that method from ligo dry-run. How do I do that? ligo dry-run contracts/main/fa2.ligo ...
Thorkil Værge's user avatar
1 vote
2 answers
318 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
1 vote
1 answer
131 views

Calling contract without knowing contract parameter type

If I wanted my contract to be able to call different types of contracts, with different parameters and parameter types, and I didn't know what those parameters were going to be ahead of time... I have ...
littlezigy's user avatar
1 vote
1 answer
89 views

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

Image if I have a smart contract with entry-point increment() that increments a counter. So if I call this entry-point for the first time and we know that it takes almost 1 minute for the operation to ...
Mohit Gupta's user avatar
1 vote
2 answers
196 views

Deploy FA1.2 Ligo token contract

I'm deploying the FA1.2 contract with the online LIGO IDE, Here's a link to the SC: https://ide.ligolang.org/p/QZ85RIfszExxeDPEf_W52A and i'm initializing the storage this way: (Pair (Pair {} "...
Daly's user avatar
  • 442
1 vote
1 answer
30 views

Convert bytes to string in CameLIGO?

I would like to convert a bytes type to a string type. How can this be done in pure CameLIGO?: let data: bytes = [%bytes "hello"] in let str: string = ??? Thank you, Edward
EdwardG's user avatar
  • 123
1 vote
1 answer
78 views

How to add add a record to a map in CameLIGO

I'm using CameLIGO and want to add a record to a map. I keep getting this error: Error: ligo: : Parse error in file "tmp-1lMUlWlg5fktI.ligo", line 21, characters 45-46, after "{" and before "}": ...
Mark Robson's user avatar
1 vote
2 answers
16 views

How do you generate your initial storage for deployment in ligo?

I'm curious about your strategies regarding the following questions: How do you generate your initial storage for deployment ? Where do you store your storage types ? Do you keep your storage ...
Ron's user avatar
  • 45
1 vote
1 answer
50 views

Tezos Smart Contract Language Specifications

Is there an equivalent "interface" keyword in any of the Tezos smart contract languages (i.e. smartpy, archetype, ligo) that is similar to solidity's keyword "interface". If there ...
hancockm's user avatar
1 vote
2 answers
39 views

Truffle is not working for compiling and deploying

Is anybody here still using Truffle in order to compile and deploy Tezos projects? I created a project with it over a year ago and wanted to update the environment. After dowloading the latest Ligo ...
user avatar
1 vote
2 answers
100 views

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

The Smartpy compiler allow to compile a contract (compiling the code and the initial storage) but I don't see any "compile-parameter" option, that would allow to convert a smartpy command to ...
MohamedLEGH's user avatar
1 vote
3 answers
143 views

Tezos.get_entrypoint_opt in Ligo issue

I am trying to replace get_contract with Tezos.get_entrypoint_opt I need to transfer FA1.2 tokens in Dex: https://github.com/madfish-solutions/quipuswap-core/blob/master/contracts/Dex.ligo#L21-L28 ...
Anastasia Kondaurova's user avatar
1 vote
1 answer
49 views

Pascaligo Compiling Error on Big_map.add

I encounter the below error message when compiling the code on LIGO Playground. Error: ligo: in file "tmp-1CAIKM1VUeRgb.ligo", line 29, characters 98-112. different kinds: {"a":"unit","b":"(...
Michelle Song's user avatar
1 vote
2 answers
63 views

Can I create a smart contract from inside another smart contract in LIGO?

Through a parent contract, I want to be able to originate multiple child contracts. How can I do this in LIGO?
tinuggunit's user avatar
1 vote
0 answers
104 views

Initialize a record storage with command line

I'm trying to initialize the storage of the record through the command line. I'm trying different variations of: "ligo compile-storage college.religo main 4 Adam 1600" For a record called ...
Adam Shinder's user avatar
1 vote
0 answers
24 views

Not able to get error msg generated by failWith using ConseilJS

I am trying to invoke my contract with conseiljs.TezosNodeWriter.sendContractInvocationOperation(). Everything works fine with a positive scenario but when I purposely fail the script with some error ...
Mohit Gupta's user avatar
1 vote
1 answer
14 views

Error in dry : different keys in tuple and record

I am trying to dry-run one contract on online Ligo IDE, Access function : main Parameters : (10n, ("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address)) The logo code is compiling fine and I don't ...
Mohit Gupta's user avatar
1 vote
1 answer
63 views

Pascaligo map iteration issue

I try to fetch a list of addresses with expired date by appending the address to list(address). However when doing map iteration, it encounters a persistent error says 'not True'. Hope someone can ...
Michelle Song's user avatar
1 vote
0 answers
37 views

Split function contract template

Is there a code template for a simple contract which splits the incoming funds and sends them proportionally to a list of pre-registered addresses? Example: Contract has the following functions: ...
XTZST2O's user avatar
  • 835
0 votes
3 answers
44 views

Size of Big_map or Big_map is empty?

Is it possible to find the size of a Big_map, or to find out whether a Big_map is empty?
littlezigy's user avatar
0 votes
1 answer
50 views

Error: ligo: generated. untyped BIG_MAP_EMPTY

In ligo for a smart-contract I have a big_map in my storage and I want to pass nothing in the map as intial_storage value. { name = "stablecoin"; symbol = "eur"; total_supply = ...
Mohit Gupta's user avatar
0 votes
1 answer
102 views

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

I'm trying to loop through a mapping list (type_a) and update a different mapping list (type_b). Both lists are different. For List.fold, does the accumulator have to be the same type as list? ie, if ...
littlezigy's user avatar
0 votes
1 answer
38 views

Ligo address being interpreted as string

I'm trying to initialise a contract that has an address option in its initial storage, but when I provide a valid address, it keeps being interpreted as a string; and compilation fails. I have here a ...
kokociel's user avatar
  • 128
0 votes
1 answer
48 views

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

What's an elegant way to write the classic take function in CameLIGO? take takes the first num elements of a list. This is how I'm writing it currently, and it's ugly. Here, message is a type I ...
emchristiansen's user avatar
0 votes
1 answer
24 views

Is SmartPy package inside All Michaelson Supported Languages?

I've discovered that Liquidity, LigoLang and Ocamel Support Tezos development, but I've only found 1 resource that states that SmartPy supports only LigoLang. I wanted to use the right language to ...
HighXTC's user avatar
0 votes
2 answers
8 views

Merkle Tree implementation in Ligo

I am looking for an implementation of a merkle tree, in ligo. Could somebody help me please? From Slack, to share the answers for others its posted on Stackexchange.
Ron's user avatar
  • 45
0 votes
1 answer
76 views

How to write function that uses polymorphic types

I'm trying to write some functions in (came)ligo that compare several values as long as they are ints, strings, or nats. compare_equal is one of them. This errors out with Only composed types of not ...
littlezigy's user avatar
0 votes
1 answer
36 views

JSLigo Error: Invalid record field in record

I'm trying to write a smart contract with JSLigo. This contract has a storage type with a single string field and 2 functions, to update and reset this string: type storage = { name: string }; ...
avl's user avatar
  • 69
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
0 votes
1 answer
37 views

Compile multiple Ligo contracts at one go

I would like to compile all contracts in a folder at one go. I tried "compile all": "docker run --rm -v \"$PWD\":\"$PWD\" -w \"$PWD\" ligolang/ligo:0.24.0 ...
DottoreM's user avatar
  • 105
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
0 votes
1 answer
99 views

"Invalid bytes error" on migration of PascalLigo contract

I am trying to write tests for my contract, which stores an user as follows: type userData is record [ addressSet : set(bytes); storedAmount : tez; ] My storage is a big_map as ...
Ryan's user avatar
  • 11
0 votes
2 answers
70 views

Comments in LIGO

What is the syntax for comments in LIGO?
Thorkil Værge's user avatar
0 votes
1 answer
45 views

Can I use escape characters in LIGO strings?

I would like to insert some special ASCII characters that I only know how to express as numbers. In Python I would for example be able to write the SYN control character as \x16 since 0x16 is SYN in ...
Thorkil Værge's user avatar
0 votes
1 answer
82 views

How do you update a map in Pascal Ligo?

I'm trying to learn how to write a smart contract and using Ligo. I'm struggling with quite a few things at the same time e.g. syntax, understand the documentation, best practices etc. Baby step is, ...
Mark Robson's user avatar
0 votes
1 answer
10 views

How to compile a LigoLang jsLigo written smart contract on Windows + vsCode?

I'm beginning to learn to write Tezos smart contracts with LigoLang using jsLigo as programming language and Windows as operating system. For IDE I'm using vsCode. I've followed the Getting Started ...
Luiz Milfont's user avatar
0 votes
0 answers
13 views

Unable to interact with other contracts because Tezos.get_contract_opt got None

I tried to interact with other contracts but failed because Tezos.get_contract_opt always returns None. Here's the demo code (ligo v0.60.0): receiver.jsligo - A contract that the "broadcaster&...
caaatisgood's user avatar
0 votes
0 answers
21 views

How to test that an error is raised in ligo?

I would like to know if there is some way of testing for error raised with failwith in ligo using the testing framework? There doesn’t seem to be any documented try-catch mechanism yet, or am I ...
Pierre Chopin's user avatar
0 votes
0 answers
27 views

"Cannot unify set with unit" error

I am trying to write a simple contract in which I am using set of records as storage. type data = { message : string, did: address }; type parameter = | ["Published"] | ["...
Parshant Singh's user avatar
0 votes
2 answers
42 views

TransferOwnership in Tezos

Is there an analog of transferOwnership in Tezos? It looks like it's possible to make custom FA2 contract and change owner. Is this correct? Looking for an authorative answer
user avatar