Tezos smart contract explorer Better Call Dev 2: what’s new

Better Call Dev 2 - Tezos smart contract explorer with own blockchain indexer, an advanced queries to contract code, storage, and operations data and login with social accounts

Michael   Follow

A few weeks ago we released the beta version of Better Call Dev 2 — a successor of our Tezos smart contract explorer. We are still working on some features, nevertheless, we decided to go public in order to gather more feedback and catch as many bugs as possible before switching to the main domain.

What will happen with the old version

  • All links to the old version will be correctly processed by the BCD2;
  • The previous version will continue operating on GitHub pages;
  • However, it won’t be maintained and will likely be broken by one of the upcoming protocol changes.

What is fundamentally different in the new version

  • Everything has been rewritten from scratch and a backend has been added;
  • BCD2 has its own indexer specialized on contracts and contract calls (not general-purpose);
  • BCD2 is powered by Elasticsearch engine and thus allows making advanced queries to contract code, storage, and operations data;
  • Personalized features will be available to users authenticated via social accounts.

# Various improvements and bugfixes

Let’s start with the functionality ported from the previous version, and what has been improved.

# Pick random

Our “I’m feeling lucky” button now redirects you to truly random contracts, not to one from a predefined list. Moreover, it is available in the control panel on the left, whatever tab you are at. It was and remains a perfect way to surf in the Tezos dApp space.

# Operations tab

Firstly, we put the basic information about the operation in the header and do not expand the details of the first operation when loading the page. This allows saving a lot of space and gives an overview of the activity. Secondly, we increased the number of operations per page and added endless scrolling.
Operation summary and color coding make it easy to spot the needed event and make the first conclusions even without expanding the details.

# Mempool

Good news! BCD now displays pending and refused operations from the mempool, the same way TzKT does.

# Operation filters

in addition to the compact operation headers, we added filtering by entrypoint, by status, and by date (or period of time). Note, that the list of possible statuses is extended with mempool-specific values: pending, lost, refused and branch_refused.

# Operation details

We slightly improved the display of operation details, and also added a new field “burned” which indicates how much coins were destructed due to storage size change or new account allocation. And another feature is taken from TzKT — raw RPC viewer, an irreplaceable tool for debugging.

# Value inspector

Sometimes operation parameters or storage differences are so large that they do not fit on the screen. Or, for example, you want to copy a string or address. Especially for this, we added a value inspector — just click on some node of the tree view.

# Blind unpacking

Sometimes developers have to store data in a packed form, and it could even be fragments of code. We are trying to unpack everything that can be unpacked, and display it in a human-readable form.

# Code tab

The tab with the code has also undergone changes, now the source is canonically formatted, highlighted, it is possible to download the code as a .tz file, as well as run the contract in the Michelson sandbox by Nomadic Labs.
For contracts written in smartpy a link to SmartPy explorer is displayed.

There is also an opportunity to unexpand macros in order to make the code even more readable. The feature is currently disabled due to a lack of optimization but will be brought online in a few.

# Storage tab

On the storage tab, we added the ability to switch between tree view and Micheline. Also, you can copy Micheline expression without line breaks and indents, e.g. for passing to tezos-client, or to try-michelson playground.

# Brand new features

# Single network space

You may have already noticed that we view contracts from different networks without switching between them, as is usually the case in blockchain explorers. This is one of the cornerstones of the BCD2, a single network space. It allows you to manage all your deployments in one place. Moreover, a self-hosted version of BCD can be attached to an arbitrary number of local sandbox nets.

As was mentioned above, BCD2 is powered by Elasticsearch thus we can do a full-text search by contracts, operations, and big maps (coming soon). Instant search is available as soon as you open the main page. You can paste a whole address or operation group hash, or search by word or even part of a word.

Here is a list of data sources used in the search:

  • Contracts:
    - alias (known contract names)
    - tags (derived from the code)
    - entrypoints
    - fail strings (error messages)
    - high-level language (determined by heuristics)
    - annotations
    - delegate (if delegated)
    - hardcoded addresses (if any)
    - deployer
    - contract address (search by symbols)
  • Operations:
    - entrypoint
    - error message (if failed)
    - error id (if failed)
    - operation hash (search by symbols)
    - parameters (coming soon)
    - resulting storage (coming soon)
  • Big Maps (coming soon)

You can access instant search wherever you are — it’s hidden behind the magnifier icon.

If there are no results, or you cannot find what you want — press “Enter” and try the advanced search.

Advanced search provides more details about every item found, also you can load all the results with the endless scroll. It is quite difficult to distinguish one contract from another in the search results, so we tried to put the most expressive and meaningful signs on the result card.

On the toolbar, you can choose which index to use for searching, or search in all places. In addition, you can filter results by time, network, and contract language. We will likely add more options in the future.

# Сontract aggregation and diffs

You may notice tabs under the names “same” and “similar” on the contract page, also the number of “same” contracts is displayed in the advanced search results. We call contracts the same if they share the same code.

We call contracts similar if out trained ML model told us so (we will explain how it works in a separate article). Basically, we are trying to put together different versions of one project (dApp). So far, it works well enough, but there are many false-positive cases, and we will continue to improve accuracy.

For greater clarity, we added the ability to view changes between different versions in the familiar side-by-side view.

# This is just the beginning!

This is far from a complete list of functionality: a part is in testing, a part is still in development. Among others, we will soon introduce the following features:

  • Code migrations
    Did you know that the contract code can be changed? The migration tab will show all the events when the code logic was altered.
  • Big Map viewer
  • Search operations by parameters and storage
  • Search Big Map entries by key and value
  • List of all projects (potential dApps)
    In the current context project is a group of contracts sharing similar or the same code. Such a list allows you to drop duplicates and different versions of one project and accordingly shows a more realistic picture.
  • Developer dashboard
    Once you log in, you can manage subscriptions to contracts (similar to “watch” in GitHub), view the events feed for your subscriptions, as well as recommendations.

# Self-hosted version

Good news for contract developers — soon it will be possible to spin up a local instance of BCD2 and set which networks you want to index, including an arbitrary number of sandbox nets.

# Stay tuned

Track our progress on GitHub, get the latest updates on our Twitter channel, and take care!

Yours, Baking Bad team