paint-brush
Smart Contract Codes: How You See It vs. How a Developer Sees Itby@0xsmartcontract
810 reads
810 reads

Smart Contract Codes: How You See It vs. How a Developer Sees It

by 0xSmartContractJuly 8th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Using animated videos is not just making the brand adorable, but it also incorporates 2D animation videos on a landing page and a promotional campaign that ultimately boosts conversion rates. The traditional animation styles have been known since the 1800s. The digital techniques in the 2D. animation process replace the traditional process and make the 2. animation explainer videos much more accessible, cost-effective and faster. 2D animated videos are one of the proven formats many brands use to introduce and build brand awareness.

Company Mentioned

Mention Thumbnail
featured image - Smart Contract Codes: How You See It vs. How a Developer Sees It
0xSmartContract HackerNoon profile picture

Smart contracts are digital contracts stored on a blockchain automatically executed when predetermined terms and conditions are met.


Now let's get to the code.


Have you ever wondered how Smart Contract developers see code? I have to explain this visually.


Let's choose a random function from any smart contract.


For someone without smart contract coding knowledge, this is like a jumbled sentence impossible to decipher and read—meaningless definitions, strange markings, etc.


Ordinary users see the code like this:


Solidity Smart Contract Function


Same Solidity Smart Contract Function visulation



A Solidity Developer is one who uses the object-oriented Solidity language to build and deploy smart contracts on Ethereum-based applications. Solidity is the native language of Ethereum which gives enterprises the complete advantage of launching projects on the Ethereum blockchain platform.


Now let's see how a solidity developer sees this code.


First, let's see what Function's body looks like.


Elements in this function body above;

  • Contract name : Colleteral.sol

  • Function Name : depositTo

  • Funciton Visibility: external

  • Function Modifier: There are 5 modifiers and their order is important!

  • Function Arguments: There are 3 arguments.

  • Types of Function Arguments:


Function body to solidity language


                      Visualized Function body


Those who can read the codes visualize it in their minds and understand, analyze or imagine it in this way.


This visualization, clearly explains how a developer decodes these codes, reads them and sees them.


Now let's look at the rest of the code.


In this section, a record is made in the mapping named _product.


During these recordings, it interacts with other solidity contracts in the project (OptimisticLegder.sol)



When I started writing smart contracts, I was incredibly excited to see how this simple one line of code had such detail.


We come to the last part of the code, where the "pull" function is triggered and a token transfer takes place.


Later, an Event with Emit is broadcast


Conclusion

In this article, I modeled how to visualize codes, and also visually told you how developers or hackers read these codes. Being able to read code is fun, but reading Solidity codes will not be easy at first.


I am a smart contract developer, you can reach me at my Twitter address.