My journey from Web Dev to Web 3.0 Dev - Part 2
Tags: web3, blockchain, smartcontracts, devjournal
Published: 2022-06-01 18:27:54

Hey there!

I'm here again to share my latest Web3 learnings.

## 🏦 DeFi Application

I've started building my own Decentralized Application.
This Dapp is going to have several implementations and features such as Staking, Farming, Oracles, and Proxy Contracts.

{% embed https://github.com/Markkop/markkop-defi no-readme %}

I began with staking, but first, I needed to understand how Staking Rewards are distributed.

I went to a DeFi app I used on Binance Smart Chain and analyzed its contract. 
Later I found out that it's just a copy from Sushiswap's Masterchef contract - a very popular staking contract.

A few days were spent dissecting the smart contract and extracting the formula used to share rewards to stakers.

In the following blog post, I explain in detail how it works.

{% embed https://dev.to/heymarkkop/understanding-sushiswaps-masterchef-staking-rewards-1m6f %}

Then, after implementing my own staking contract based on the study I made above, I paused this project to get a grasp on Zero-Knowledge Proofs.

## 🔎 Zero-Knowledge Proof

While researching Web3 study content, I've met this Zero-Knowledge DAO on Harmony blockchain promoting cohorts to teach developers about ZK Proofs.

{% embed https://twitter.com/harmonyzkdao/status/1513871913923362822 %}

I enrolled in the course and went deep dive in its first weeks, but I had to focus my efforts on my current job.

Zero-Knowledge is an exciting and fascinating topic, but a course about such a complex topic requires a lot of dedication to keep up.

Nonetheless, I was able to summarize the learnings I had in its first week in the following blog post:

{% embed https://dev.to/heymarkkop/zku-week-1-introduction-to-zkp-h5 %}

I decided to study ZK again after getting more experience with Web3.

## 💣 OpenZeppelin's Ethernaut

In the latest months, I was also looking to improve my solidity and security skills, and Ethernaut was a really great tool to achieve this goal.

{% embed https://github.com/OpenZeppelin/ethernaut %}

I'm still going through it and summarizing my learnings in a draft blog post which I will share soon.

One remarkable experience I had was figuring out why a solution stopped working from changing just a bit of the code.

I've tried getting help on several discord channels, but I only managed to understand the issue when a guy from OpenZeppelin answered me on Linkedin.

This story and the solution are registered in the blog post below:

{% embed https://dev.to/heymarkkop/why-does-this-transaction-run-out-of-gas-cb9 %}

Spoiler: Metamask was not receiving the Gas Limit parameter from Remix, and gas limit estimation doesn't consider underlying transactions like the transfer one in the challenge.

## 🛡️ OpenZeppelin's Defender

The Ethernaut challenges made me curious about OpenZeppelin, and while finding more about the company, I stumbled into their Defender application.

{% embed https://www.openzeppelin.com/defender %}

I'm the type of guy that can only understand a tool for real when building something with it.

So I made up some random context, such as an NFT Game, and used Defender to help me manage some smart contracts.

The result is described in the following blog post:

{% embed https://dev.to/heymarkkop/discovering-openzeppelin-defender-features-with-an-nft-game-4p0a %}

While Defender is a great tool, it's meant to be used for particular features, so it might take a while for me to apply it to an actual project.

## 💭 My following plans

I'm currently handling a significant workload on my job, so that this Web3 Journey might get slower.

This is not a bad thing. The company I'm currently on has been providing support on my software development skills that are going to be very useful in the Web3 context.

I will keep sharing my learnings with the world, so make sure to follow me on this blog and social media as well :D

[Twitter](https://twitter.com/HeyMarkKop) | [Linkedin](https://www.linkedin.com/in/marcelo-kopmann/) | [Github](https://github.com/Markkop)