Hello hello~ Welcome to my second ever article guide thingy with some smol help from @deor :) I still don’t know what to call these thingies ahaha.
If I miss anything important whoops I might add it in? maybe or maybe not depends on if I have time or nots
An NFT is a unique token that a smart contract says you own - Big brain Deor
You might have heard these terms before If you didn’t then here you go (These definitions might not be 100% correct BUT they should grasp the overall meaning)
If you want to look into a simple code portion of a smart contract, if not you can skip :P
Woaw much smart contracts
Smart contracts can be coded/tinkered to whatever you desire be it a chess game (https://fiveoutofnine.com/contract ← Chess game code) or NFTs
I’ll be mostly touching on NFTs as I'm too lazy to talk about other things anddd that this article guide thing is about NFTs haha.
You can take a look at Tubby Cat’s Smart Contract as that’ll be our example for this article or not that's up to you since this is the technical sides of these things https://etherscan.io/address/0xca7ca7bcc765f77339be2d648ba53ce9c8a262bd#code
If you have the Etherscan with Tubby’s Smart Contract open, you might be severely overwhelmed but if you look closely and ignore the “big techy” words you should be able to understand the code as it’s pretty much English~
Let's take a smol look at the code~
Go to File 1 line 111 with the function “mintFromSale” (Won’t explain all of the function~)
This might look very confusing but it’s not soooo let's walk through this together line by line :3
(One of the more easily understandable functions)
Line 111 - “function mintFromSale(uint tubbiesToMint) public payable”
LINES 111 EXPLAINED:
Line 112 - require(block.timestamp > startSaleTimestamp, "Public sale hasn't started yet");
Line 113 - require(tubbiesToMint <= 5, "Only up to 5 tubbies can be minted at once");
LINES 112-113 EXPLAINED:
This part is pretty self-explanatory, right? Coding is basically English :P that’s what I think at least
Line 114 - uint cost;
Line 115 - unchecked {
Line 116 - cost = tubbiesToMint * 0.1 ether;
Line 117 - }
Line 118 - require(cost == msg.value, “wrong payment”);
LINES 114-118 EXPLAINED:
This is where *some* math is involved but it's super simple
And the rest ~ Lines 119-121 - I will not cover since it’s basically an error checker in a way + am lazy
Congratulations~ You analyzed one function of a smart contract! It’s really not that difficult if you put in some time <3 You got this if you really want to learn programming or anything don’t give upp.
Note* I’m still “new” in Solidity, howeverrr, I’m experienced in other coding languages~
You can ignore this part, just saying my thoughts ahaha
This I’m not too sure about, however, by doing some checking on Opensea and Foundation which you’re allowed to mint your NFT and put it on for sale (Implemented on the site).
I think that Opensea’s standard NFT Smart Contract thingy is ERC-1155 compared to Foundations ERC-721. Like there isn’t really THAT much of a difference between 1155 vs 721, it's just that if the NFT has a supply of 1 why doesn’t Opensea make it ERC-721.
Not 100% sure but I think the reason Opensea is using ERC-1155 is that they have polygon integration which allows users to mint X amount of the specific NFT and maybe they didn’t want to switch to ERC-721 for ETH mints idk lol you can tell me why, I’m just curious :shrug:
ETH (Remember to verify the website addresses!!, also not going to include all of themms)
Solana
If you haven’t heard about what rugs are then you’re lucky and you didn’t read T ^ T :claps:
Rugs, just think of these as a bad term. Rugs are basically people getting robbed of their money~ That’s the gist of it haha
Personally, I’ve been rugged a few times ahaha but you always have to learn from the past in order to improve and get better:D
So, I’ll give a few smol tips to recognize a Rug but most importantly you HAVE to do your own research okay? Do your research, please~.
The last few things I would like to bring to your attention would be scam links and honeypots!
Welp, I think that’s all? Thank you for reading! If you ever want to talk about anythingg I don’t mind ahaha my Dm’s are open~
I hope you guys enjoyed reading this and learned a thing or two, if not that’s fine :3
A special thanks to Cari, Deor, Ed, Splongk and Rain&Coffee for doing some proof reading and just overall helping <3
Thank you once again for reading this far, I appreciate you <3
https://www.web3.university/article/comparing-erc-721-to-erc-1155
https://etherscan.io/address/0xca7ca7bcc765f77339be2d648ba53ce9c8a262bd#code
Deor