Hot answers tagged

9

In response to question 4: Reuse and modularity We discuss reuse and modularity, of which inheritance is one of many mechanisms: Michelson has no mechanism for code reuse, except for calling existing "library" contracts directly. As far as I understand, Archetype includes no user-extendable mechanisms for code reuse. Actions (akin to methods) ...


6

Here is a complement to Arvid's answer regarding Archetype: Reuse and modularity Indeed Archetype's extensions are reusable codes to add features to a contract. For example, using the 'transferable' extension on a role adds to the contract the necessary actions (ie entry points) to transfer the role to another address. For example, invoking the '...


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


4

With respect to question 3, following @ezy remark, SmartPy has some inlining capabilities including with new opcodes as shown in the Inline Michelson template (of the new version, currently https://SmartPy.io/dev). It's accessible here: https://smartpy.io/dev/index.html?template=inlineMichelson.py. import smartpy_michelson as mi ... @sp.entry_point ...


4

Do Archetype/Ligo provide everything that Michelson can currently do, or are there limitations with either? I think if something is possible in Michelson and not in Ligo, it is probably a bug worth reporting, the Ligo devs usually quickly answer these kinds of issues. Archetype however is purposely not Turing complete and in particular you cannot do ...


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


3

In your example, you send a transaction that calls the increment entry point of the contract. For that to happen, the transaction will have to be included in a block and, as you mention, blocks come about every minute. However, a single block could contain many such transactions and, as a result, the counter could be incremented by more than one during the ...


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)


2

Here is the corrected version of createArtwork: let createArtwork (store, id, ihash : artwork_storage * artworkId * ipfsHash) : artwork_storage = Map.update (id : artworkId) (Some ({ artist = Tezos.self_address; owner = Tezos.self_address; ipfsArtworkAddress = ihash; } : artwork)) store You had switched place on the actual record and the ...


2

Here's the parameter values to initialize storage for the fa1.2 contract. It is working well on my side. If you want to more look at pascaligo syntax, you can visit ligolang doc pages on https://ligolang.org/docs/language-basics/maps-records and https://ligolang.org/docs/tutorials/get-started/tezos-taco-shop-smart-contract/#populating-our-storage-in-a-dry-...


1

Yes, you can, using exactly the same syntax. For instance, in CameLIGO, you could write let x = Bytes.pack "toto\n\x53woo".


1

In LIGO entrypoint name corresponds to your router enum value types, not function names. So "Transfer" should start with uppercase letter. In you case you should call it as follows: Tezos.get_entrypoint_opt("%Transfer", s.tokenAddress)


1

If nobody gets back to you soon you can always contact the Ligo team directly on Telegram at: https://t.me/LigoLang You can also find them on Twitter at: https://twitter.com/ligolang And can file an issue if necessary at: https://gitlab.com/ligolang/ligo/issues


1

As far as I know, you have to create the default storage for your contract when you deploy it and that's when you will instantiate your storage (and your empty map), so I don't think it is necessary to instantiate it in the contract. Did you try to compile the contract with the instantiated empty map? I use ReasonLigo more than PascalLigo, but the docs ...


1

You could use Tezster-CLI for setting up local environment and use Tezster-Bundle to develop,deploy and test your contracts. Tezster-CLI: https://github.com/Tezsure/Tezster-CLI Tezster-Bundle: https://github.com/Tezsure/Bundle-react


1

Use the function failwith with a string argument describing the error, and cast it to the desired type if necessary (for example, if you are in an expression), like so: failwith ("My error"); or (failwith ("My error") : my_expected_type) Note the parentheses around the string, as failwith is a function, not a keyword.


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