In-depth understanding of "smart contracts" and the query methods of "smart contracts" on mainstream platforms
Tokenview
2020-03-04 11:20
本文约1245字,阅读全文需要约5分钟
Smart Contract (Smart Contract) refers to a transaction agreement with executable contract terms processed by a computer. Smart contracts will strictly follow the contractual agreement and be automatically executed. With the help of open, transparent, ir

Smart Contract (Smart Contract) refers to a transaction agreement with executable contract terms processed by a computer. Smart contracts will strictly follow the contractual agreement and be automatically executed. With the help of open, transparent, irreversible, non-tamperable, traceable and other characteristics of the blockchain, smart contracts can rise rapidly with the support of blockchain technology. At present, most smart contracts are executed on the blockchain.

Smart contracts can be created and executed on blockchains such as Bitcoin, Ethereum, IOST, NEO, TRON, etc. Take Ethereum as an example. It is an open source platform designed for decentralized applications. We usually call programs running on the Ethereum Virtual Machine (EVM) "smart contracts". There are also differences in the smart contract programming languages ​​of different blockchains. For example, the most popular programming language on Ethereum is Solidity, which is similar to JavaScript. If you are familiar with Python and have higher requirements for security, you can choose Vyper language .

In addition, the deployment and invocation of smart contracts often need to follow some standards. If there is no set of standard interaction methods, then each contract requires a set of independent APIs, which will undoubtedly increase our development costs. Like Ethereum, the Ethereum community will adopt many specifications that are helpful to developers. This is what we often call EIP (Ethereum Improvement Proposal), and the proposal will be discussed and finalized by community members. The specification involving smart contracts is known as ERC (Ethereum Request for Comments). Currently, the widely used specifications in the Ethereum ecosystem are the ERC20 specification and the ERC721 specification, both of which are used to specify the standard format of smart contracts, which makes the interaction mechanism of smart contracts more standardized.

So how do we query the on-chain data of smart contracts?

Smart contracts need to be queried through a block browser. If we know the creation address of the smart contract, we can directly search for its address. If not, we can also directly search for the token name of the smart contract in the browser. Take the Ethereum browser eth.tokenview.com as an example. If we want to query the relevant data of USDT issued by Tether through smart contracts on Ethereum, we can directly search for USDT on the browser page, as shown in the figure below.

Here, we can see the creation address of the smart contract, the creator, and the transaction ID of the creation contract. Click on the ID to view detailed information such as the creation time of the smart contract. Click on the Token - Tether USD corresponding to the contract, and you can view the token circulation of the contract and the distribution of token holdings (rich list).

As shown in the figure above, here is information such as the circulation of USDT on Ethereum and the number of currency holding addresses. At the same time, through the rich list below, we can understand the wealth holding distribution of USDT currently in circulation (only USDT issued on Ethereum ).

Through this method, we can easily view the on-chain data of any smart contract on Ethereum, including its related ETH transactions, contract call transactions, and Token transfer transactions of the contract. This can help us grasp the data authenticity and activity performance of the projects involved in the smart contract, so as to better understand, analyze and judge. Different blockchains have different query tools for smart contracts, and you need to use their dedicated block browser query tools. Here are a few query tools for mainstream platforms for your reference:

Ethereum Ethereum:https://eth.tokenview.com/

Tron:https://trx.tokenview.com/

NEO:https://neo.tokenview.com/

IOST:https://iost.tokenview.com/

Tokenview
作者文库