Skip to main content

How to Access, Read, and Understand Ethereum Smart Contracts

How to Access, Read, and Understand Ethereum Smart Contracts


 Web3's power to facilitate trustless transactions and permissionless transactions without the involvement or intervention of any third party intermediary or centralized authority is part of its beauty. But how does this magic actually occur? Popularly known as "Internet Legos" and referred to by Packy McCormick as smart contracts, smart contracts have been widely accepted as the foundation of Web3.

A digital contract is computer program that lives in the blockchain. It is controlled using the rudimentary "if/when...then". statements. To illustrate, "if a" occurs, execute step ‘b. Once these predetermined terms have been met and the transaction is executed, it is saved to the blockchain.

These computer programs are composed by nature and can be combined to make fully-fledged blockchain applications. All these Web3 projects run on smart contracts.

Smart contracts are used specifically for NFTs. They can be used to execute events such as the minting or burning of tokens, facilitating transactions, and disbursing royalties. The token's smart contract holds important information regarding its distribution, function, as well as transaction volume. This information can not only be useful in assessing the health or a project's performance, but it can also help you to become a more educated NFT enthusiast.

Surprisingly you don't have to be a programmer to learn how to use smart contracts to gain valuable information. But you must know where to look. And that's exactly why we're there.

The best way to access an NFT’s smart contract

Etherscan provides the best way of viewing a token's Smart Contract. It is an Ethereum block explorer/analytics platform. Block explorers such Etherscan make it easy to index and search historical and current information on a blockchain. This page allows users to easily find relevant information about specific tokens and smart contracts or transactions.

Most token owners can access the smart contract by using one of two options: Etherscan searching or NFT market listing.

Etherscan searches

Etherscan search


The search bar features prominently on Etherscan’s homepage. The search bar lets users query the blockchain by address, transaction hash and block number.

We will search by the token name for the purposes of this article. Let's look at CryptoPunks.

Web3's power to facilitate trustless transactions and permissionless transactions without the intervention or interference of any third party intermediary or centralized authority is part of its beauty. How is this magic possible? Smart contracts are often referred to as "Internet Legos" and are the building blocks of Web3.

A digital contract is any computer program that lives on blockchain. It is controlled using the rudimentary "if/when...then” statements. To illustrate, "if a" occurs, then execute step B. Once these terms have been met, the transaction will automatically be executed and stored on the blockchain.

These computer programs are composed by nature and can be strung together to create fully-fledged blockchain applications. Smart contracts are the backbone of all these Web3 projects.

Smart contracts are used specifically for NFTs. They can be used to execute events like the minting or burning of tokens, facilitating transactions, and disbursing royalties. Under the hood, the smart contract of a token holds valuable data regarding its distribution, function, as well as transaction volume. This information can not only be useful in assessing the health or a project's performance, but it can also help to make you a safer NFT enthusiast.

Surprisingly you don't have to be a programmer to learn how to use smart contracts to gain valuable information. But it helps to know where and when to look. We are here to help.

The best way to access an NFT’s smart contract

Etherscan provides the best way of viewing a token's Smart Contract. This is a block-explorer and analytics platform based on Ethereum. Block explorers such Etherscan make it easy to index and search historical and current information on a blockchain. Users can quickly find relevant information about specific tokens and smart contracts or transactions.

To gain access to a token's intelligent contract, most users choose one of the two options: Etherscan searching or an NFT market listing.

Etherscan searches

A search bar with large fonts is prominently featured in Etherscan’s homepage. The search bar lets users query the blockchain with their wallet address. They can also use this address to find out about transaction hash and block numbers.

For the sake this article, we will search for token names. Let's look at CryptoPunks as an illustration.

Via NFT Marketplace Listing

Via NFT marketplace listing


It is possible to access tokens' smart contracts via a CryptoPunk listingon the NFT marketplace. This route is longer but safer. OpenSea's marketplaces include a link to the contract address in the details/ properties card. This card is found on the left side.

Rarible and Foundation marketplaces don't link directly to contracts. However, they link the mint transaction where you can quickly find the contract address. As you can see, the Magnum Photos 75 Collection Contract Link is listed on Foundation.

Navigating Etherescan

The main page of the contract

The maincontract page acts like the homepage of the contract. In the contract overview and other information sections, you can see the total amount and USD value of the contract's ETH balance. A link to both the initial mint transaction, and the wallet used to make it, is also included in the more info section.

Scrolling deeper into the pages and their respective tabs reveals a treasure trove of information on transactions, holders, analytics, as well as the code of the contract. Let's explore a bit more.

Transactions

The transactions tab contains a chronological overview of all transactions on blockchain, with timestamps as well as the wallet addresses associated each transaction. Also, it includes the transaction's value and the applicable gas fee.

Txn Hash Column allows users access to more details regarding a specific transaction on blockchain. Next is the method column, which details the function executed during the transaction. Examples include: mint, sale and transfer. In this case, the functions include withdraw bid, bid entry, and withdraw.

Contracts

The contracts tabis separated into three sections. Code, read contract and write contract. Before you proceed, make sure that the contract that you are reading has been verified. This ensures the contract code submitted to Etherscan and verified by the owner is identical to the Ethereum contract. As you can see, the contract is verified. This means that you can move forward.

The code tab contains the source code of smart contracts, as is evident by the name. This can be hard to understand if one doesn't have the technical skills required to learn the Solidity programming language. There are comments that often separate each section of code and identify the associated function.

This could be a good opportunity to learn the basics of Solidity.

The readcode tab displays information that is not usually displayed on the main contract homepage. This information will vary depending on which contract you have, but it allows you to query smart contract functions for specific information.

The balanceOf section lets users verify how many CryptoPunks a single account holds by entering a wallet number.

Let's check out FaZe Bank wallet for gamer.

Boom. FaZe owns nine CryptoPunks.

Enter contract

You can connect your wallet with Etherscan to allow users to execute any function from the EtherscanUI. This includes purchasing, withdrawing and placing bids. This is a lot more difficult and practical than transacting via an NFT Marketplace, but it's different for different people.

Token tracker

A link to the Token Tracker can also be found at the bottom, in the more info box, on the main contract pages.

The token tracker link gives you additional information about the collection. This includes the minimum token value, maximum supply, number of unique wallets holding tokens, and the total number transferred. This information can be used to indicate the strength of an NFT-collective and its community.

A community that has many different holders and transfers is often more active and healthy than one with only a handful. The transfers tab below contains an immutable record that tracks every transfer of tokens within the collection. This includes date, time, sale price and wallet addresses.

Token holders

Token holders


The holders tab provides a detailed breakdown of who holds the most tokens. To get a better visual, click the token holder's chart in top left-hand corners. This will display the data in a pie chart.

This illustrates that the top 100 CryptoPunks Holders collectively control 46.48% of CryptoPunks.

Analytics

Finally, the analysis tab shows additional data regarding transaction count. Unique senders, ETH fee, transfers, and many other factors. In the end, data availability varies from one collection to another. The CryptoPunks chart shows how we can sort through data concerning ether balance, transactions fees, ETH and token transfer costs.

At this point you should have an overview of Etherscan, smart contracts, and Etherscan. You have the whole blockchain at your disposal. It's up to you to decide how to use it.

Comments

Popular posts from this blog

What are Gas Fees and How Can We Fix Them?

Blockchain transactions were very affordable prior to 2020. With the rise of Web3 & NFTs, mandatory blockchain transaction charges -- also known by gas fees -- are now the greatest barrier to mainstream adoption. Network congestion is what determines the gas price for blockchains like Bitcoin or Ethereum. The network congestion is the reason why the gas fees are higher for more people. Web3's ethos of inclusivity and democracy means that this fundamental scaling problem largely challenges those core tenants. Although gas can seem quite simple in concept, it can be quite complicated under the hood. This explanation explains gas fees and how they work. It also explains what Ethereum and other Blockchains can do to make them cheaper. What's a gas charge?   Gas fees, as defined in our dictionary are payments made to complete transactions on a blockchain. These fees are paid to blockchain miners to cover the computing power required to verify transactions on blockchain. These ...

Almost Every Social Media Company is Adding NFT Features

  2022 appears to be the year when NFTs gradually enter the mainstream social media market. In January, Twitter launched NFT-based verification of profiles, and at the end of May, Instagram announced NFT in-app options. Just a week after, Linktree joined the group. The link-in-bio service has partnered with OpenSea to add a number of NFT-related features to its platform.More Latest NFT News . Connecting Web2 users to Web3 projects More than 23 million Linktree users now can use three new NFT tools to connect their Web2 customers with their Web3 projects. First is an NFT Gallery Link. This tool allows users can show the gallery with up to six NFTs within their Linktree. At the moment, just those using the Metamask wallet and OpenSea marketplace are available for this feature. However, Linktree says that more options are forthcoming. NFT GALLERY. SOURCE: LINKTREE Many NFT holders have built online identities based on their work, using them as PFPs on social media websites such as ...

NFT 2.0: How Soulbound Tokens Could Change Your Life

Vitalik Buterin, best known as one of the co-founders of Ethereum, has a major new Web3 project under development. In the whitepaper called "Decentralized Society: Finding Web3's Soul," Buterin and his co-authors outline their vision of a distributed society (DeSoc) and how they can bring it into possibility. Their suggestion? We'll need to develop something known as " Soulbound Tokens " (SBTs). In the main, SBTs are not transferable identification and reputation certificates. They enable people to verify their personal information -- such as their educational background, work history, credit score, medical history, professional certificates, and more. -- by using blockchain technology. The concept is highly discordant. Some believe that SBTs are a more efficient and reliable way to verify the authenticity of the information. Some compare it with China's dictatorial social credit system . Which is the more realistic view? It isn't easy to decide. I...