7 minutes
Feb 1st, 2023 - 11:13 am
Etherscan is a popular blockchain explorer that allows users to view and search the Ethereum blockchain. It provides a wide range of information and tools for users, including the ability to view transactions, lookup addresses, and interact with smart contracts. In this article we will cover:
A common scenario is wanting to see the status of a pending transaction to check if it has been included in a block, or whether you need to speed it up. Here’s how to check:
From MetaMask or your wallet of choice, click the pending transaction and copy its transaction hash (MetaMask calls this the “transaction ID”). Then navigate to Etherscan.io, input the transaction hash into the search bar and hit enter. (Alternatively in MetaMask, you can simply hit “view on block explorer”). You can now see the transaction. Here’s what the fields mean:
Field | Definition |
Status | Status denotes the status of the transaction. It will always be one of the following:
|
Transaction Hash | This is the unique hex string that identifies the transaction. |
Block Number | This is the block number that the transaction was included in. |
Date/Time | This is the date and time that the transaction was processed by the Ethereum network (or in the case of a pending transaction, when the transaction was last seen in the mempool). |
To/From Addresses | These are the address sending the transaction (from) and the receiving address/contract being called (to). |
Value | This is the amount of Ether transferred in the transaction. |
Txn Fee | This is the amount of Ether that was spent on gas to process the transaction. |
Input Data | This is the data that was included in the transaction (for sending to a contract, this field instructs which function you are calling and the arguments of said function). |
There is a handy gas tracker here which can show us the estimated time until the transaction is included in a block: here we can see it is over an hour, and so if we want to have it confirmed quicker we should speed it up (Metamask How To: Speed up a transaction)!
You can also use Etherscan to view the balance and transaction history of any Ethereum address. There are two types of Ethereum addresses, Contract (NFTs, tokens, multisig vaults like Gnosis, etc.) and EOA (Externally Owned Address, otherwise known as wallet addresses), and they each display in Etherscan a bit differently. To search, simply enter the address (or ENS name) into the search bar on the homepage, and you will be taken to a page displaying the address details, including the balance, transaction history, and any smart contracts associated with the address.
On the address page you can view the following info:
You can also filter the transactions by date, block number, address to/from, and method using the filter buttons on the columns. The menu above “txn fee” allows you to filter by failed/pending transactions as well as incoming/outgoing transactions.
Smart contracts can be viewed the same way as above, but have some additional features compared to regular EOAs (externally owned addresses):
For a tutorial of how to interact with a contract on Etherscan, see the embed below:
For tokens, we can view a page which gives details like token transfers, social media accounts, holders and more.
Navigate to the token tracker page by entering the token’s contract address in the Etherscan search bar, same as for looking up addresses. Then click the link under “token tracker” if you are brought to the address rather than the token page.
We can now view the:
For NFTs, the “NFT Trades” will show a list of sales on supported marketplaces. For ERC20 tokens, the “DEX Trades” tab will show recent buys/sells on supported DEXs (Uniswap etc). ERC20s also have a chart tab which will allow you to see the buys/sells of specific DEXs on a tradingview widget which can let you analyse price action.
So now that you know a lot of the basics, one of the best use cases from a security perspective is to vet what you interact with. Whenever you are making a transaction, you're likely interacting with a contract. But how do you know if that contract is legit, or the correct contract? Well, once you determine its legitimacy, you shouldn't have to keep doing it with that same contract! Something that we stress in our 101 course is to utilize Metamask Bookmarks for contracts for two main reasons:
But before we add something to our bookmarks, we should first examine and scrutinize it on Etherscan (and potentially other places as well as part of your DYOR routine), here are some things that etherscan vets and surfaces to its users that add to my confidence level in that I am actually interacting with a real and reputable contract:
Note: It is important to know that token names in Etherscan are NOT verified just because they are listed on Etherscan. Anyone can deploy a token name and have it be anything they want.
Etherscan also provides network-wide statistics, such as the total number of transactions, the total number of addresses, and the total amount of Ether in circulation, viewable on the Etherscan homepage. Some of these include:
However, there is one very important statistic you should be familiar with, gas price. You can think of the current gas price as the current demand for blockspace i.e. the price people are willing to pay to have their transactions processed. Looking at our pending transaction at the start of the article, we can figure out exactly how much we need to pay to get our transaction processed in a timely manner by visiting etherscan.io/gastracker, where gas prices and their current times to confirm are listed. Another handy site to dive into gas usage on the network is UltraSound Money. Use this site to see anything from which contracts are using the most gas, the ETH inflation/deflation rate statistics, ETH staking stats, and more!
Hopefully this gives you an insight into the different features Etherscan offers, and how they might be utilised. If you want to learn more about it, we do a dive and some hands-on exercises in the Boring Security 102 class, which will net you this NFT as well! Etherscan also has a pretty extensive knowledge base, and many answers to your questions can be found simply by typing it in the search bar found on the site!
Disclaimer: Though there has been little reason to doubt what etherscan shows in the past, Etherscan is a 3rd party service, and its employees are not immune to social engineering or potential bribery, so interact with caution. You can always reference information with other blockchain explorers (e.g. Blockchair) to get a second source just in case or if etherscan is down!
Have any questions or want to learn more about web3 security and stay up to date on the most current security information, scams, and tactics? Join us in our discord at https://discord.gg/boringsecurity .