# Tag Info

Accepted

### Reentrancy attack vector on tezos smart contracts?

Michelson (and higher level language like Liquidity on top of it) does not allow a smart contract to call another smart contract without commmitting its state/storage first. It makes reentrancy ...
• 3,308

### Storage and parameter size limitations of smart contract?

1. Maximum parameter size per transaction The maximum number of bytes per transaction for a single transaction is limited several constants, in particular an upper size of for operations ...
• 2,378
Accepted

### How can I write tests for my smart contracts?

There are several test frameworks coming for Tezos. Ours (Techelson) can be used both from Michelson and from Liquidity. It should be released soon. (I will update this answer when it is released)
• 3,308

### 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 ...
• 3,308
Accepted

### Spending XTZ held in an implicit account from a smart contract

No, a contract can only spend its own funds.
• 4,599
Accepted

### Michelson Logic understanding problem

We can simulate the program in the following way. We write the stack between [...] and then the operations. We use three different operations push <int>, * and +. push puts an integer at the ...
• 3,250

### How to upgrade a smart contract?

Disclaimer: This is just an example for educational purposes, don't use it in production. Here is a fairly primitive upgradable design for a Liquidity smart contract: Proxy Contract Holds the state ...

### Michelson Logic understanding problem

'*' and '+', in this context, are not the infix operators you are used to. Imagine reading left to right and stacking up the numbers as you go. When you encounter + or * you replace the top two ...
• 4,599

### Benefits of Michelson

The main benefits of Michelson are the guarrantees that it gives on the execution of a smart contract : static typing catches many errors, and the semantics is clearly defined, so you have no surprise ...
• 3,308
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 ...
• 332
Accepted

### How to upgrade a smart contract?

Because values of type lambda can be kept in storage or passed as parameters (either as lambda or as bytes to be UNPACKed), it is possible to write contracts which can upgrade themselves... This won't ...
• 2,506

### How are the originated contract addreses (KT1) computed?

In case someone needs precise calculations. Say, you have an operation group hash onvsLP3JFZia2mzZKWaFuFkWg2L5p3BDUhzh5Kr6CiDDN3rtQ1D and an origination index 0 which is increased for every ...
• 1,173
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.

### Formal verification of Tezos smart contracts

So this is a huge question and I think there are many people more qualified than me, but I'll offer some initial guidance. In Software Foundations, a book on Coq, they talk about an implied language ...
• 576
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 ...
• 332
Accepted

### 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? Like in all open blockchain systems, you ...
• 656

### Is there a Tezos equivalent of ERC?

Martin Pospěch drafted an Tezos "ICO token" standard at https://gitlab.com/tips2/TIPs/blob/master/TIPS/tip-7.md Stephen Andrews is working on a tztoken at http://tztoken.teztech.io/ OcamlPro has a ...
Accepted

### How to extract the storage of a smart contract?

In the command line ./tezos-client get contract storage for KT1BRudFZEXLYANgmZTka1xCDN5nWTMWY7SZ You could also just call the RPC curl http://localhost:8732/chains/main/blocks/head/context/...
• 4,599

### How are the originated contract addreses (KT1) computed?

KT1 addresses are computed from origination nonce. The origination nonce is made of operation hash (the operation that creates the origination) and its index (the index starts from 0 and it gets ...
Accepted

### Michelson: Parameter vs Storage

The difference is very simple :) The parameter is made of data that are sent to the contract with a transaction while the storage holds the state of the contract (i.e all the data that the contract ...
• 906
Accepted

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

Michelson doesn't support multiple entry points right now. Liquidity uses unions (or type variables) to make up for this. A union has a Left and Right side, but can also be nested. Let's analyse the ...
• 3,351
Accepted

### Formal verification of Tezos smart contracts

If we agree that the purpose of analyses is to both prove properties and help users of smart contracts to understand them, I would say: Values: studying what values each element of the storage can ...
• 3,250
Accepted

### Benefits of Michelson

Michelson lets you write concise contracts using high level primitives (like maps, sets) without departing from Tezos' native VM. That means you don't have to trust your contract to the output of a ...
• 4,599
Accepted

### What does it cost to make a contract through Tezos?

Contract origination incurs standard transaction fees (see here). One thing to note is that the storage cost is 0.001 tez per byte of data being stored on-chain (which includes the size of your ...
• 3,351
Accepted

### How to retrieve data from smart-contract using javascript?

As of the current Babylon protocol and the upcoming Carthage, the RPC only provides you the ability to retrieve the value for a known key that you provide to the RPC. But even in this scenario you ...
• 1,999

### 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 ...
Accepted

### Batching Transactions FA2

Other transactions will fail automatically and the contract will revert to the previous storage state automatically. By design, any invocation of the Tezos smart contract works as an atomic ...
Accepted

### Can a smart contract know its own address?

Yes, Michelson provides the following instruction SELF_ADDRESS In SmartPy you can use sp.self_address
• 3,923
Accepted

### How can I deploy a Michelson smart contract?

Read the documentation of: tezos-client -A mainnet-node.tzscan.io originate contract It says: tezos-client originate contract <new> for <mgr> transferring <qty> from <src> ...
• 3,308