Guide to Full Stack Solidity Developer - Part 3

Takshil Patil
3 min readDec 13, 2022

--

Previous Part: https://medium.com/coinmonks/guide-to-full-stack-solidity-developer-part-2-c11b8c14ea20

Summary: This part mainly focuses on blockchain development topics that are not covered in 1st part. This article will not focus on blockchain security. This article will only reference some great articles written by community. It makes no sense to create redundant content. By no means these is the best references, my intention here is to just give examples, feel free to explore more.

Solidity Patterns

As indicated in part 1, I have a few reference links below on Solidity Patterns.

1. Smart Contract “Visualisation”

“Visualisation” is not a standard term in ethereum world, I just conied it for my ease of referencing it. Implementation could include multiple contract, linked with each other, so it may not be that straight foward to understand the working of the contract. In each contracts there could be many lines including function codes, event codes, modifier logic, etc.

To ease up reading of such contracts and understand its complete working I have created an article for it : Smart Contract Visualisation

2. Gas Optimisation

Everything in blockchain require gas to process. gas is fee required to do a transaction in ethereum, it does not refer to the value of the crypto coin, but in backend to take ownership of the coin, you need to pay some transaction fees along with the real price of the coin, this transaction fees is called gas.

I have written a separate article on gas optimization : Solidity Gas Optimisation

3. Introduction to DeFi

DeFi, is doing finance on blockchain. You have already seen few DeFi Dapp like simple bank app in this seires of articles.

I found a good reference for DeFi introduction: How to Learn DeFi

You can further explore how Decentralised Exchange (Dex) works.

4. Randomisation in Blockchain

I have written a separate article for this: Randomisation in Blockchain

5. Upgradability in Smart Contracts

The concept of upgradability in blockchain, is in context - to update the address where the current contract reside, rather than modifying/upgrade existing contract. In blockchain we cannot modify existing contracts.

One way to look at upgradability is using abstract contract, where we only define the interface, and the main logic will be implemented by calling contract. These could be termed as abstract contracts. But these needs to be very carefully used as attacks on these are the easiest, example, an attacker can define a logic for the interface.

To solve this we use a contract which acts as a proxy to our main logic contract. The calls are handled by deligatecall on the proxy contracts and are propogated to the main logic contract. We have a upgradability feature which can be used to upgrade the contract for further revisions.

Note: Upgradability in contract can introduce new attack vectors, every type of upgradability will have its own pros and cons. I highly recommend that you go through all the details before implementing in production, especially focus on security drawbacks while you are reading about it because functionally are implement contract upgrades.

I found this documentation from Ethereum.org very useful to understand the different types of upgradability patterns. Openzepplin also has a good documentation on few upgradable contracts. Apart from this I came across of good article on upgradable smart contracts.

1.1 Transparent - Proxy Contracts

1.2 UUPS - Proxy Contracts

1.3 Contract Migrations

For more details please refer to this article.

6. Smart Contract Testing

Note: This will not cover the smart contract security or auditing part, it only focus on contract testing, that verifies if the contract is working as expected or not.

I have written a separate article for this: Smart Contract Testing (not Auditing)

7. Understanding EVM Storage and Organisation

Below are few references to understand EVM Storage and Organisation.

8. Inline Assembly & Bytecode Analysis

Below are few references to understand Inline Assembly and bytecode analysis.

--

--