+ - 0:00:00
Notes for current slide
Notes for next slide
  • The title for tonight's session is "Solidity", but we'll be doing more than that
  • We'll also be covering the different tools used when developing solidity
  • And we'll also have a guest speaker joining us later in the session?
  • Mean while, I'd like everyone to scan this QR code, or type out that shortened URL - bit.do/dadc-s01e04 - that will open up the same slide deck that I am presenting from on your computers, and this will be essential to do and follow along, because there are going to be a lot of links to follow
  • in the previous session, we wasted quite a bit of time communicating the URLs so this time, we're going to not do that. grab this link now, or get it from our discord

DApps Dev Club S01E04 deck QR code

scan me! - you'll need to follow the links

bit.do/dadc-s01e04

1 / 73

Decentralised Applications Development Club

DApps Dev Club

Solidity

09/04/2019

2 / 73
  • The title for tonight's session is "Solidity", but we'll be doing more than that
  • We'll also be covering the different tools used when developing solidity
  • And we'll also have a guest speaker joining us later in the session?
  • Mean while, I'd like everyone to scan this QR code, or type out that shortened URL - bit.do/dadc-s01e04 - that will open up the same slide deck that I am presenting from on your computers, and this will be essential to do and follow along, because there are going to be a lot of links to follow
  • in the previous session, we wasted quite a bit of time communicating the URLs so this time, we're going to not do that. grab this link now, or get it from our discord

DApps Dev Club S01E04 deck QR code

scan me! - you'll need to follow the links

bit.do/dadc-s01e04

3 / 73
  • This is where you can find our discord link. It's on our homepage - dappsdev.org - near the top, before the blog posts

Install these!

5 / 73
  • So in the previous session, I asked all of you to install a bunch of stuff
  • and here's that list again
  • can I have a show of hands, for how many have actually installed all of these things?
  • ok so for the rest, did any of you encounter any issues while trying to install it?
  • and if you haven't quite gotten around to it yet, well let's get that out of the way before we start, while we're waiting for people to trickle in, might as well put the time to good use
  • ok so if anyone here has had trouble installing node, solc, truffle, or ganache, please raise your hands, and I'll try my best to help you to troubleshoot in the next few minutes
  • Also, for those of you who are joining us in our DApps Dev Club session for the very first time - welcome!
  • We are a technical book club, and we run our sessions twice per month - and a book club implies a book, well this is the book
  • Mastering Ethereum by Andreas Antonopoulos & Gavin Wood
  • This is the line up for tonight's session
  • We'll start off by introducing our partners, and ourselves
  • Then do a quick recap of the previous session
  • Then we'll cover solidity, the programming language
  • Then we'll cover ome tools that are used to work with solidity: solc, truffle, and ganache
  • Then we'll have our guest speaker, Alex
  • And finally we'll wrap up with a recap, and our next session

Partners

8 / 73
  • Before we begin, let us thank all of our partners who made this session possible

Partners

LLI

Lifelong Learning Institute

9 / 73
  • The DApps Dev Club is happy to announce that the Lifelong Learning Institute is partnering with us. We have Dr Leong, who is the Principal Manager at LLI, to tell us a bit about what they do, their Learning Circles program, and SkillsFuture.
  • Dr Leong: __
  • Dr Leong: (presents slide deck)
  • Thank you very much Dr Leong. As mentioned, the DApps Dev Club is under the Learning Circles program, which I think is a really good fit for anyone running tech meetups - so if you're part of another group, and I know that many of you are, tell your organisers about it!

Partners

LLI

Chainstack

Chainstack

Acronis

10 / 73

Partners

LLI

Chainstack

BitTemple

BitTemple

11 / 73

Partners

LLI

Chainstack

BitTemple

NBC'19

National Blockchain Challenge '19

12 / 73

Partners

LLI

Chainstack

BitTemple

NBC'19

Spartan

Spartan Group

13 / 73

Partners

LLI

Chainstack

BitTemple

NBC'19

Spartan

StartupToken

StartupToken meetup

14 / 73

Partners

LLI

Chainstack

BitTemple

NBC'19

Spartan

StartupToken

EngineersSG

Engineers.SG

15 / 73

Intro

16 / 73
  • Before we go into the the topics, for the benefit of those who are attending the their first session today

Intro

DADC

DApps Dev Club

  • Decentralised Applications Development Club
  • Format inspired by the technical book club from SingaporeJS
17 / 73
  • The DApps Dev Club meets twice a month, and this is our 4th session
    • In each session, we plan to discuss about 3 or four different topics, selected from the Mastering Ethereum book
  • We are a technical book club, so in each session, when we meet up together, we'll be discussing select parts from this book, plus working through things together
    • I should mention that while this is not a common format, it isn't completely new - in fact it is inspired by the book club that the SingaporeJS meetup runs
    • In the first couple of sessions, it was mostly me talking, but the rest of the sessions are going to be hands-on

Intro

DADC/2

18 / 73
  • The nexus for all the club happenings are on this website, dappsdev.org
    • The main thing to look out for on the website are the news feed, which you can subscribe to via the RSS feed, or check back on manually
    • The other thing to look out for on the website is the sessions page, which is a calendar for all of the events
  • Apart from meeting in person, we can also have discussions online
    • We have a discord server for that, and you can join using the link found on our website
  • As mentioned earlier, the book which we're covering together is Mastering Ethereum, which is written by by Andreas Antonopoulos & Gavin Wood
  • Andreas Antonopoulos is the author of the Mastering Bitcoin book, and Gavin wrote most of the initial implementation of Ethereum itself.

Intro

DADC

Book

Kenneth

  • CTO of Baypay
  • Also runs the Blockchain&DApps meetup

Kenneth Hu

20 / 73
  • Kenneth is the CTO of Baypay
  • He knows the Ethereum stack inside out
  • He also runs a blockchain events across Taiwan, Malaysia, and Singapore

Intro

DADC

Book

Kenneth

Brendan

  • Started DApps Dev Club
  • NodeJS developer
21 / 73
  • I'm Brendan, and I work as a software engineer
  • Spend most of my time doing NodeJs
  • Met Kenneth through the EthSG hackathon last year
  • We decided to collaborate and create a series of educational blockchain meetups, and here we are

Intro

DADC

Book

Kenneth

Brendan

You!

  • No blockchain knowledge required
  • No solidity or smart contract knowledge required
  • Basic Javascript needed in session #05
22 / 73
  • So, how about you? These sessions are designed with a particular audience in mind.
  • If you know nothing about blockchain, or about smart contracts, that's perfect
  • However, if you don't know some basic JS, you'll need to pick that up to follow along in the later sessions.
    • I've already posted some resources that you can use to learn JS - it's in the latest post on dappsdev.org now, or come talk to me, or ask around in our discord
  • Bring your laptops to the sessions, as you'll be able to participate in the hands on parts of the sessions

wen ico? wen moon?

Ya Basic - The Good Place

23 / 73
  • I think most of us by now have encountered someone on a Telegram group, who joins, and within seconds says "wen ico? wen moon?" (with that exact spelling)
  • If you're that person, these sessions are not for you. We're not going to be building an ERC20, or learning how to trade or speculate on them.
  • What we're about here is focussed on developing decentralised applications
  • This is a great show by the way, it takes real skill to take a subject matter that dry and make it entertaining

Intro

DADC

Book

Kenneth

Brendan

You!

Noticed

24 / 73
  • Session #02 was held at Chainstack as well, and they tweeted about it
  • And it looks like DApps Dev Club has been noticed by an author of the book we're using as our reference material for our sessions!

/intro

25 / 73
  • Q&A
  • (check if any of the sponsors have arrived after their slot, backtrack to them)
  • (attendance)

Recap of Session #03

26 / 73
  • Before we begin the topics for this session, I'd like to do a quick recap of what we did in the previous session
  • That was initially planned to be an introduction to Solidity, but we ran out of time during the session. Retrospectively, I would call the previous session "talking to Ethereum" instead.
  • Some of you commented that the previous session was too slow paced, and Vedant had an excellent suggestion where he said why not have the ones who finish first help the others, so as to speed things up? So I guess you're going to be our first volunteer Vedant!
  • Also, tonight we have a guest speaker, Alex, which is great, but it also means that we need to be more strict about time. So tonight, the tempo is going to be a little faster, let's see how it goes, and if we don't like it, we can switch back in our next session.

#03

Stacks

  • (2 * 3) + 4
  • EVM's stack based execution model
  • Post-fix notation
27 / 73
  • First, we talked about the stack based execution model used by the EVM
  • We took a simple arithmetic operation: 2 times 3 plus 4, and looked at how they would be represented in EVM bytecode, and then stepped through its execution, one stack operation at a time, advancing the program counter
  • Of course it gets a lot more complicated than this, but that fundamentally illustrates how the EVM works at a low level

#03

Stacks

Key Gen

  • Cryptographic Key Generation
  • BIP39, BIP44, BIP32
28 / 73
  • Next we took a look at generating cryptographic keys using seedphrases
  • This was a hands-on activity, where we all used generated an entire table full of keys
  • Since the method to generate keys is described using these various standards - BIP39, BIP44, BIP32 - any wallet software that is compliant with those standards works too

#03

Stacks

Key Gen

MetaMask

  • Ethereum wallet software
  • Browser extension
29 / 73
  • Next we installed MetaMask, which is Ethereum wallet software
  • It also is a browser extension at the same time
  • This is currently the most common way to interact with Ethereum DApps, where the web app runs in the browser, and then, when a transaction needs to be sent to the network, MetaMask prompts you before signing it, and propagates it to the Ethereum network

#03

Stacks

Key Gen

MetaMask

Simple Tx

  • Send Ethers to each other
  • Write arbitrary data onto the blockchain
30 / 73
  • Once we had MetaMask all ready to go, we all took it for a spin, by using this demo DApp (which cannot truly be called a proper DApp, as there is no smart contract), to sign and send transactions
  • We all went onto our group chat, and entered our (test net) Ethereum adresses there, and then sent Ethers to each other
  • Some of us also added arbitrary data to these transactions, so we used Etherscan to examine these transactions, and look at this arbitrary data

#03

Stacks

Key Gen

MetaMask

Simple Tx

Games

  • Crypto Zombies
31 / 73
  • Then we talked a bit about crypto kitties, and crypto zombies
  • Who here went home and gave crypto zombies a spin? Was it fun?

/recap

32 / 73
  • Q&A
  • so that now brings us to tonight's session, but before we go into that, are there any questions that we have from the previous session, that were left unanswered?

Solidity

33 / 73

-

Solidity

Recap

  • Write smart contracts in a high-level language
  • Stack-based execution model in EVM
  • Code + State blockchain demo
34 / 73
  • recap: what is a smart contract
  • solidity as a high level language that compiles to EVM bytecode
    • human readable, vs machine executable
  • recap: simple arithmetic operation from EVM stack-based execution example
  • recap: code + state - code is immutable, state is mutable

Solidity

Recap

Contrast

  • Classes in OOP
  • Enforce certain functions only called by certain accounts
  • Retrieve state, mutate state
35 / 73
  • comparison to classes and instances from OOP
  • additional capabilities: enforce that certain functions are only callable by certain accounts by looking at the address which signed the transaction
  • standard capabilities: call a function to retrieve or mutate state, or just perform a "pure" function

Solidity

Recap

Contrast

Tools

  • Remix is limited
  • Try installing a syntax highlighter plugin
    • VS code, Atom, vim, emacs, etc.
36 / 73
  • Remix is good enough for a certain level of complexity
  • While we will be staying in very simple territory, later we'll be introducing development tools which are powerful enough to do complex work.
  • Note that tonight's session does not aim to be a thorough treatment of the Solidity language, rather it is an introduction
    • For example, we will not be covering inheritance, interfaces, libraries, etc.
  • IDE: remix only gets you so far, get vscode (or atom, etc) with plug in for syntax highlighting, just like you would for any other programming language

Solidity

Recap

Contrast

Tools

Hands-on

37 / 73
  • Now we're all going to start of my exploring building a very simple smart contract in Solidity within Remix
  • While this smart contract is simple, it covers a large range of of different language features that are available
  • As mentioned before, we're not going for a thorough treatment of the language, and instead going for an introduction to the various aspects of it
  • So let's all open up both remix, and the hands on from the DApps Dev Club session, in different browser tabs
    • Note that these don't exactly work very well on mobile, so please use your laptops
  • (check that everyone has opened their tabs)
  • value types: bool, int, uint, address, address payable, bytes
  • reference types: struct, fixed size arrays, dynamic sized arrays, mapping
  • visibility: public, internal, private
    • talk about auto generated accessors

example

  • start with primitive types to model a car.
    • colour: byte (hex)
    • doors: uint16
    • make: string
    • year: uint16
    • mileage: uint256
    • lat: uint
    • long: uint
    • status: enum
    • owner: address
  • then introduce more complex types
    • put car into a struct
    • then have cars as a dynamic array
    • also show how to have cars as a mapping
  • then introduce functions
    • add car
    • drive car
    • paint car (changes colour)
  • then introduce events
    • reference the Eiffel programming language
    • function contracts defined as invariable statements or expressions
    • modifiers are intended to do the same thing
  • then introduce events
    • for new car
    • for honk (at another car)

Solidity

Recap

Contrast

Tools

Syntax

Eiffel

class interface ACCOUNT create
make
feature
balance: INTEGER
...
deposit (sum: INTEGER) is
-- Deposit sum into the account.
require
sum >= 0
ensure
balance = old balance + sum
withdraw (sum: INTEGER) is
-- Withdraw sum from the account.
require
sum >= 0
sum <= balance - minimum_balance
ensure
balance = old balance - sum
may_withdraw ...
end -- class ACCOUNT
39 / 73
  • Right now, we are learning about Solidity, but I thought it might be interesting to bring up a different programming language, Eiffel, because of the very interesting parallels that it has with smart contract programming in Ethereum
  • This snippet of code that we have here on the screen features a class "ACCOUNT", with "deposit" and "withdraw" functions.
  • Code syntax is very similar to Pascal, unlike Solidity, which is very similar to Javascript or C
  • What is interesting here is that the designer of the language baked in a concept into the language spec called "design by contract", which allows the programmer to specify pre-conditions, post-conditions, and class invariants, and actually have this enforced by the compiler and at run time
  • when programming smart contracts in ethereum, I think it is extremely helpful to keep the concept of "design by contract" in mind
  • In previous sessions, some of you have asked me about what the phrase "smart contract" means, and many think it is about code to implement legal contracts, financial contracts, etc
    • Which is right, however, I think that "contract" in smart contract should also be viewed through the lens of Eiffel's definition of "Design by Contract", so I'd encourage you to have a read of that article!
    • especially in the context of function modifiers, require statements, etc

Solidity

Recap

Contrast

Tools

Syntax

Eiffel

Example

function honkCar(uint256 carId, uint256 otherCarId)
public
onlyCarOwner(carId)
{
require(cars[otherCarId].owner != address(0x00), "other car must exist");
emit CarHonk(carId, otherCarId);
}
40 / 73
  • here this function sort of shows a large number of the different language features that solidity has
    • syntax - highlight the following areas:
    • name, return type, params, and their types, modifiers
    • built in modifiers:
    • specifier: public, internal, private, external
      • draw this in a quadrant diagram
    • indicator: view, pure
    • your own custom defined modifiers
    • events
  • not covered
    • signature
    • based on name plus param types
    • note on hash collisions
    • fallback function
    • payable function
    • constructor
    • reference compiled byte code vs deployed byte code difference

Solidity

Recap

Contrast

Tools

Syntax

Eiffel

Example/2

\

Solidity Function Anatomy

41 / 73
  • syntax - highlight the following areas:
    • name, return type, params, and their types, modifiers
  • built in modifiers:
    • specifier: public, internal, private, external
    • draw this in a quadrant diagram
  • your own custom defined modifiers
  • indicator: view, pure
  • events

not covered

  • signature
    • based on name plus param types
  • note on hash collisions
  • fallback function
  • payable function
  • constructor
    • reference compiled byte code vs deployed byte code difference

Solidity

Recap

Contrast

Tools

Syntax

Eiffel

Example

Others

42 / 73
  • There are many other language features within solidity which we simply will not have enough time to go through in a single session. Solidity as a language has a lot of other things that other programming lnaguegs have as well.
  • The list above itself is just a subset - the stuff that you are most likely to encounter
  • Please read these bits within the solidity documentation after the session, as we probably will encounter these in later sessions

/solidity

43 / 73
  • Q&A
  • solidity outro

solc

44 / 73
  • what's coming up:
  • what does solc do?
  • set up
  • what is the ABI?
  • hands on
  • also, later on, alex, will talk about what the compiler does in a bit more depth, so stay tuned till the end of the session

solc

What

  • Solidity compiler
  • Input: Solidity
  • Outputs: EVM bytecode + ABI
45 / 73
  • The compiler takes a high-level language, in this case solidity, and turns it into a low-level language, in this case the EVM byte, which can be executed by the EVM
  • One interesting thing that it does, is to also generate an Application Binary interface as well (next slide)

solc

What

ABI

function honkCar(uint256 carId, uint256 otherCarId)
public
onlyCarOwner(carId) {
require(cars[otherCarId].owner != address(0x00), "other car must exist");
emit CarHonk(carId, otherCarId);
}

Canonical function signature:

honkCar(uint256,uint256)

Method ID - first4Bytes(keccak256(canonicalFuncSig)):

0x6977eaaa

(hash collisions can occur)

46 / 73
  • We've already talked about the EVM byte code quite a bit in the previous sessions, but so far we haven't really talked about the ABI yet. In fact I've put off answering questions about the ABI twice so far - so now we'll actually get ot it.
  • The ABI is needed for clients (think web apps), as well as other contracts, to invoke functions on the compiled contract.
  • This is necessary because when you have a bit of compiled EVM bytecode, and you wish to call a function, which part of the byte code do you execute? Where do you place your program counter? That's what the ABI does, it specifies this mapping
  • To go into a bit more detail - you cannot use the function names directly, because they do not exist within the compiled EVM bytecode, but instead are stored as the first 4 bytes of the hash of the canonical function signature

solc

What

ABI/2

{
"constant": false,
"inputs": [
{
"name": "carId",
"type": "uint256"
},
{
"name": "otherCarId",
"type": "uint256"
}
],
"name": "honkCar",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x6977eaaa"
}
  • ABI is output as JSON
  • This is the part of the ABI for the honkCar function
  • signature is the Method ID
47 / 73
  • So what's in the ABI is basically a mapping of all the method IDs for each of the function signatures, along with other metadata about the functions. For those who have done C programming before, you can think of this as a header file that is generated from the implementation automatically.
  • A client who doesn't have the original solidity source code of the smart contract it is calling, or does not want to compile it itself, would need the ABI to be able to interact with the smart contract - other wise it is just trial and error
  • We won't be going into the exact call semantics and how the client makes use of the ABI, so please read the ABI specification docs, which does a very thorough job of explaining this
  • web3js - which we talked about in previous sessions, but will only go into detail in in session #06 - will be given this ABI and the address at which the smart contract is deployed, and then it will parse the ABI and know how to invoke functions at that address.
  • At this point, that is what we really care about

solc

What

ABI

Setup

  • via package managers
  • via npm
  • compile from source
48 / 73
  • There are a few different ways that you can set up solc
  • You should install using a package manager used in your operating system, e.g. brew on mac, or apt-get, yum, etc on unixes
  • Show of hands - who has installed everything already?

solc

What

ABI

Setup

Hands-on

Time to give solc a spin!

49 / 73
  • Time to crack open your laptops!
  • Let's follow the link to this hands on, and follow along

/solc

50 / 73
  • Q&A
  • solc outro

Ganache

51 / 73
  • start off with a list of the tools, and how they work together
    • make a systems diagram for this
    • browser, MetaMask, ganache, truffle, solc
  • walk through set up process
  • explain that you can set up your own localhost ethereum test net using geth... but that will be an entire session in itself
  • explain what the purpose of ganache is
    • simulates a single ethereum node that you can connect to, send transactions to, etc
    • in a real ethereum node, e.g. if you run geth, that will broadcast its transactions to other nodes in the same network
    • in ganache, OTOH, it simply skips all of that, and it is a single node network
    • super fast compared to the real ethereum networks
    • integrates neatly with other development and testing tools, geared for development/ testing on localhost
  • mention BIP39 again
  • ask who is familiar with test-rpc
  • walk through setting up MetaMask to talk to it as well

Ganache

Tools

Smart contract development tools

Smart contract development tools

52 / 73
  • We've just tried out solc, the Solidity compiler. However, in order to develop DApps, we need a lot more than just the ability to compile. There is an entire set of tools that are necessary, and solc is just the first one.
  • Tonight we'll be also talking about ganache and truffle, two other tools that we will be using
  • In the previous session, we've talked about MetaMask, and in two sessions from now we will be covering web3.js in detail
  • This is how all of these tools fit together, while you are developing
    • solc compiles solidity and produces byte code and ABI.
    • truffle is used to manage the running solc (you don't have to run the compiler yourself directly), manage deploying the compiled contract to the blockchain, and provide you with a REPL to interact with the deployed contracts directly.
    • ganache is a tool that provides you with a fuss free simulate blockchain on localhost.
  • Note that this is not the only way to develop, there are indeed other ways, but this seems to be the most popular, or even default, preferred by solidity developers today

Ganache

Tools

What

  • Simulates an Ethereum network
    • Including the EVM
  • Creates several test accounts
  • Runs on localhost
53 / 73
  • So what does ganache do? It simulates an entire Ethereum network, including both the blockchain, and the the EVM
  • It also creates a bunch of accounts pre-populated with Ethers, which makes it super convenient for testing, but we'll get to that in our next session
  • For those of you who have previously attempted to run this on localhost, using geth, you might remember how much time this takes to do - many many hours - so you'll be happy to learn that the set up for ganache is literally a few minutes long
  • geth gives you a real Ethereum nodes, but for local development purposes, this is usually overkill. on the other hand, ganache is just right

Ganache

Tools

What

Setup

54 / 73
  • Alright, let's do this, let's install ganache
  • It's super quick to get set up, you just download the appropriate installer for your operating system, and run it
  • How many of you here have already installed this on your computers prior to the session?

/ganache

55 / 73
  • Q&A
  • ganache outro

truffle

56 / 73
  • truffle intro

Truffle

Setup

npm install --global truffle
57 / 73
  • walk through the setup process

Truffle

Setup

What

  • Configure multiple environments
  • Manages compilation
  • Manages deployment
  • Test harness
  • REPL to interact with contracts
  • Integrates with ganache well
58 / 73
  • truffle is a smart contract development tool that can really be thought of as a collection of tools - a meta-tool if you will
  • It manages the compilation and deployment of smart contracts. You don't need to run solc directly, neither do you need to send the compiled EVM byte code to the 0X00 address any more
  • It also provides a test harness, which is essentially mocha wrapped with some smart contract stuff injected by truffle, which we'll get to in the next session.
  • It also gives you a REPL, or a read-eval-print-loop, that allows you to interact with your smart contracts within your terminal
  • It also interfaces with ganache realy well
  • Note that depending on who you talk to, you might get rather varied opinions on whether truffle is suitable for use on the Ethereum main net. Many hold the opinion that it is not, and that you should only use it for localhost dev, or for localhost plus staging (test net) dev, but never for production (main net).

Truffle

Setup

What

Hands-on

59 / 73
  • OK time to crack open our laptops again, this one will be our most involved hands on session tonight

Truffle

Setup

What

Hands-on

Tools

Smart contract development tools

60 / 73
  • OK so now we have gone through all of the hands on sections for tonight, and we have seen all the tools in action. With truffle, we have yet to use it fully - we'll get to the other main thing we use it for in the next session of DApps Dev Club
  • For now I think it is worth doing a recap of how all the tools sit together again.
  • round up with a list of the tools, and how they work together
    • show the same systems diagram from earlier
    • browser, metamask, ganache, truffle, solc

/truffle

61 / 73
  • Q&A
  • truffle outro

Alex

62 / 73
  • Make sure that AV is set up and ready to go

Alex

Intro

  • EthSingapore
  • Authio
  • Costa Rica
  • … DApps Dev Club
63 / 73
  • So I met Alex at EthSingapore. He's the lead engineer at Authio, which does smart contract auditing and development
  • His passion for education comes across immediately - he's running a school in Costa Rica to teach kids there about computers
  • When I told him about what we're doing at DApps Dev Club, he immediately volunteered to help. In fact, we're likely to collaborate on more things than tonight's session, so watch this space.

Alex

Intro

Topic

  • How Solidity works
  • Inline assembly
  • Complex data structures
  • Guarantees
64 / 73
  • So let's hear it from Alex!
  • (switch over to zoom call)

/alex

65 / 73
  • Thank you so much for coming on tonight Alex!
  • (Q&A) Does anyone have any questions for him?
  • Thanks to Alex for staying up super late/ waking up really early in his timezone, and bringing us through those things he did with such great depth!

Next

Recap

  • Solidity: structure, variables, functions, events
  • Development Tools: solc, truffle, ganache
  • Alex: Solidity and EVM under the hood
66 / 73

-

Next

Recap

S01E05

67 / 73
  • So our next session will be on the 4th Tuesday of the month, at BitTemple, check out the details on the sessions page on our website

Next

Recap

S01E05

Hands-on

68 / 73
  • The topic that we are covering in our next session - testing smart contracts - does not have its own dedicated section in the Mastering Ethereum book. However, Chapter 7 is still relevant, as we will still be looking at Solidity. So re-read it if you have already, and read it if you haven't yet!
  • The main thing that will be needed in the next session is some Javascript. In our DApps Dev Club sessions, we do teach Solidity from scratch, but we will not* teach Javascript in the same way - you will need to know how to write some at a very basic level. But fret not, you can get up to speed extremely quickly, using the resources that you see on the screen.
    • In order of least time commitment to most: We have scrimba, exercism, and freeCodeCamp.
    • Scrimba is more of a basic introduction, exercism is set up as a "daily puzzle" type thing, and freeCodeCamp is a full-on course that goes from A-Z
    • If you don't have a lot of time to spare, just do the course on Scrimba that's linked here.
  • Finally, there's one piece of software that you'll need to get acquainted with, and that is mocha, which is a framework for writing and running tests in Javascript
    • This is what we'll be using to test out smart contracts, so it might be worthwhile at least running through their getting started guide ahead of the next session, so that you are primed and ready to go

Next

Recap

S01E04

Hands-on

Setup

69 / 73
  • Finally here's a list of all the tools that we will be making use of in the next session
  • I've split them into tools which we have not encountered yet and needs to be installed, which is just Mocha
  • … and tools which we should have already encountered, installed and used. If you have not got these working yet, please talk to me after the session, and I'll help you to troubleshoot.

Next

Recap

S01E04

Hands-on

Setup

Q&A

Questions?

70 / 73
  • Before we wrap up, do you have any questions?
  • Is you think of some questions later, or already have them, but prefer to type instead, head over to our discord, the link is right there!

Thanks!

Lifelong Learning Institute & SkillsFutureSG, Chainstack & Acronis, BitTemple, NBC'19, Spartan, StartupToken, EngineersSG, and Blockchain&DApps

71 / 73

Thanks!

Alex Towle

72 / 73

DApps Dev Club

dappsdev.org

73 / 73
  • be sure to check out the sessions page for updates, and join our discord
  • Q&A
  • any other announcements?

Decentralised Applications Development Club

DApps Dev Club

Solidity

09/04/2019

2 / 73
  • The title for tonight's session is "Solidity", but we'll be doing more than that
  • We'll also be covering the different tools used when developing solidity
  • And we'll also have a guest speaker joining us later in the session?
  • Mean while, I'd like everyone to scan this QR code, or type out that shortened URL - bit.do/dadc-s01e04 - that will open up the same slide deck that I am presenting from on your computers, and this will be essential to do and follow along, because there are going to be a lot of links to follow
  • in the previous session, we wasted quite a bit of time communicating the URLs so this time, we're going to not do that. grab this link now, or get it from our discord
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow