11
votes
Is there a way to generate a pseudo-random number inside a contract in liquidity?
If what you mean is a non-predictable source of randomness, no, there is none. Any information that could be used for that could either be predictable by a user, or tempered by a malicious baker.
You ...
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 ...
9
votes
Accepted
In the broker2.liq example, how is storage being returned by the call function?
This is an obsolete example. Contract calls do not return values anymore (it should not be in the repo). Have a look here instead (contract calls create operations that are executed sequentially after ...
8
votes
Encryption within smart contract
It's not clear what decrypting data from within a smart contract would achieve since all operations are public.
8
votes
Accepted
Encryption within smart contract
There are currently no encrypt/decrypt instructions for Michelson. You can view the full list of instructions here: http://tezos.gitlab.io/mainnet/whitedoc/michelson.html
8
votes
Accepted
How can a string be coerced into tez using Liquidity?
So apparently, this feature is no longer available in Liquidity, and the docs are incorrect in this case. You can read a reply from Liquidity Lead Dev here.
8
votes
Accepted
Basic Syntax for iterating through List Element and processing each of them
You can use Loop.left (with and accumulator) but it is easier to use List.fold and tail recursive functions (those are encoded with loops).
Here is a way to do it (you can call the entry point test ...
6
votes
Accepted
Error 57 when installing Liquidity
Actually, error 57: Synopsis and description must not be both empty should be seen as a warning emitted by opam. The reason of the failure is given at the end. It's due to absence of some system ...
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' ...
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 ...
5
votes
How can I call a contract with a type parameter?
If you use the next branch of Liquidity, you can use :
liquidity CONTRACT.liq --call-arg main '{ name = "test"; sig = "abcd" }' to print the argument to be used by tezos-client (where main is the ...
4
votes
Error while initializing storage in contract deployment cmd using tezos-client command line interface option
Turns out this supposed to be passed like this:
'(Pair "tz1PKKC9NTsxxfwYpg1bVAY5k5AKuPYe9gpg" "KT1GE2AZhazRxGsAjRVkQccHcB2pvANXQWd7")'
4
votes
Accepted
method for calling to entry point of contract instance (?) created by contract.create
You cannot create a contract and call it immediately.
It goes like this, chronologically:
Your script is running. You invoke CREATE_CONTRACT or CREATE_ACCOUNT. An operation and address are returned ...
4
votes
Accepted
Gas consumption in a chain of internal transfers
You cannot exceed the hard_gas_limit_per_operation = 400000. It will probably be increased in future protocols, though (see e.g. the "Athens" proposals).
Internal transfers can use up a lot of gas.
...
4
votes
Accepted
ReasonML pattern matching error on tuples
Indeed, Liquidity does not implement deep pattern-matching as in OCaml or Reason. You have to match only one level (constructor or tuple) at a time. We hope to be able to improve that in later ...
4
votes
Accepted
Contract.create bytes array return value
This is the 'optimized' Micheline representation of an address value.
In the future, I think we should extend the client and RPC a bit, to make things easier here. For now...
You can see optimized ...
4
votes
Accepted
How can I call a contract with a type parameter?
As per the Michelson spec you need to use the correct calling convention. You should use the following:
(Pair "this is a string" "a signature string")
One other obeservation - Why do you have SWAP ...
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://...
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 ...
3
votes
Accepted
Error while initializing a Map in contract deployment
After compiling in the liquidity IDE, we see that the type of the storage is
storage (pair :storage (map %candidates string int) (map %voters address bool));
For the initialization, the annotations ...
3
votes
Accepted
Language features needed for Marigold
You may want to follow this project: https://medium.com/tezos/introducing-ligo-a-new-smart-contract-language-for-tezos-233fa17f21c7
Not many answers for now, syntax apart, it looks like Liquidity or ...
3
votes
Accepted
How to concatenate a string and tez in Liquidity?
There are no Michelson ops for formatting values as strings.
Unless a protocol change adds such operations, it seems that the best way to convert mutez (or int, nat) to string will be to write the ...
2
votes
Accepted
How to deploy a contract in Mainnnet (not Alfanet!) Tezos? I have a contract code for Fi, a working node on the Digital Ocean. What should I do next?
One way is to build the deploy command using https://fi-code.com/ .
You can build the command by specifying the contract code in fi, the initial storage and balance, and the manager, then pressing "...
2
votes
Accepted
Deploying a simple contract using liquidity
You are using a private key which do not correspond to any account on the alphanet.
It works with
liquidity --tezos-node http://alphanet-node.tzscan.io:80 --private-key ...
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
Accepted
How to provide liquidity to the upcoming liquidity baking tez/tzBTC?
You put the amount of tez you'd like to supply in the amount field, which represents the tez amount transferred to the contract. maxTokensDeposited and minLqtMinted are the maximum number of tokens (...
2
votes
Accepted
Liquidity Baking subsidies effect on pool ownership
Does this mean that at the end of this 6 month period I would own 0.0596447509723% of that 1296000 xtz, or 772.99597260151 xtz?
Only if your share of the liquidity pools does not change in the ...
1
vote
Accepted
what is the Liquidity Baking subsidy used for and how do liquidity providers benefit?
When liquidity providers deposit tez and tzBTC they receive a liquidity token in return and when they redeem liquidity tokens they receive back tez and tzBTC. The subsidy means they will receive more ...
1
vote
Accepted
what's a sensible minLqtMinted to send to the Liquidity Baking CPMM when calling addLiquidity?
One way to think about it is to think about how many lqt would be minted if the transaction hit the contract in its current state and allow for some slippage. For example, with 10% slippage, you would ...
1
vote
Tezos - Liquidity deploy contract error
Hehey, ok if this is true, it is sad. but i found a solution; liquidity -> .liq -> .tz and deploy with tezos-client. :) – candlez Jan 6 at 15:00
Only top scored, non community-wiki answers of a minimum length are eligible