Lesson 4: Final notes & Final project + repo
Last updated
Last updated
For this lesson, I felt it appropriate to simply develop what I already had from lesson 3. I wanted to add to the smart contract all the functionality asked in the excercises. Also I went on a little tangent, doing some testing around gas costs, which in the end was a very worthwhile excercise.
On the front end i really wanted a user balance to be a live, self updating feature, rather than it be achieved by the user having to press a button. This took me on a small journey into the useState and useEffect hooks in react.
Added events and event handling to the deposit and withdraw functions
optimised the functions for cheaper gas calculation.
Updated the style
Removed getUserBalance button
Replaced with a live bar that shows the user balance, utilizing useEffect and UseState.
The final project is available here -
Front-end repo -
Back-end repo -