Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Solidity workshop

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 https://blog.bankex.org/how-to-buy-ethereum-using-metamask-ccea0703daec
  9. read first page of the solidity docs https://solidity.readthedocs.io/en/v0.5.2/introduction-to-smart-contracts.html

Workshop

We will be going through the truffle tutorial https://truffleframework.com/tutorials/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, https://dapp.tools/dapp/ and https://solidity.readthedocs.io/en/v0.5.2/resources.html

  • 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 https://bit.ly/2FkePe5

EVM diagram

Resources

Learning

Tools

Community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment