11
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 ...
7
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' ...
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 ...
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 ...
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
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 ...
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://...
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 ...
3
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.
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)
3
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.
3
votes
Smart contract availability and diversity on Tezos
We can confirm that LigoLANG is used by the following open-source projects:
Quipuswap,
Yupana,
cTez,
Juster,
Vortex DEX,
Flame DeFi,
Deku Sidechain,
TzPortal Bridge.
3
votes
Accepted
Convert bytes to string in CameLIGO?
If you are using literal bytes i don't think you can do it from the standard lib of Ligo. You need to build your bytes to string function.
If you are using bytes create from a Michelson string you can ...
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 = ...
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://...
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 ...
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
...
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)
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 ...
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/...
2
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 ...
2
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
2
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 ...
2
votes
Smart contract availability and diversity on Tezos
I can confirm that SmartPy is used by the following dApps (I restrict to the TOP 10 most used): objkt.com, fx hash, Hic et Nunc (repos), Teia (contract), Versum, Plenty, Kolibri (harbinger contracts), ...
2
votes
Taqueria/Ligo install problems
I cannot reproduce it locally so it's hard to find the solution.
FYI You are using docker, esy is directly installed inside so you should not have to install esy before.
Some clues :
When you run this ...
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 ...
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 :)
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.
1
vote
Accepted
Compile multiple Ligo contracts at one go
Try
cd contracts
for i in *.ligo; do
docker run --rm -v \"$PWD\":\"$PWD\" -w \"$PWD\" \
ligolang/ligo:0.24.0 compile-contract \
contracts/$i main &...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ligo × 73smart-contracts × 34
smartpy × 10
michelson × 10
liquidity × 4
testing × 4
fa2 × 4
tezos-client × 3
truffle × 3
node × 2
taquito × 2
error × 2
contract × 2
deploy × 2
conseiljs × 2
compile × 2
string × 2
nft × 2
transactions × 1
storage × 1
address × 1
javascript × 1
blockchain × 1
origination × 1
types × 1