8

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 max_operation_data_length and the hard gas limits for operations and blocks (a block contains a set of operations): "max_operation_data_length": 16384, "...


6

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 their properties; SmartML: a virtual machine written in OCaml; Compiler: used to translate contracts from SmartML to Michelson; Python library: facilitates the ...


6

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 saves to be reused later). It is true that both the storage and the parameter can be seen as inputs because they are fed to the contract at the beginning of its ...


5

How to check the proof Currently, the only way to check the proof is to install and run the Coq proof assistant on the manager.tz file. This is automated in the continuous integration script of the Mi-Cho-Coq project so you can see it here. In the future, we plan to use JsCoq to run Mi-Cho-Coq proofs from web browsers. What is proved The family of ...


5

Active accounts For the first question, it depends on what you mean with "active". This term has at least two meanings in the context of Tezos. First, an implicit account (i.e. a Tezos account that is not associated with a smart contract: a regular account that is used to store and transfer tez) is either present or not in the context. The context contains ...


5

As of Taquito release v6.1.0-beta.0 Taquito offers a new API for Maps which support pairs as keys in Maps and BigMaps. Here's a link to documentation & examples on Accessing Map values using Pairs


5

Operations of the following types can affect account balance: transaction revelation origination delegation endorsement seed_nonce_revelation double_endorsement_evidence double_baking_evidence activate_account However, there are three additional things which affect account balance as well: When you bake a block. When you miss seed_nonce_revelation. When ...


5

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 transaction. An entry point gets the current contract storage value and returns an updated storage value. If the operation fails for any reason, a new storage value is ...


4

No, you do not need to specify the type of the keys of values. Instead, without needing the declare the map, you simply use it and the types are inferred. To construct a mapping called m, use m = sp.map(...). To access element k, write m[k]. For an example, refer to the FA1.2 template in the SmartPy online IDE.


4

The tezos-client and tezos-node RPC have no such feature. If you don't mind using an API other then the node RPC you can find this in the new version of the tzstats indexer (GET /explorer/contract/{hash} returns an object with a key bigmap_ids which is an array) see https://api.babylonnet.tzstats.com/explorer/contract/KT1E5toJrALhVPuKpHWTbRVjgEvWWR98sVKj ...


4

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 need to provide not the readable key you stored, but a hash of that key as that is how it is represented internally. This answer describes how to call the RPC The ...


4

Here is the preview version of truffle tools for working with smart contacts in Tezos: https://www.trufflesuite.com:8443/docs/tezos/truffle/quickstart


4

The contract you point to takes a single parameter of type address. Thus, as you write, it only has the default entrypoint. In taquito, the main entry point can be call through contract.methods.main. So your call should be: contract.methods.main(contractAddress).send()


4

You have to do it manually... Here's one approach for compute log(x) assuming you are representing x as a fraction find integer m through binary search such that 2^m <= x < 2^(m+1) (m may be negative) let m' = m + (1 if |x/2^(m+1)-1| < |x/2^m-1| else 0) (the closests of m or m+1) let x' = x / 2^m', note that |x'-1| < 1/3 and log(x) = log(2^m' x'...


4

Your understanding is quite correct. SmartPy is a Python library, not a Python-inspired language so we use Python everywhere and overload Python's constructions. This approach is called meta-programming and is extremely important for bigger templates. Control operators such as if, for, while cannot be overloaded in Python. So we have our own pure-python ones ...


4

You have access to a "time" with sp.now so you can compute conditions, etc. There is nothing like "send in 30 minutes". You need external input to trigger operations Tezos. You can compute with timestamps and forbid some actions for a period. Deducting the balance to the sender means sending the amount to the contract. Recipient will not ...


4

In the documentation on https://tezos.gitlab.io you will find: https://tezos.gitlab.io/introduction/howtouse.html: a description of what Tezos does at a high level under the form of an introductory tutorial targetted at new Tezos users. In https://tezos.gitlab.io/whitedoc/the_big_picture.html: the organisation of the code base. In the rest of the "...


3

Contratry to my initial answer, as FFF pointed out, the problem is that an entrypoint in SmartPy cannot return a value to the calling contract, nor in the underlying Michelson language. The typical solution is based on continuation-passing style. The idea is that the calling contract also provides a call back, in the form of an contract. The parameter type ...


3

I cannot answer all your questions but at least, I can say that, in SmartPy.io, the storage sent to ConseilJS is the content of the tab "Storage" (in either Michelson or Micheline formats) and the code is similarly the content of one of the corresponding tabs. Depending on the form you're using, you need to set Michelson or Micheline (the latter is quite ...


3

The SmartPy contract explorer allows you to see all the entry point of a given contract in any of the networks (main and test) along with autogenerated forms to interact with all those entrypoints. Example: https://smartpy.io/test2/explore.html?address=KT1APXAZKofAtPsxFKPLbjMJohe1rXaGJoYc


3

To find all the entrypoints and their types using tezos-client you can use the following command: tezos-client get contract entrypoints for <src> To check a specific entrypoint you can also use: tezos-client get contract entrypoint type of <entrypoint> for <src> You can find more about available commands in the official documentation.


3

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 (:storage,%candidates and %voters) can be ignored. As you can see, the type of the storage is a pair of values: the map of candidates and the map of voters. ...


3

The problem is with the storage annotation (%storedValue), if you remove it, everything works. In the storage section, field annotations (starting with %) are allowed in components of pair types, option types and or types.


3

There is no formula that will give you the full cost and gas usage of smart contract invocation. The best method is to simulate. Contract code size and storage directly affects costs through storage burn. Parameter size indirectly affect fees through gas size. See: Here for an overview on different fees and burns in Tezos. Here for a more detailed ...


3

You need to provide an initial storage value for your contract. You can write it in Ligo and compile it too using the ligo compile-storage command.


3

Tezos is an account based system and not a utxo one like bitcoin. All base transactions originates from one single account at a time so what you are asking is not possible without usage of a smart contract. Just like it is not possible to do in other popular account based systems like Ethereum eg https://ethereum.stackexchange.com/questions/64139/transfer-...


3

There is https://tezos.gitlab.io/whitedoc/micheline.html#binary-serialization which mostly tells to run tezos-codec describe alpha.script.expr binary schema for a complete description of the binary encoding. More details are given here.


3

You should type the Big_map.empty. For instance (I do not know the type of your big map): (Big_map.empty : (nat , token) big_map)


3

I am unsure how to interpret params.target, so i modified getBalance by adding an entrypoint and address @sp.entry_point def getBalance(self, params): sp.transfer(sp.as_nat(self.data.balances[params.arg.owner].balance), sp.tez(0), sp.contract(sp.TNat, params.contractAddress , entry_point = "viewBalance").open_some()) Here is my view ...


3

I have a contract for binary log that uses few multiplications and can be adjusted for any fixed point precision: https://github.com/Sophia-Gold/michelson/blob/master/log2fix.tz. I don't think it can be written in SmartPy because last I checked it lacks shifts. Depending on your needs you could use this with change of base or Arthur's method.


Only top voted, non community-wiki answers of a minimum length are eligible