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

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

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.

Leave a Reply

Your email address will not be published.