🚡

Crypto Dev Notes

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:
  • 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
  • image

  • 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:
    • image
    • 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:

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"?
      • 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.
    • What are miners? What do they do?
    • Austin: How does it work in the Proof of Stake world?
  • Limitations of Crypto seem really... big

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"
  • 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
    • Quote
      Customize your characters. It's what makes this fun + your own. For example, I added Leonardo DiCaprio and Pikachu as characters because I thought it'd be funny as hell lol — and I chuckle every time I see it haha.
    • 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
image

  • 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:

  • 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:
    • image
  • 10 minutes...? Can't wait for Solana
    • Comparison:
      • $0.00 of fees:
      • image
  • 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