Solidity workshop

15 March 2019

Ethereuem In early January I was reached out to by the nyc blockchain group asking if I could teach whatever I know about Solidity. I said yes. The audience was undergrads completeing coursework in project management and computer science. Not all of them knew what bitcoin was so I covered a lot of ground in a short amount of time.

Hopefully others find the recording useful. I enjoyed doing the event as it forced me to clarify my thoughts and research aspects of blockchain that were not clear to me. Below follows the notes I circulated with the audience.

Soldity Workshop

Prerequisites

Attendees should do the following before the event to get the most out of it. There will be a 20 minute lecture-overview at the beginning. You can do the prerequisites during the overview if you have not done so by then.

  1. install node.js (lts version is recommended)
  2. install git (use brew if on osx)
  3. install a code editor (vscode or atom.io)
  4. install the truffle suite $ npm install -g truffle
  5. install ganache
  6. install the chrome browser
  7. install the metamask chrome extension
  8. get test tokens for the Ropsten network via the faucet How to buy ethereum using metamask
  9. read first page of the solidity docs Introduction to smart contrats

Workshop

We will be going through the truffle tutorial Truffle Pet Shop

Questions that were asked during the workshop:

  • what is truffle? is there a lowerlevel way of making contracts?

Truffle suite is a popular collection of tools for smart contract development. You can think of it as ruby on rails or Django but for smart contracts. The suite makes many decisions for you. Once you learn more about smart contract development you are free to break those decisions. See using the compiler, dapp.tools and solidity resources

  • what are migrations and deploying? what’s happening here?

Keen audience members may ask themselves, if the blockchain is immutable how do we update our software? Migrations allow you to update your smart contracts by providing a thin abstraction that just holds a pointer (reference) to the body of your smart contract. When you want to update your smart contracts logic you can deploy the latest version as a new contract and update the reference in the original shim. For more details read demystifying truffle migrate.

  • how is blockchain/mining like a game?

It may have been an odd phrasing to call blockchain a game. I was trying to communicate that game theory is used a lot in this community to describe things. Bitcoin mining is also a race among all the nodes to find a solution to the math problem. For a good explanation of bitcoin watch 3Blue1Brown or Anders.

  • why is compiling making some json?

When you compile solidity, by default you get a binary and an application binary interface file (ABI). The abi is a json file describing the interface exposed by the binary. Json is just a popular file format, it could’ve been xml, yaml or any other format.

Lecture

The lecture-overview will provide background information on blockchain, smart contracts, the current state of the technology and possible future directions. The slides are at Solidity workshop slides

EVM diagram

Resources

Learning

Tools

  • Remix - browserbased soldity ide, very popular in the community
  • ethfiddle - like jsfiddle but for solidity, good for sharing code you’re stuck on
  • ethgasstation - online gas calculator for estimating your costs

Community

  • cryptonyc - local community, join the telegram chat!
  • chainhaus - local community, join the telegram chat!
  • nyc blockchain devs local meetup
  • nyc blockchain slack local ethereum slack (reason I’m here)
  • OpenZeppelin - contract auditors based out of argentina, considered the leaders in the field
  • trail of bits - local security firm, have positioned themselves as leaders in smart contract security auditing
  • empire hacking - security meetup, run by trailofbits
  • Solidity gitter - chatroom for discussing solidity code
  • Gitcoin - freelance gigs paid in cryptocurrency (good for resume building)

If you need help solving your business problems with software read how to hire me.



comments powered by Disqus