Hardhat Tutorial
- Things we needed:
- Metamask, with a scary warning about not forgetting your keys
- Decent JS ecosystem understanding
- Following along at https://hardhat.org/tutorial/
- Successfully deployed!
- One transaction went from 0.3 to 0.2989 ETH = 0.0011 ETH cost
- Q: Where to go to view transactions? A: Apparently ropsten.etherscan.io:
- https://ropsten.etherscan.io/address/0x90dFe02cBC19a7896a31C3BDe5cF1dD301d13439
- Token contract address: 0x70EA8e1F2B76f53D72d73eCF30c94b35986c8766
- Smart contract = a bunch of code that is executed on "the blockchain". Think of it like a cloud function.
- Q: Now that my test contract is deployed, how do I move funds around?
- Guess: Set up another test Metamask wallet, and then...
- A: Can do so directly from Metamask. Convenient!
- Guess: balanceOf and transfer are reserved words, so Metamask understands how the contract works intuitively?
- A: Yeah, ERC-20 format includes these (but also has more)
- Notes: Counting sigfigs in crypto gas fees is realllly annoying
- Apparently $0.10 to transfer $400 โ dollars are much easier to understand
- ETH to USD extension?
- And then $0.55 to transfer 1337 MHT (toy token)
- Does it scale with amount of MHT? I doubt it, seems like flat fee for computation?
- Yeah โ 133700 tokens took $0.35:
- Transactions can take a bit of time on Ropsten โ eg 2min for this last one
- Q: So would people stock be implemented with 1 new token per creator?
- Pitch: IPO for yourself, with Creator Stock?
- Worry: too crypto-y, would prefer an easier onboarding experience
- ... After getting a new phone, MAKE SURE TO PASS AUTHENTICATOR ACCOUNTS
- This isn't auto-synced between phones ๐ So kinda locked out of Coinbase account
- One of the issues with Crypto โ "user error". At least Coinbase allows resetting
- Uploading ID, etc... big hassle
- Looking at Ethereum Name Services:
- Annoying to find austin.eth and austinc.eth already taken
- Plus, gas fees on akrolsmir.eth are super high (like $200): https://app.ens.domains/name/akrolsmir.eth/register
Tina's questions on Eth docs
- What is a Gwei?
- How does a transaction request make it into the block chain?
- Where does it get sent? Who does the routing?
- A: "Alchemy"?
- What are miners? What do they do?
- Austin: How does it work in the Proof of Stake world?
- Limitations of Crypto seem really... big
This is whereย Alchemyย comes in. Alchemy essentially helps us broadcast our contract creation transaction so that it can be picked up by miners as quickly as possible. Once the transaction is mined, it is then broadcasted to the blockchain as a legit transaction. From there, everyone updates their copy of the blockchain.
Buildspace notes (doing the NFT game)
- Really good to have a Discord to ask for help!
- That is actually active so I could get unstuck immediately
- Running
npx hardhat run scripts/sample-script.js
: Downloading compiler is taking a while... - Took like 5m?? With no progress bars ๐
- Assumes submitting a screenshot is trivially easy
- Not true! Maybe...
- Doesn't teach you about why you'd want to program a dapp
- Aka contract/dapp design is mostly about incentives, economics? vs tutorials are about mechanics
- When is a dapp right vs creating an NFT on opensea vs using an existing token with ethers?
- Each of the steps is relatively trivial
- Good to get constant feedback that things are going well, I guess...?
- Harder to make complicated mistakes when posting to progress, and allows easier async debugging. Kinda cool, actually
- Explanation of "What is an NFT"
- Not too bad, I guess? Hard to tell.
- Lessons don't do knowledge-checking ala Spaced Repetition, Andy Mutschak
- Emphasis on customizing:
- Hm as a pedagogical technique, not too bad. Ties into the "customization" aspect of e.g. MtG; "this is mine" and then the project becomes cooler
- Also: AD = attack damage? mind blown. Guess it's a League thing. "AD Carry" makes so much more sense.
- Faucet: Getting some starter crypto for a testnet is kinda a PITA
- Also Alchemy, etc... annoying but I guess shrug
- Q: What is "memory" in solidity?
- Where to write the data to, a bit cheaper than actual storage (from Stackoverflow)
- Minor note: Had to add
0x
to the front - Clever: By making access exclusive/timed to a cohort, referral links become a premium, scarce resource. I now could e.g. send this to Michael to have someone to work together with this
โฃ
- Overall: reminds me of Google. "Easy things are now hard, but impossible things are now hard(?)"
Idea: Better 0 to 1 Crypto onboarding
- Who is the target audience?
- Pre 61A
- 61A
- CS/Bootcamp devs
- Current JS devs
- Buildspace definitely relies on a decent amount of programming/Javascript knowledge
- Would be possible to set up a no-code intro to dapps?
- Would it be helpful? Maybe the correct starting points would be "learn to code from Codeacademy"
- Interacting with the blockchain through a better visualizer than opensea??
- More like stately? more visual?
Notes @October 29, 2021 โ doing the boss component
- Why isn't there a etherscan for local deployment/hardhat?
- Or maybe there is, haven't found it...
- Deploying is kinda slow?
- Moreover... is seeing the results slow? Like having the rinkeby transaction actually go through
- Nice โ failed transaction came out with some kind of error thing
- Also updating in opensea takes like 10m? annoying for dev experience
- Seems like each deploy is creating new NFTs?
- Once a contract is deployed, how do I continually modify?
- Probably will find out in the react section
- Hm, issue:
- https://testnets.opensea.io/assets/0x3acaa88639eca885b19bd9be44d028b2d0ae3d91/1
- doesn't have the pikachu hits? or it STILL hasn't updated since 30m in
- Final deployed: 0x256C62F591dfC21983a8070b001786A4226589AC
- Tracking this is kinda annoying? though maybe it's available on etherscan atm
- Pretty impressed with complete project cloning through replit: https://replit.com/@adilanchian/nft-game-starter-project?v=1
- Really good tutorial experience!
- vs trying to make sure everyone's env is set up right
Crypto usage notes
- Paying $15 ETH gas fees for moving amount from Coinbase to personal wallet....
- Whoops, waited too long, now it's $21 of fees:
- 10 minutes...? Can't wait for Solana
- Comparison:
- $0.00 of fees:
- Did need to set up a second wallet
- Trying to register an ENS domain: akrolsmir.sol
- $300 in gas fees...
- Thought it would be cheaper because of this article, but the transaction looks faked...?
- Or maybe a recycled article, since the expiration date was way back when
- Trying to register an SOL domain: akr.sol
- $1 SOL costs to register, and then it starts an auction...?
- Definitely not as smooth as buying a domain name from e.g. Namecheap
- Polygon: A Layer-2 network (aka scaling solution, Ethereum Virtual Machine compatible)
- Used by Polymarket to offer zero trading fees