Interacting with Tron Smart Contracts

in #p3t5 years ago

How do I interact directly with Tron smart contracts if the website is down?

This is a question we often see in the Tron decentralized application ecosystem. In this post, we hope to provide an in-depth explanation on how you can make transactions with verified smart contracts if the user interface is inactive.

For this example, we are going to use the P3T smart contract. You can find a link to the contract on the top of the P3T website, but for this example, we are pretending that the website is down and you haven’t saved the smart contract address. In this instance, you can find the smart contract address in multiple ways:

1.Ask the community. There should be someone in the community that can help you find it.

2.Check your transactions on TronScan. If you have interacted with this contract recently, then you should be able to find this in your recent transactions.


https://tronsmartcontract.space/ made by KhanhND69

Now that we have the smart contract address, we can enter it on the Tron SCS website. Here is a link to the smart contract we are using in this example: https://tronscan.org/#/contract/TEEEQGmbZoeHA24EVG91b6u9zsbWUfefPF.

Tron Smart Contract Space (TronSCS) is a community made user interface designed to be able to verify, compose, and interact with smart contracts on Tron. To look up the contract, you can copy and paste the smart contract address from TronScan to the box that reads “Type address of smartcontract.”

Click: “Show contract”

On this next page, there are different options available depending on what information you would like to get or what actions you want to accomplish.

If you would like to see the source code, you can click “Show source.” The default is showing “Read contract.” However, for the purposes of this article, we want to actually interact with the contract since the website is down. Therefore, we want to choose “Write contract.”

To interact with the contract, you must make sure that you are logged into your wallet and on the Tron mainnet. You will know that you are logged in when the top right corner has a green box that says “Hi” with your wallet address. If you are logged into your wallet, you will be able to use the write contract functions to interact with the smart contract the same way you would use the actual website.

Different smart contracts will have different actions here. Since P3T is an exchange decentralized application, there are functions to buy and sell the P3T token along with withdrawing and reinvesting dividends. The exit function with sell all of the P3T tokens into Tron (TRX) and will withdraw everything to your external wallet. Clicking the buttons to interact with the contract will bring a pop up window from your external wallet to verify the transaction. Just like if you were interacting with the smart contract on the regular user interface.

Although these functions might be different depending on the smart contract, the process of interacting with the smart contract on Tron is similar to the steps listed in this article.

Should you have any questions, the Tron community is here to help.

P3T can be found in these communities:

P3T Discord: https://discord.gg/GxQXNvy

P3T Telegram: https://t.me/p3t_en

Special thanks to the Tron community and the creator of https://tronsmartcontract.space/ for his contributions to our ecosystem. He can also be available for questions in his discord under the name “Khanh.”

Tron SCS Discord: https://discord.gg/xz7RKGw

Sort:  

A great article that contains a lot of useful information Thank you for all the efforts you are the best

do you have any social media on which I can talk to you, for example facebook?

It's better to take part in this p3t contract, this is a smart contract that fits my expectations so far

do you have any social media on which I can talk to you, for example facebook?

Congratulations @ugos! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Your post got the highest payout on one day

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Vote for @Steemitboard as a witness and get one more award and increased upvotes!

@ugos, This is effective Tutorial and let's hope that it will be helpful for people. Stay blessed.

Posted using Partiko Android

Brilliant post, ugos.

Very educational for people using smart contracts, or wanting to use smart contracts but scared incase the website "goes" down and they cannot access their funds.

do you have any social media on which I can talk to you, for example facebook?

cBenton92 on Telegram :)

Okay, I will use this contract address to see the development of P3T

do you have any social media on which I can talk to you, for example facebook?

It's hard to do the first time

do you have any social media on which I can talk to you, for example facebook?

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 60725.43
ETH 2900.91
USDT 1.00
SBD 3.59