bgrosso.eth's staking dapp

Who are you, and what is your software development background?

I am a frontend engineer working in web2 space currently but eager to pick up web3 dev skills.

Why did you want to complete this lesson?

I am eager to complete the entire R2W3 series both to learn web3 development but also because of the NFT PoK issuance and cohesive means of proving my learnings with the backing of the Alchemy brand!

When did you complete the project?

This one took me a while, completed 11/13/2022

What technologies did you use?

Hardhat and ethers.js for writing and deploying the smart contracts, ethereum stackexchange extensively debugging and researching computing compound interest and floating point math in solidity, staker-eth and eth-hooks javascript starter codes / templates providing the skeleton of a staking dapp, React.

What did you enjoy about the tutorial?

The tutorials are definitely getting harder and it is stretching me and forcing me to research and learn. Here I learned that it can be extremely difficult to do simple math I take for granted in solidity because there are no floating point numbers and the typical means of getting around this of multiplying by a factor and then dividing by that factor is not possible when you need to raise the number to a power in between. It was a big rabbit hole for me researching this, and interesting to see that even the most popular few libraries with math implementations for this in solidity that have 300 GH stars only have 1k downloads per week on NPM. A few possibilities: there still aren’t that many web3 developers, most are implementing their own complex math by hand and not using a library, or they are using libraries but getting them into their projects by other means than NPM. Either way I was nervous about using them and for now settled with a looping approach to perform to 1% compound interest per second that I perform as part of the challenge.

How do you think you can use this technology to build useful applications in the future? What are some specific example applications?

Staking is a crucial activity for crypto. In order to be viable, there needs to be the ability to earn a yield and also this performs the vital function of the proof of stake txn validation that keeps things going. But we also need to be able to do this is in a truly decentralized way without relying on CEX staking pools, given recent events and issues of trust associated with them custodying your money. Thus the ability to stake small amounts right from my wallet is necessary and it was cool to see how to go about this. Some examples of apps doing something like this are AAVE, Rocket Pool, etc.

Who would you recommend this project to?

Anyone on their web3 dev learning journey!

What is the Ethereum wallet address you would like to receive your PoK at?

bgrosso.eth / 0xC0e90583cc27191Ab17407Ac3595E1509ffDA69F

Github Repo:

https://github.com/modelB/staking-dapp-r2w3-w6/blob/challenge-1-decentralized-staking/packages/hardhat/contracts/Staker.sol

post image