Week#2 @ EIF 3.0

Hi,

Today concludes my second week at the EthIndia Fellowship’23. For those of you who are new to my blogs, EthIndia fellowship is an 8-week mentorship program for developers who want to transition to web3 space organised by Devfolio. It has been an amazing learning experience this week. I wrote many smart contracts and learnt a lot about ERC20 tokens, open zeppelin contracts and randomness. For this week’s challenge we had the following

  1. Challenge 2: Token-Vendor

    Smart contracts are kind of like "always on" vending machines that anyone can access. For this challenge, I made a decentralized, digital currency. I built an unstoppable vending machine that will buy and sell the currency. I learnt about the "approve" pattern for ERC20s and how contract to contract interactions work.

  2. Challenge 3: Dice-Game

    Randomness is tricky on a public deterministic blockchain. The block hash is an easy to use, but very weak form of randomness. This challenge gave me an example of a contract using block hash to create random numbers. This randomness is exploitable. Other, stronger forms of randomness include commit/reveal schemes, oracles, or VRF from Chainlink.

As a side quest, I also worked on Deadman’s switch project. I found inspiration from the following project:

https://sarcophagus.io/

Overall, this week was full of great learning and hope to learn even more exciting things in future!

Cheers.