Questions tagged [ligo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 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
  • 101
0 votes
0 answers
11 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 ...
0 votes
0 answers
16 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"] | ["...
3 votes
3 answers
77 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
0 votes
2 answers
33 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
1 vote
1 answer
47 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 ...
2 votes
1 answer
90 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?
1 vote
2 answers
39 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?
0 votes
1 answer
27 views

how to input data of type maps

This is a multiasset holding contract with code to mint and burn FA2 tokens but I am confused ion how to provide the inputs as it is getting errored token_info is the metadata section I want to put ...
1 vote
2 answers
36 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
0 votes
3 answers
38 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?
0 votes
1 answer
93 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 ...
0 votes
1 answer
73 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 ...
0 votes
1 answer
39 views

How does Tezos Checker work?

I am looking at Tezos Checker and wondering if there is a visualization of the process flow how it works? Specifically something like this for example?
user avatar
1 vote
1 answer
125 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 ...
0 votes
0 answers
26 views

Tezos.get_contract fails even though contract exists

I have a view caller that calls the view of my main contract. I'm not sure why this is happening, but the contract fails at get_contract_with_error. Also, Tezos.call_view returns None. Here's what my ...
0 votes
0 answers
18 views

Ill-formed block of statements

type investment is record [ amount:tez; deadline:timestamp ] type investor is map (address,investment) type user_data is record [ balance:tez; is_invested:bool; investment:...
0 votes
0 answers
52 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 ...
0 votes
1 answer
20 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 ...
  • 128
0 votes
1 answer
28 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 }; ...
  • 69
0 votes
1 answer
139 views

error when deploying my smart contract

I created a smart contract it compiles without problem but I have an error when deploying, I don't know what this error can refer to... HttpResponse: Http error response: (500) [{"kind":&...
  • 119
0 votes
0 answers
21 views

How to change storage price when transferring an nft?

I created a transfer function in this function I pass a price as a parameter, I would like this price to be updated on the storage of my nft... I don't really know how to do it (I'm new to tezos ) ...
  • 119
0 votes
0 answers
24 views

I don't understand how the hashlock contract works in the LIGO IDE

I'm trying to understand the hashlock contract: https://gitlab.com/ligolangh/ligo/-/blob/e2672829484927b268c8ab0755247403e1f90675/src/test/examples/jsligo/hashlock.jsligo For me, in a hashlock ...
0 votes
1 answer
13 views

is it necessary to implement the permissions_descriptor?

With FA2 NFT tokens, is it necessary to implement the permissions_descriptor? As far as I can see in tzkt, it doesn't look like it's actually being used. Are there any contracts that are actually used?...
  • 1
0 votes
0 answers
47 views

Can I call FA1.2 token's transfer entrypoint & FA2.0 token's transfer entrypoint from the one contract?

I want to call FA1.2 token's transfer entrypoint & FA2.0 token's transfer entrypoint from the one contract using get_entrypoint_opt/get_contract_opt. But, Both interfaces use "Transfer" ...
  • 1
0 votes
2 answers
102 views

Tezos Contracts Compiling Error

I am just days into learning how to build a dapp on Tezos for my thesis. I tried replicating the steps from Claude's tutorial - https://hackernoon.com/build-your-first-dapp-on-tezos-rwgl3ymb I ran ...
2 votes
1 answer
58 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"]}...
  • 21
0 votes
2 answers
53 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 ...
  • 131
0 votes
1 answer
42 views

How to check amount sent with transaction (like msg.value>6 in ethereum)

How do I check inside a contract entrypoint, that the user sent a particular amount with the transaction? In Frontend: const operation = await contractInstance.methods.methodName().send({amount:12}); ...
0 votes
0 answers
56 views

Is there a more sensible way to convert an int to a string in Cameligo?

Is there a more sensible way to convert an int to a string in Cameligo? Alternatively, is there a way to concatenate an int or nat with a string? type lookup = (int, string) map let lookup: lookup = ...
0 votes
1 answer
34 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 ...
  • 105
0 votes
2 answers
82 views

smart contract translation tool

Any known tool or website can translate the given online contract into ligo? For example, KT18fp5rcTW7mbWDmzFwjLDUhs5MeJmagDSZ, can I review the logic of this contract in ligo somewhere, however ...
1 vote
2 answers
94 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 ...
0 votes
1 answer
57 views

tqtezos / minter-sdk installation issue

I am trying to run below command for minter-contract on my local machine and getting error npm i @tqtezos/minter-contracts no such file or directory, chmod ‘/node_modules/@tqtezos/minter-contracts/...
0 votes
1 answer
80 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
2 answers
305 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
1 answer
58 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
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 ...
0 votes
1 answer
44 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 ...
0 votes
1 answer
81 views

Cannot get transfer entrypoint

I'm trying to call an FA1.2 transfer function from another contract. Here is my endpoint in the FA1.2 contract: type action is | Transfer of michelson_pair(address, "from", michelson_pair(...
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 ...
0 votes
1 answer
191 views

proto.007-PsDELPH1.storage_exhausted.operation when originating contract (storage_limit is set)

I am trying to deploy a contract to delphinet with truffle. On a local sandbox the contract deploys just fine, but for the deployment on Delphi I am getting: proto.007-PsDELPH1.storage_exhausted....
  • 11
0 votes
1 answer
94 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 ...
  • 11
0 votes
2 answers
65 views

Comments in LIGO

What is the syntax for comments in LIGO?
1 vote
0 answers
93 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 ...
2 votes
1 answer
135 views

Convert address to string in LIGO

How do I convert an address type to a string type in LIGO?
0 votes
1 answer
89 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 ...
0 votes
1 answer
42 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 ...
1 vote
1 answer
84 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 ...
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 ...