Unlock the power of Michelson maps with Taquito

Image for post
Image for post
Illustration from Pixabay

One of the most attractive features of smart contracts is the possibility to store a substantial amount of data into them that can then be used in the contract code. Although Michelson provides different structures to store data, the object of this article is going to be its maps. Maps are hash tables that contain key/value pairs, which means that when you want to find a value in a map, you search for its key. This allows you to store complex data that can be referenced with a single word or number or even more complex data like a pair!

Unlike big maps, all the values in a map are deserialized, which allows developers to have access to all of them at once. …


How to use Taquito Batch API to send multiple transactions under the same hash

Image for post
Image for post

One of the friction points you will encounter when you start developing more complex dapps for your smart contracts happens when creating multiple new transactions in a row. Each Tezos account holds a counter that increments every time an operation is included in a block on the network. This means that you cannot forge a new transaction if you already have a pending transaction or you will get the now infamous error message Counter 12345 already used for contract tz1...

There are different scenarios when you want to send multiple transactions at the same time: for example, you could hold in your dapp every update request from your users before asking them to confirm them and emit them all at once. Taquito created the Batch API to make the process easier. …


How to be sure your Ligo code compiles to the Michelson code you want

Image for post
Image for post
Michelson code

Ligo is a fantastic tool that makes working with Tezos smart contracts a lot easier. However, its ease of use means that the compiler takes care of the heavy lifting for you and may compile your code down to a format you may not want. This becomes particularly important with TZIP standards: these standards establish fixed Michelson structures that could make your code useless if you don’t respect them. Here is a very simple example:

Imagine you have a record in Ligo like this one:

let my_record = {
owner: "tz1...";
balance: 100n;
name: "John Smith"…

A quick tutorial on how to add extra features to an FA2 contract

Image for post
Image for post
Image from Pixabay

I decided to work on a little project during the weekend and try the updated version of the contracts offered by TQ Tezos. These contracts implement the basic features of an FA2 contract according to the TZIP-12 standard. So I made some coffee, opened VSCode and started diving into the code written in CameLigo (the whole thing being made a lot easier now with the new VSCode extension from Ligo that allows syntax highlighting within the editor). While I was reading it, I thought it could be interesting to document the thought process and the different steps involved in extending an FA2 contract or even any contract written with Ligo for that matter. …


Connect to the Harbinger oracle with Ligo to get exchange rates on-chain

Image for post
Image for post
Image by Christian Hardi from Pixabay

It is incredible to see how far the Tezos blockchain has gone in just 6 months: at the beginning of 2020, TezBridge was the only wallet around and the possibilities of dapps on Tezos were very limited. Now, in the fall of 2020, we have Thanos, a better and more elegant wallet to interact with dapps and we have oracles! Oracles are a game-changer as they allow smart contracts to have access to live data. …


Take your Michelson skills to the next level with a more complex project

Image for post
Image for post
Image from Pixabay

Part 1 is available here.

In Part 1, we had an overview of the TZIP-7 proposal, we set up our project in the Jupyter notebooks and we checked the structure of the parameter and the storage for our FA1.2 token.

In Part 2, we explore the code for the %transfer entrypoint. It is an important piece of the contract (and the longest one) as it allows or restricts transfers.

Now let’s dive into the code 👨‍💻

The transfer entrypoint

In general, what I like to do at the very beginning, is unwrapping the structure laid down by the parameter. Because the parameter is made of nested union values, there will be some logic switches to implement the entrypoints of the contract. …


Take your Michelson skills to the next level with a more complex project

Image for post
Image for post
Image from Pixabay

In the last tutorial about Michelson programming language (the miniTez token), we created a simple token that was just transferring an amount of tokens from one account to another with minimal verifications.

The need for standardizing token interactions on Tezos has driven the community to create token standards that indicate how the tokens behave and how they can be interacted with. This has been the goal of the TZIP-7 proposal. After reading the miniTez tutorial, it should be very easy for you to understand what the TZIP-7 proposal adds to basic token transfer. …


Learn Michelson and token contract best practice by building your own token!

Image for post
Image for post
Image by Tim C. Gundert from Pixabay

Everyone on Tezos speaks about tokens! The different proposals, like the TZIP7 and more recently the TZIP12, allow the creation of complex tokens on the Tezos blockchain. Reading the proposals for less tech-savvy readers can be a little overwhelming as they are full of technical terms and references to Michelson. They are also based on common features tokens developed for blockchains present, may it be for Ethereum or Tezos.

Sometimes, the best way to understand how something works is just to build it yourself! This is the goal of this article, we are going to build miniTez, a minimalistic token for the Tezos blockchain. The token does only one thing: it transfers value from one user to another (a little bit like what Bitcoin does). Transferring value is at the core of tokens use and it is a fundamental mechanism to understand. …


Use two of the hottest techs in Tezos development to build a dapp

Image for post
Image for post
Background Vectors by Vecteezy

The landscape of dapp development on Tezos has evolved a lot these last six months. It went from a painful and long endeavour to a walk in the park. This change has been possible thanks to the introduction of powerful tools that allow developers to focus on providing value and functionalities to their dapps and to forget about the technicalities of plugging their dapp to the blockchain.

Taquito doesn’t need any introduction, it is the de-facto tool to connect your Tezos dapp to the blockchain. But don’t let its monopoly position lure you, it is an amazing tool and will make your job as a developer 100 times faster and easier. With a few lines of code, your dapp will be set up and connected to the blockchain and your smart contract. …


Learn how to use the Michelson programming language and write smart contracts on Tezos

Image for post
Image for post
Source: Pixabay

(Please check first Part 1 and Part 2)

In this new installment of our series about Michelson language, we are going to crank it up a notch!

In the last parts, we were having a quite simple stack and doing some basic manipulations, adding elements, removing them, duplicating them, etc. However, one of the powers of smart contracts is access-control: you can request your smart contract to verify if the person sending a request is allowed to modify the storage. If they are allowed, they can continue performing their operation. …

About

Claude Barde

Traveler, translator and self-taught programmer; writing about the Tezos blockchain

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store