I Deployed a Smart Contract to the Tron Blockchain. This is How I Did It.
I Deployed a Smart Contract to the Tron Blockchain. This is How I Did It.

By SkinnerCrypto | Magic and Lasers | 27 Mar 2020


So, for those of you who do not know, I have been actively involving myself in learning blockchain development and also... trying like hell to figure out F*CKING BOOTSTRAP. GAH! THAT IS ANNOYING BUT ALSO USEFUL. I have a use case for which I am ready to start building my own token, and honestly, I intend to get this done on the Ethereum blockchain, not Tron. However, I recently came across a great opportunity to learn exactly how to deploy a smart contract to the Tron Blockchain, so I went ahead and did it. Props to my buddy Walkonwayvs (FOLLOW THAT GUY HE IS AWESOME) for providing me with a motivation. What motivation, you ask?

351665157-8d02f2b9e3a7d8822ca0aa52f30c3ccf4e6318dccb84bc1f37e2da22c3b3fb25.png

GOOD POINT

You heard it here, folks. One does not simply make a spurious claim about Justin "Pantywaist From The East" Sun. It has to be submitted TO THE BLOCKCHAIN! Only then do the words that spew forth become Gospel. So, I had a challenge and I had to meet it. But how do I get a message to the Tron blockchain?

Learning about the Tron Blockchain.

So, I knew a thing or two about how the Tron Blockchain worked already. I know that at one time, TRX was just another token on the Ethereum blockchain. I know that in order to write a smart contract on the Tron Blockchain, you need Solidity. Okay, I got two things down. I figured that just like its big Brother Ether, TRX must also run similarly. Sure enough, I was correct. I went to the Developers page on the Tron Foundation website, and found a quick and simple "Hello World" contract which suited my antics perfectly:

351665157-39ea752d0692067e579f9ee6ad8387dbaf90e1302703c89decaec3f681488dc5.png

Hard to See? This is the Smart Contract I need. HERE'S A LINK

Great. Now I know for Ethereum, I need a proper wallet that can interact with my browser, and an IDE. Fortunately for me, the dev docs goes over this; I went ahead and put the Tronlink browser extension into my BRAVE BROWSER (I love my brave browser. There are many like it and this one is mine. PBUH). I created a wallet, named it and put about 300 TRX in there for my (current and future) shenanigans:

351665157-05f7a8e17e75cb78598782cf7ff4cbe3d75e1b0ec10a98f8d1c92ee9c99030e1.png

No TestNet Horse Shit This Time. This is Going TronGrid Baby.

And then of course, after this was set up, I went to the TRON-IDE and set to work:

351665157-04b2c9cb5dc09dae8b4e7b177c06620acf73058347db899fe21cfe3d7548d807.png

It's ALL COMING TOGETHER.

This Is Some Cool Stuff Ginger Man, But I'm no Goddamn Developer. WHAT DOES THIS ALL MEAN!??

Good question. So basically, in order to put a smart contract to the blockchain (meaning, to send a message and make it part of the blockchain), I need to:

1.) Make the Contract.

2.) Set and Bankroll the Deploying Wallet Address.

3.) input my code into the IDE (Integrated Development Environment).

4.) Compile the code.

5.) Deploy an instance of the code (contract).

6.) Run a function (in this case) on the contract.

Okay so if you're still with me, I just showed you and gave some links for steps 1 - 3. Here's the next shit:

After I got my IDE open, code written in, I needed to compile it. Basically, in order for the underlying "computer stuff" to understand what I'm trying to tell it, it needs to take this Solidity code and translate it into something called ByteCode. That's all Compiling a program is; translating the thing that's easy for YOU to read into something that's easy for the COMPUTER/NETWORK/WHATEVER to read:

 

351665157-dbb26247c9eb68c0973213be99de042e0d06df4e9dec65b3480affb5f4b5d71e.png

 

Now with that out of the way, It's time to deploy the contract, so we go over to the little deploy plugin here:

 

351665157-f715cb04c9d6a6c6b0327f95f36185f22569ef3ed0edb390289e867ab1591f1e.png

 

We Deploy the contract, call out the function that posts a message (which becomes a transaction), burn a little TRX for the trouble, and BOOM. Whatever I say is Gospel on the Trongrid MainChain. And I did just that. Don't believe me? CHECK THIS OUT:

https://tronscan.org/#/transaction/c0f16ce99e241e8224047d871a96788298d9e0beaf1d14ea696ce45825bc08e6

Or, if you're lazy (that's okay, me too):

 

351665157-f079ad0aa40861c54125f75c480d9ac6ddd639820f63d697bbf473fb41e075c0.png

 

Did You Miss It??

 

351665157-08f145a00a582f6d99c994f817e71aa80ec1612ef019b148b3e523a7e7dc940d.png

Awesome.

SO, Why All of This?

There's a couple reasons.

1.) For the Lulz

2.) Because I knew I'd learn something useful/related to it.

3.) Lol, because the LULZ.

I figure that in this time and age, we need to check ourselves at the door every so often. Things suck ass out there, guys. I'm not gonna lie about it. What keeps me going? Pushing the envelope when I can. Finding something stupid and hilarious. Doing something that keeps me from ruminating on the bad things in my life. It's an easy medicine to take, trying to find the punchlines in life. The hardest part is getting the prescription. It takes some serious practice to get there, I think. But really, anyone can do it. Just turn off your Give a Fuck for a minute one day and see where it leads you. And wash your hands afterwards, I'm not responsible for the consequences. Unless they're awesome, then I'll TOTALLY take the credit.

Thank you SO SO much for reading, I REALLY appreciate it. If you like my stuff, follow me here and on THE NEW AND IMPROVED HIVE HARD FORK!

No shills beside that today. Just my love for all of you.

Until next time, keep your eye on the markets, and find ways to WTF every day.

 

 

 


SkinnerCrypto
SkinnerCrypto

I'm a futurist, cryptocurrency enthusiast, techie, artist and aspiring land surveyor. I like to solve problems. I have some ideas for a planned community.


Magic and Lasers
Magic and Lasers

This blog is dedicated to the talk of Cryptocurrency topics, Futurism, Technology, and scifi/Fantasy.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.