What have I done since?
I'm used to writing almost daily in my paper journal anyway so I thought I'd just try and move that to here.
So..what have I done since (my last post)?
Well I started out by finally creating my first ERC20 token. I used OpenZeppelin and it's very simple, I've only written about 7 lines of code. Launched that to Ropsten and I now have 21 billion coins in my Metamask wallet ๐ฅณ we'll leave out the fact that they're currently absolutely worthless. But I have a plan for them which I'll talk about at a later date.
After that I brushed up on some Redux. Looked into why we'd still need Redux when React Contexts are available but I found out that when you subscribe to a Context you are updated when any data inside of it changes whereas with Redux you are able to be notified only when one variable in the store changes. Refreshed my brain on how to wire up Redux in an app and that was it. I did this mainly because I keep getting messages from recruiters for Web2 roles and it reminded me I haven't used Redux for a while. I am holding out for some Web3 related work though ๐ค๐ฝ
Then I started looking more into NFTs and the ERC721 standard. Man that's a huge rabbit hole. I was meditating the other day and I had a great idea for a project but I want to understand as much about NFTs as I can before jumping in because this may actually be an ERC1155 project.
Of course I turned to YouTube and OpenZeppelin, turned the playback rate up to 1.5 and consumed. Learned a lot of good things about hashtable implementation for owners and tokenIds, where NFTs come from when they're minted, the 'approved' and 'transferFrom' functions marketplaces use and a little bit more.
Didn't get to finish this yesterday so we continue. I did wake up at like 2am and learn a lot about Yield Farming though, Curve Finance here I come.
Worked out that it is ERC1155 I need for my bigger project, I want to mint multiple instances of individual token IDs ๐
But for now I'm just going to practice ERC721. Found the minter contract that I need to use (from OpenZeppelin) so going to build a minter with a front end today that attaches an ipfs image (as baseURI) and will hopefully make it so the owner can prepend a new ipfs image to it using .unshift() then have a getHistoricalImg() function
Dont know why I'm hesitating to post these, but I've just kept documenting this in drafts.
So, done pretty well. Made my NFT minter contract and simple front end that returns hash with Token ID and string Token uri (metadata).
Next step was getting that uri and the image in it on ipfs. I learnt how ipfs worked and that I need a pinning service. I tried to use 'Tatum' but I didn't get along with the api very well for some reason, did some more looking around and found Pinata which has a very robust documentation.
I've managed to implement a function so when the mint button in my front end is pressed it generates an ipfs hash for the metadata and attaches that as token uri! The only problem is hashing an image and getting an ipfs hash returned. Documentation shows to use require('fs') but I'm trying not to use node. Going to try fetch or axios and see if I have any luck there.
Currently having wifi adapter problems (macbook ๐ก) so I'm going to take the rest of the day off and come back to it tomorrow.