Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8
votes
1answer
97 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/...
13
votes
3answers
220 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
182 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
169 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
110 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
36 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
143 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
173 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
300 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
53 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
116 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
93 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
47 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
321 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
134 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
170 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
226 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
194 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
5
votes
1answer
80 views

Contract.create bytes array return value

I'm using liquidity lang, and define a storage: type storage = { usersDocuments : (address,address set) big_map; documents: string set; } and I add in to usersDocuments https://pastebin.com/...
5
votes
1answer
62 views

How are Smart Contracts saved for checking in future?

Am I understanding correctly, that I can store for example my rental contract as a Smart Contract and then it is made official with baking it with bakers? If I got the first part right, the contract ...
8
votes
1answer
114 views

What exactly are smart contracts?

I'm new to Tezos, and in fact to Bitcoin in general. I have been reading up on it a good bit, though, and I ran across an article on cryptobriefing which states that Tezos, like Ethereum, uses smart ...
8
votes
1answer
44 views

Spending XTZ held in an implicit account from a smart contract

Is it possible for code in a KT1 smart contract to spend from a tz1 adress ?
6
votes
2answers
101 views

Michelson Logic understanding problem

If i got it right, Michelson is a stack based language. I've read the following example about stack based languages: 3 4 5 * + = 23 how does Michelson know, that it has to mutiplicate 4 * 5 ...
11
votes
2answers
151 views

Reentrancy attack vector on tezos smart contracts?

I heard that Michelson helps with avoiding re-entrancy bug. Why is that? Is there some feature in the language that prevent it?
13
votes
2answers
324 views

Formal verification of Tezos smart contracts

What are the analyses of Tezos smart contracts that could benefit dapps writers the most? Just to be clear, by “analysis” here I mean “static program analysis”. See for instance here. Basically the ...

1 2 3
4