Questions tagged [smart-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
15 votes
3 answers
647 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 ...
asbjornenge's user avatar
  • 1,973
14 votes
2 answers
400 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 ...
Ezy's user avatar
  • 6,064
13 votes
3 answers
203 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 ...
asbjornenge's user avatar
  • 1,973
11 votes
2 answers
245 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?
Ezy's user avatar
  • 6,064
10 votes
1 answer
238 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 ...
pathfinder's user avatar
9 votes
1 answer
1k views

Storage and parameter size limitations of smart contract?

Got a few questions regarding storage limitations of smart contract. What is the maximum number of bytes of data that I can send for a single transaction? Is there a size limit to the storage of a ...
Vinnyson's user avatar
  • 515
9 votes
3 answers
212 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?
Matej maht0rz Šima's user avatar
9 votes
1 answer
144 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 ...
Matej maht0rz Šima's user avatar
8 votes
3 answers
461 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, ...
asbjornenge's user avatar
  • 1,973
8 votes
1 answer
49 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 ?
Ezy's user avatar
  • 6,064
8 votes
1 answer
234 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 : ...
Михаил Магомедов's user avatar
8 votes
1 answer
140 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 ...
anonymous2's user avatar
8 votes
1 answer
129 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/...
Groxan's user avatar
  • 2,701
7 votes
1 answer
86 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; ...
user_184's user avatar
  • 347
6 votes
2 answers
108 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 ...
Blindripper's user avatar
  • 2,635
6 votes
1 answer
281 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 ...
mico's user avatar
  • 697
6 votes
1 answer
153 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?
pathfinder's user avatar
6 votes
2 answers
59 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 ...
asbjornenge's user avatar
  • 1,973
6 votes
1 answer
62 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 ...
Amit Panghal's user avatar
5 votes
3 answers
1k views

Testing frameworks for tezos smart-contracts

I did few smart contracts with Ligo, but now looking for more productionize setup. Is there a test framework one can use for Tezos? I'm looking for something like waffle + mocha in Ethereum, or ...
Robert Zaremba's user avatar
5 votes
2 answers
271 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 ...
Михаил Магомедов's user avatar
5 votes
1 answer
70 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 ...
mico's user avatar
  • 697
5 votes
2 answers
394 views

Operation cost for invoking smart contract

I would like to find out if the smart contract's code size/storage or an operation's parameters helps to derive to the cost. Is there a formula to calculate the cost of the operation to be invoking a ...
Vinnyson's user avatar
  • 515
5 votes
2 answers
181 views

How do I get a list of a Tezos smart contract KT1 address entrypoints and its parameters?

I wish to retrieve info from a KT1 address so I know which entrypoints are available for consuming and which are their parameters and types. How can I achieve this? Thanks in advance.
Luiz Milfont's user avatar
5 votes
1 answer
144 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 ;...
Dawsy's user avatar
  • 51
5 votes
1 answer
88 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 ...
user_184's user avatar
  • 347
5 votes
1 answer
292 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 ...
user_184's user avatar
  • 347
5 votes
1 answer
97 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/...
Михаил Магомедов's user avatar
5 votes
1 answer
111 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 ...
camlspotter's user avatar
5 votes
1 answer
341 views

How to provide liquidity to the upcoming liquidity baking tez/tzBTC?

I've tried to understand how to interact on the interface on Better Call dev but can't seem to figure it out. When I execute them under simulation I get failed transaction. Where do I insert the ...
CuriousET's user avatar
5 votes
1 answer
52 views

bigmap.get(key, "") with default param in case of no entry for key in the map with Taquito

Can we do something similar to myMap.get(key, defaultValue = None) of smartPy with Taquito? An instruction like: const myContract = await Tezos.contract.at(contractAddress); const contractStorage = ...
Daly's user avatar
  • 442
5 votes
1 answer
56 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 ...
asbjornenge's user avatar
  • 1,973
5 votes
1 answer
35 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[...
user3772195's user avatar
5 votes
2 answers
133 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 - ...
indigo's user avatar
  • 573
5 votes
0 answers
81 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 ...
pathfinder's user avatar
4 votes
3 answers
360 views

How are the originated contract addreses (KT1) computed?

How are smart contract addresses (those that start with KT1) computed? I would like to know whether CHAIN_ID is somehow used in its computation, or it is possible to have two KT1 contracts with ...
Tomáš Zemanovič's user avatar
4 votes
2 answers
204 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 ...
Frank's user avatar
  • 2,632
4 votes
4 answers
969 views

Any way to get the public key of an address?

I am developing a dapp where I need the public key of an address of the user, is it possible to get the public key in the contract (using SmartPy)? Or even on the client side using taquito or any ...
illusion's user avatar
  • 143
4 votes
2 answers
759 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 ...
XTZST2O's user avatar
  • 835
4 votes
1 answer
42 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 ...
pathfinder's user avatar
4 votes
2 answers
152 views

How to store a really long string on the Tezos blockchain

Let's say I wanted to store an entire article or a manifest on the Tezos blockchain. Something that is bigger than 100kB. How would I go about doing that?
Thorkil Værge's user avatar
4 votes
1 answer
513 views

How do I get the storage value of a bigmap using pair datatype as key with taquito library?

I am using the taquito library to interact with a smart contract that I have uploaded to carthagenet. However, I am facing an issue in retrieving the value of a bigmap property in my smart contract ...
Zack's user avatar
  • 55
4 votes
3 answers
523 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 ...
Mikhail Petrov's user avatar
4 votes
1 answer
101 views

Documentation for Serializing Contract Call Data/Parameters

Is there any documentation available for how to serialize contract call parameters? I found good documentation for serialization of general operations and took a look at the tzips but neither seems ...
Felix Laufenberg's user avatar
4 votes
1 answer
65 views

Can someone provide a link to a tutorial on how to do a basic smart contract on the Tezos protocol?

I'm looking for a video tutorial on how to become a programmer/how to become more knowledgeable regarding smart contracts and such. Is there a good you-tuber who blogs about Tezos programming?
Mack Baise's user avatar
4 votes
1 answer
148 views

Calling view of Fa1.2 contract

From my understanding, getBalance, getAllowance, getTotalSupply & getAdministrator entrypoint requires another contract to read the values. How will the entry point of the second contract look ...
Vinnyson's user avatar
  • 515
4 votes
3 answers
177 views

What's wrong with my calculation of fees and burn here?

I am trying to calculate the cost of a transaction, post-hoc, from the response to calling the entrypoint. This is for the purposes of a testing tool I am building that I need accurate costs for. As ...
Grum's user avatar
  • 147
4 votes
1 answer
60 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, ...
camlspotter's user avatar
4 votes
1 answer
50 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 ...
Blindripper's user avatar
  • 2,635
4 votes
1 answer
130 views

Upgradeable Contracts: Proxy Delegate vs Stored Lambdas

There are a number of design patterns for contracts that already exist on Ethereum. For upgradeable contracts, one of them is the use of a Proxy Delegate contract. My understanding is that the Proxy ...
MCH's user avatar
  • 680

1
2 3 4 5
9