Developers Forum for XinFin XDC Network

Ivan_BlocksScan
Ivan_BlocksScan

Posted on

Interacting with Smart Contracts on XDC BlocksScan

Users can interact with any smart contract address with the contract code verified by XDC BlocksScan.

The Contract tab gives you a complete insight into the particular contract on XDC - BlocksScan Explorer. Details on the options available in the contract tab have been explained below:
Once you've verified your Deployed Contract on Explorer, go to the Contract tab and look at the THREE tabs.

1. Code tab

The "Code" tab displays contract information in general. It allows you to check the balance of specific addresses, owner addresses, or wallets with permission to use the token in your wallet.

Image description

2. Read tab

The second tab is about reading Contract; the "Read Contract" tab displays contract information in general. It allows you to check the balance of specific addresses, owner addresses, or wallets with permission to use the token in your wallet.

There are quite a number of information that the public can extract out of a verified smart contract on XDC BlocksScan. One of the important information that users can get is the balances of any wallet address for a token contract. Information that is public such as “allowance,” “owner,” or information that is generally not displayed on the front page of the smart contract address page can be found under the “ReadContract” tab.

Depending on the type and structure of the solidity contract, the information available in the "ReadContract" tab may differ from contract to contract.

An explanation of how to check the balances for a token.

Go to the Contract tab, and select the Read tab. To find the balance, look for the BalanceOf function and enter the address.

Image description

3. Write

The third one is Write Contract; clicking on "Write Contract" allows you to interact with the contract directly. This is useful when DeFi platforms and DApps are unavailable due to a technical issue or a website outage. Instead of using the project's API, you can try interacting with the smart contract directly in some scenarios.

Before Interacting with the Write function, the User first needs to connect XDCPay with the contract by clicking "Connect."

Image description

Under the “Write Contract” tab, users can perform functions written in the solidity smart contract. An example of a function written in the smart contract is the “transfer” function.

Here user need to enter the XDC address and the amount with 18 zero, which the user needs to transfer.

Image description

Once you have confirmed the entered details, click on Write button.

XDCPay will pop up the screen to Confirm the transaction, Click on Submit button to Complete the transaction.

Image description

After completion of the transaction, user can check the transaction hash and other details regarding the transaction.

Image description

The smart contract's function and nature are determined by the smart contract's developers. Users can only interact with smart contracts that have been confirmed on XDC BlocksScan for added security.

A verified contract means that the contract code given by the owner of the contract matches the contract code deployed onto the XinFin - XDC Blockchain.

Contracts with vulnerabilities or those are misleading, such as a phishing contract, are not filtered out by XDC BlocksScan.

XinFin(XDC) Explorer useful links:

Testnet / Apothem explorer:

XinFinScan Explorer
XDC BlocksScan Explorer

Mainnet:

XinFinScan Explorer
XDC BlocksScan Explorer

For any queries, follow BlocksScan — Social channels:

Github
Twitter
Telegram
Facebook
Instagram

Discussion (0)