As in the articles prior to this, we learned the basics of Tezos blockchain and about writing a smart contract. Moving further, in this article you’ll be deploying and exploring smart contracts on the Tezos blockchain. Furthermore, in the last two articles, you learned about:
- Introduction to Tezos
- Tezos Development tools
- Writing Smart Contracts using SmartPy
Further in this article, you will learn to set up a wallet, deploy and explore smart contracts.
This is the 3rd part of our series on Tezos. Read our earlier articles which are Introduction to Tezos and Smart Contract SmartPy for more information on the subject.
Table of Contents
What is a Temple wallet?
Before deploying your smart contract, you will need a wallet to handle transactions on the Tezos blockchain. Here you will learn to set up Temple Wallet.
Temple Wallet is an open-source and easy-to-use browser extension wallet for interacting with the Tezos Ecosystem. You can use it to handle transactions for your Tezos DApp’s. It supports all FA1.2 and FA2 tokens. You can also create multiple accounts on Temple wallet and it also has a feature for token delegation to bakers.
How to Install Temple wallet?
- Install temple wallet by clicking here.
- Select your browser and add the temple wallet extension
- Once installed, create an account by clicking on the top right corner.
- New accounts will have 0 balance. Ping @tezos_faucet_bot on Telegram to get free tez on the testnets.
To know more about temple wallet, go to Temple wallet.
Originating smart contract
Follow the steps below to deploy a smart contract:
- Before deploying your contract, run your contract to test your test cases. If everything works fine, then click on Deploy Michelson Contract on the right.
- You will be directed to the origination page. Select the network and nodes and then connect with the temple wallet.
- Click on Estimate cost from RPC to estimate storage and gas limit.
- Accept the Pre Signature Information and sign the payload.
- Once everything looks good, you can deploy your contract.
- If everything works fine, you will see this. Click on Open Explorer to explore the smart contract.
Blockchain Explorers
Blockchain explorers or block explorers are like a search engine on the blockchain which is used to track any activity on the blockchain. Its use cases are different for various users out of which some are mentioned below:
- DApp developers can use it as a debugging tool to observe the state of their contract running on testnets.
- Users of smart contracts can view Michelson code, storage, and history.
- Normal users check if their coins are safe.
- Blockchain engineers use it to debug new features on a test network.
Block explorer consists of:
- An indexer – It is a node operator that extracts on-chain data and stores it into the database.
- An API – It queries the database.
- A Frontend – It displays the data
Available Tezos Explorers
In this lesson you will be interacting with your smart contract using:
- Better Call Dev (BCD) – BCD is a Tezos explorer where you can explore DApps, search for your smart contract using your contract’s address and it gives you complete details about your contract.
- SmartPy Explorer – On SmartPy Explorer, you can enter your contract’s address and then interact with your contract using operation builder. You can find more explorers here.
Interacting with Smart contracts
Now, you will interact with your smart contract using BCD and SmartPy Explorer that you had deployed.
SmartPy Explorer
Go to SmartPy Explorer and enter the contract address starting with KT generated when you deployed your contract. It will search for your contract and display its details like Node, Contract Data, and Storage.
- You can interact with the contract using Operation Builder.
- Select the entry point you want to call, enter the parameters, and hit the Build Transaction button.
- Connect with the Temple wallet before sending the transaction.
- Click on Send Transaction button.
- Once the transaction is completed, refresh the page to see the storage.
Better Call Dev
Go to BCD and search for your contract using its contracts address. Once you have opened the contract, you can do the following here:
- View the Operations history
- Contract’s Michelson code viewing
- Interact with contract
For interacting with the contract, go to the Interact tab, select the entry point that you want to call from the right and fill in the details and execute. Before executing the final transaction, click on simulate to test if everything works fine or not. Once it all looks good, select Temple wallet to execute the final transaction.
- View contract storage
To view your contract’s updated storage, go to Storage Tab on top. Here you can view your contract state.
This was the third article in the series of four articles listed below:
- Introduction to Tezos blockchain and Tezos developer tools
- Writing smart contract using SmartPy
- Deploying and exploring smart contract
- Integrating with frontend
Since, now you have got a basic understanding of what is tezos, writing smart contracts using SmartPy, deploying and exploring smart contracts, in the next part you will be learning to integrate your smart contract with the frontend.