As a developer, you will often want to check the state of your deployed smart contracts. Using a blockchain explorer is a fast and easy way to do so. In this section, we will find a smart contract and check it out on TzStats.
Once you have the address of your smart contract, go to the TzStats website associated with the network you deployed your contract on.
Remember, the following TzStats website link are the following:
- Mainnet: tzstats.com
- Delphinet: delphi.tzstats.com
- Edonet: edo.tzstats.com
- Florencenet: florence.tzstats.com
Copy/paste your address in the search bar:
TzStats then shows a page with information related to your smart contract, e.g. the balance of the contract, the amounts sent and received, the creator address, etc.
Below the general information, you have a list of tabs allowing you to see:
- the calls
- the entry points
- the contract code
- the storage
- the different big maps of your smart contract (if there are any)
For the following examples, we will check out the smart contract, deployed on the Mainnet, whose address is the following:
Available at this link.
Here you have the history of all transactions related to your smart contract.
- The transactions with the amount and the address of the sender.
- The calls made to the entrypoints with the name of the entrypoint in question.
- On the right the status of the block with the number of confirmation received.
Here you have a list of all your entrypoints and their parameters. Furthermore, you can see how many calls each entrypoint has received.
Here you have the michelson code of your smart contract.
Here you have access to the content of your storage with the type of each variable and its current value. Notice that the content excludes big maps as they are specific tabs for them.
Here you have the content of your bigmap.
The same pieces of information can be retrieved by API calls, without using the frontend. A full documentation is available here.
The following API endpoints are the following:
- Mainnet: https://api.tzstats.com
- Mainnet Staging: https://api.staging.tzstats.com
- Edonet: https://api.edo.tzstats.com
- Florencenet: https://api.florence.tzstats.com
First, let's get the contract information. The "explorer" endpoints will be used (full reference here).
In this example, one of the contracts has been deployed on the Mainnet to
Let's retrieve the contract details:
The pieces of information do match those from the web interface: address, creator, first_seen_time, last_seen_time...
The call to the entrypoints "swap" can be seen in the
call_stats field: 3366 calls have indeed been made to this entrypoint.
More details can be fetched about those calls:
It details the inputs used for this entrypoint, the storage after the call, the differences in the big map that have changed after the call...
The current storage can be fetched, with this endpoint:
The storage returned by the API does match the one displayed in the web interface.
swaps big map holds a big map id, instead of the values.
Indeed, a big map is meant to hold unbounded data size: thus, fetching the storage could quickly become expensive, if the big maps hold a lot of values.
The values of a big map have to be retrieved from a separate endpoint, thanks to its id (
6072 in this case):
All of the pieces of information displayed in the web interface can be retrieved from the API. All these API calls can of course be made by any libraries, and thus can be automated in any program.
tzstats.com is extremely useful to monitor what is going-on on the mainnet and public testnets. All the pieces of information regarding the cycles, the blocks, the transactions, the smarts contracts... can quickly be found, thanks to a user-friendly interface.
In addition, TzStats provides a complete and free REST API (for non-commercial use), without any authentication or enforcement of rate limits (as long as it remains reasonable). See the introduction of the Tzstats API.
Those calls can be performed by any library: the pieces of information retrieved about a public Tezos network can be used in another monitoring tool, or even in Dapps.
Indeed, API calls can be used within Dapps to retrieve those kinds of information. For instance, taquito (a typescript library to interact with a tezos node) is not able to retrieve the keys of a big map with a simple call. A call to the TzStats API solves this issue.
Those tools are also available for private networks. This will be detailed in the next chapter, where a private TzStats is set up to monitor a private network.