Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
387 views

How to extract the storage of a smart contract?

How do I extract the storage data of a deployed smart contract? I am trying to read the storage data from the "free Ledger Nano S" contract KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ from the Tezos ...
4
votes
1answer
124 views

Error while initializing storage in contract deployment

I am using folowing command: ./tezos-client originate contract TestContract for tz1address transferring 1 from tz1address running contes.fi --init 'pair (map "KT1address" 1) (map "KT1address" "2019-...
1
vote
0answers
36 views

Deployment of a smart contract through fi compiler

I seem to fill in these parameters incorrectly. What do I need to enter in the Storage.Value and Storage.StartTime columns? If you can give examples
1
vote
0answers
33 views

Problem with Liquidity installation

After entering this command make build-deps , I get the error message: The following dependencies couldn't be met: - liquidity → ocaml < 4.07.1 no matching version No solution found, ...
5
votes
1answer
86 views

Can I withdraw funds from an empty smart contract?

I've stuffed up bad and managed to send some Tez to an empty KT1 smart contract. Is there any way of getting it back? The contract is: parameter string; storage string; code { CAR ; NIL operation ;...
2
votes
1answer
49 views

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?

I have a contract code for Fi, a working Mainnet node on the Digital Ocean. What should I do next? Please explain in detail because I have little experience.
4
votes
0answers
29 views

Checking contract against contract type in Liquidity

With the example below, is it possible to get liquidity to check that the type of the contract C matches C_intf? contract type C_intf = sig type storage val%entry check_balance : nat -> _ end ...
4
votes
0answers
28 views

How to split a string in Liquidity?

I'm attempting to split apart a string by "." so that "my.name" returns {"my", "name"}. However, I can't seem to find an in-built method of performing this operation in Liquidity. Lately, I've tried ...
4
votes
1answer
43 views

When contract simulation may fail to predict the contract's behavior?

When we try to run a smart contract using tezos-client, it estimates the gas cost and predicts the final output of the contract. It simulates the contract execution under the current block-chain, ...
5
votes
1answer
83 views

Operations created by a smart contract call chain go in the same block?

Imagine there is a smart contract which calls other smart contracts using TRANSFER_TOKENS and in the end lots of operations are created. Are these operations baked in a block atomically? I mean, is ...
4
votes
0answers
65 views

How to implement a signature checker for the signature scheme BLS?

We are willing to implement a signature checker for the signature scheme BLS (or BLS12-381). To the best of our knowledge, it may not be too painful since the smart contract language already supports ...
4
votes
3answers
266 views

How to get smart-contract storage data?

I try to get smart-contract storage data: eztz.node.setProvider('https://alphanet-node.tzscan.io') eztz.contract.watch(addr, 2, function(s){ console.log("New storage", s); }); But got an ...
3
votes
0answers
37 views

getting off chain data on chain to smart contracts

Currently 80+% of smart contracts need off chain data, is there a solution to bring off chain data on chain to trigger for smart contracts? (oracles related)
5
votes
1answer
45 views

Are there any wallets that can call contracts?

I'm building a dapp on Tezos and would like users to call some of the related contracts directly from the webapp. E.g. I present a QR code with a prefilled contract call. Are there any wallets that ...
2
votes
1answer
47 views

Liquidity “Syntax error”, ok, but what/where?

I'm having problems with liquidity syntax... (I'm using the online liquidity-lang editor). I'm trying to make a simple smart contract that adds items with history, think of it as a maintenance log ...
3
votes
1answer
106 views

Error while initializing storage in contract deployment cmd using tezos-client command line interface option

I am using the following command originate contract new for mgr transferring qty from src running prg for deploying a contract using Command Line Interface as mentioned in CLI document. This ...
2
votes
1answer
55 views

How key_hash can be coerced to address, or vice versa?

I try to convert a "key_hash" to "address" data type. In OCaml syntax like: let key_h = (addr : key_hash) in and ReasonML syntax like: let key_h = (addr : key_hash); have the same error: Type ...
2
votes
0answers
23 views

Unable to deploy a Liquidity smart contract directly (without offline signature / forged operation)

I'm trying to deploy a contract directly as specified in Liquidity docs, but the CLI fails with: Failure: edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh is not a valid private key I have ...
2
votes
1answer
36 views

Tools available : contract deployment / calling - Alphanet / mainnet

Are there any tools available running on web-page, browser plugin, desktop or mobile that allow me to do the following : Deploy contracts - alphanet / mainnet Call contracts - alphanet / mainnet ...
4
votes
0answers
25 views

Michelson_v1_printer.unparse error with originate contract

I am trying to use tezos client to deploy contract on alphanet but I get error Michelson_v1_printer.unparse Command: tezos-client -l -A $TEZOS_NODE originate contract controller_v6 for $MANAGER ...
2
votes
2answers
125 views

smart contract for automatic baking/endorsement rewards to delegators

It seems like a smart contract would be the most natural mechanism to use for implementing a automatic rewards payment system to a baker's delegators, and I'm curious if such a contract is possibly to ...
5
votes
1answer
82 views

method for calling to entry point of contract instance (?) created by contract.create

Contract A is not able to find the address of the contract created by contract.create. Tried adding the signature of B as well as it's complete definition in contract A but still, it doesn't solve the ...
5
votes
1answer
203 views

Gas consumption in a chain of internal transfers

I am trying to perform a chain of contract calls with internal transfers. I think my current contracts are very simple, but I run out of gas after only 4 internal transfers: A script or one of its ...
2
votes
1answer
60 views

How is the liquidity token.liq working

I'm asking for help because i don't really understand how the token.liq works and mostly what the functions needs. For exemple I don't seem to be able to get the balance of an account. In the input ...
5
votes
1answer
31 views

Tuples index access via contract's input params

I'm trying to get tuple value by index using contract's input param. Getting weird assertion error. let%entry main = (idx: int, storage) => { let tmp = ("test - 1","test - 2", 3) failwith(tmp[...
3
votes
1answer
28 views

ReasonML pattern matching error on tuples

I am trying to write some game on tezos via ReasonML, stuck with pattern matching on tuples, looks like it does not work let tmp = switch (players) { | (Some(p), None) => let storage ...
5
votes
2answers
115 views

Smart contract for bakers

Is it possible to write a Smart contract that would define the relationships between baker and delegator, and if so how would it be done? It should include the following: - delegation duration - ...
8
votes
1answer
101 views

Why does a transaction contain a storage dump?

I have looked at a few transactions with some smart contracts and I have found that they store a dump of contract's storage. For instance: https://mainnet.tezrpc.me/chains/main/blocks/246869/...
14
votes
3answers
262 views

How to upgrade a smart contract?

I'm building a smart contract that is sort of an index of signed documents (pointing to ipfs for the actual docs). What if I want to add some functionality to my app down the road and need to upgrade ...
7
votes
1answer
63 views

Basic Syntax for iterating through List Element and processing each of them

I am creating two lists in liquidity and trying to process on them as follow: type two_element = { name: string; value : nat; } type list1 = two_element list; type list2 = two_element list; ...
5
votes
0answers
67 views

“Unhandled error: Failure backtracked” while trying to creating a contract

I'm trying to work with the example code from the liquidity documentation for Contract.create(). The code compiles and tests on the online-editor properly. It also deploys using the editor. But when I ...
9
votes
3answers
188 views

Is there a Tezos equivalent of ERC?

I’d like to read / contribute to existing contract standards on Tezos, is there an open source movement like ERC?
4
votes
1answer
47 views

Time based Delegations possible?

Would it be possible, to make a "time-based-delegation"? I.E.; I want to delegate for 5 Cycles to Bakery A and after that for 10 Cycles to Bakery B and so on. Could something like this be realized ...
6
votes
1answer
193 views

What does it cost to make a contract through Tezos?

I have seen clear structure and numbers on how baking, delegating and double endorsing etc. affect to the users amount of Tezos, but is there any cost on making a contract (in other words creating ...
4
votes
1answer
39 views

In the broker2.liq example, how is storage being returned by the call function?

The code here returns value from Contract.call() as: let _result, storage = Contract.call storage.x transfer storage () in What are the values stored in _result and storage? Note: I couldn't ...
6
votes
1answer
114 views

Is there a way to call a function inside a contract from a function in another contract?

I want to have two different contracts that have functions that should interact with each other. Is there a way to pass/return values through function call between contracts?
3
votes
1answer
38 views

How SET_CAR/SET_CDR macros should be expanded?

Michelson specification declares the following rule for expansion of SET_CDR macro SET_CDR @var %field => CAR %field ; PAIR @var However, %field is supposed to be a field annotation of right ...
13
votes
3answers
155 views

How can I write tests for my smart contracts?

I like doing TDD and would like to build up a test suite around my contract code. I have been looking at both ReasonML and Liquidity but neither seems to have a great testing story yet. Does it make ...
3
votes
2answers
189 views

How can I call a contract with a type parameter?

I have the following contract: parameter (pair :doc (string %name) (string %sig)); storage (list (pair :doc (string %name) (string %sig))); code { DUP ; DIP { CDR @storage_slash_1 } ; ...
8
votes
3answers
326 views

How can I deploy a Michelson smart contract?

I'm wondering how to deploy a Michelson smart contract on Tezos. Maybe I'm just bad at googling, but all the examples I can find are using liquidity-cli. I'm not using liquidity for this contract, ...
6
votes
2answers
54 views

How to remain auditable while using a database or index for a smart contract application?

As I am setting out to build my first proper smart contract backed application, I need to set up a database & index for the website for fast query times etc. How can I set this up in a way so that ...
4
votes
2answers
124 views

Benefits of Michelson

I'm trying to understand the design decisions behind Michelson and I'm in the process of evaluating if I should be writing my dapp in the Tezos blockchain. What type of benefits does Michelson have ...
2
votes
1answer
57 views

Michelson: two potential bugs in type checker / spec [closed]

TL;DR looks like 1 bug in spec and one more in type checker for alphanet. Someone please review and comment on this behavior :) parameter unit; storage string; code { DROP; PUSH int 3; ...
10
votes
1answer
97 views

Is there a way to generate a pseudo-random number inside a contract in liquidity?

If I require a pseudo-random number (PRN) in the internal working of a function in liquidity, is there a way to do it? Is there one in Michelson? I already know about the way to send a PRN through RPC ...
6
votes
1answer
48 views

Regarding annotations in michelson

Michelson has different type of annotations. I am curious about what is the main purpose of annotations and where should one use annotations vs where on shouldn't? Is there a michelson pattern where ...
4
votes
3answers
341 views

How to watch transaction status with eztz after eztz.contract.send

I am developing an app and I use JavaScript. I need to watch transaction from user browser. I use eztz method eztz.contract.send for create transaction. I receive back the transaction hash, but not ...
9
votes
1answer
135 views

How can a string be coerced into tez using Liquidity?

Documentation states the following: tez : an unbounded positive float of Tezzies, written either with a tz suffix (1.00tz, etc.) or as a string with type coercion ("1.00" : tez). Yet the following ...
8
votes
1answer
183 views

How to specify the smart contract entry point in eztz call?

I want to call a smart contract with eztz: eztz.contract.send(contract,from, keys, amoun, params, gasLimit,storageLimit) How to specify the entry point, my smart contract has multiple entry points : ...
5
votes
2answers
229 views

How to call a smart contract method with params with eztz?

Does Eztz have some method for calling smart contract methods with parameters? For example if my contract has a method let%entry createFile ((fileHash : string),(manager:key_hash)) storage How can ...
3
votes
2answers
206 views

A contract calling another contract

Can someone please give an example Michelson smart contract that calls another smart contract ? Some actual implementation would go a long way. Many thanks