Etherscan is a very useful tool that anyone using the Ethereum network should know how to use, but many don’t and that puts them at a disadvantage. This post shows you the basics of using Etherscan — from exploring your Ethereum wallet to reading token contracts.
What is Etherscan?
Etherscan is what is known as a block explorer. A block explorer is a service that keeps track of all wallets, balances and transactions on a particular blockchain, with Etherscan being the most popular block explorer on Ethereum.
Information available on Etherscan includes;
- What crypto assets are held in a wallet.
- What transactions and smart contract interactions have taken place from a particular Ethereum address.
- Token contract data (e.g. contract address, smart contracts, ticker, total supply, circulating supply, logos, website, social media links, and even the source code).
- Live transactions taking place on the blockchain.
What can Etherscan do?
At its most basic, Etherscan lets you see what assets you hold in any of your Ethereum addresses. This is particularly useful if you have a non-custodial Ethereum wallet, that is an Ethereum wallet that you own the private keys for as, even if the wallet application itself is unavailable or shows a zero balance for some reason, you can always verify that your tokens are safe.
Exploring your wallet address (or anyone else’s for that matter)
Your chosen wallet (in this case Numio) always has an Ethereum address associated with it.
It looks something like this: 0xfe908cD986846C3bC2e450022e73a401629dA0BA
Lets visit etherscan.io and see what we can learn about this address.
At the top of the page you can see the “Overview”, where you can find:
- The wallet address.
- The balance in Ethereum & it’s price in USD.
- The balance of ERC-20 tokens and their price.
Below that is a box with various tabs.
- Erc20 Token Txns
The first tab (Transactions) shows all transactions that have used Ethereum. This may be ETH transactions or transactions that have required Gas.
The second tab (Erc20 Token Txns) shows all transactions of ERC-20 tokens that have both been incoming and outgoing.
The third tab (Loans) shows you any loans that you may have taken out using the platforms Compound, AAVE, Cream, Maker or Curve.
The fourth tab (Analytics) gives you various analytics for your wallet, such as your balance over time or fees that have been paid.
The fifth tab is ‘comments’. Anyone can leave a comment here and often use this for posting warnings that a particular wallet may be involved in a scam.
Token Contract Interaction
Etherscan is far more powerful than a resource for looking at wallets, it can view and interact with smart contracts.
Let’s take a look at the Chainlink “contract address” page on Etherscan: https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca
Then select the ‘Read Contract’ button.
By selecting ‘Read Contract’ you are able to query real-time information for the token.
- name — this is the full name of the project.
- totalSupply — this is how many tokens were created during the launch of the contract — note that the actual amount of tokens depends on the number in the next section*.
- decimals — how many decimal places the token has.
*The Chainlink totalSupply is 1000000000.000000000000000000 and the decimals are 18. This means that you must count back 18 places to get the total number of tokens.
In the case of Chainlink this will be 1,000,000,000, with 18 decimal points behind it (1,000,000,000.000000000000000000) or you can click the number and Etherscan will bring up a handy unit converter.
- balanceOf — you can enter any Ethereum address here and see how many tokens it holds.
- symbol — this is the short name, or ticker, for the token (e.g. LINK).
- allowance — this is where you can see if other wallets have been given permission to make transactions on your behalf.
For example, if you add your wallet address as the ‘owner’, and the contract address for Uniswap as the ‘spender’, you can see if you have given permission for Uniswap to make swaps on your behalf for that particular token.
It should be noted that the ‘Read Contract’ tab on some token contract pages may have more or less input fields depending on their use, and how complicated their smart contract is. In this post we will only look at some of the most basic functions.
Now let’s look at the ‘Write Contract’ button, which is found right next to the ‘Read Contract’ button. It is here that you can interact directly with the token smart contract. Why is this important? If you are interacting with a DeFi platform whose website goes down, you can still permissionlessly interact with any smart contracts.
First up — click ‘Connect to Web3’ and connect to your Metamask wallet.
- approve — this tab allows you to manually approve an address making a transaction on your behalf (e.g. Uniswap).
- transferFrom — this allows you to make a direct transfer of tokens from any address that you have permission to make transfers from, to another address.
You must remember the decimals from ‘read contract’ so if, for example, you want to send three (3) LINK, which has 18 decimals, you would type ‘3’ in the _value box, press the + button and ‘add’ 1018 zeroes.
- transfer — this allows you to make a direct transfer of tokens from your connected web3 address to another address.
That’s it. A quick ‘How to use Etherscan’ — keep an eye out for a future post where we will show you some advanced Etherscan DeFi tricks and look at some other explorers like zkScan and BSCScan.
Photo by Emily Morter on Unsplash
How to Use Etherscan was originally published in DataDrivenInvestor on Medium, where people are continuing the conversation by highlighting and responding to this story.