Building Smart Contracts with Remix

@ninabreznik                @serapath

Ballot Dapp Workshop

bit.ly/remix-workshop-repository

Install Metamask

chrome.google.com/webstore

Login to Metamask

Ropsten test network

Let's get started

Set environment

Run tab: Environment = Injected web3 (Ropsten)

Load files to Remix

remix.loadgist('2bf3...')

remix.loadgist('2bf3c8833eac0814cf3aa1672217b6fb')

Open file

gist/dependencies.js

Load dependencies

remix.exeCurrent()

See new folder

github/OpenZeppelin/contracts

Open file

gist/AwardToken.sol

Compile the contract

Compile tab: Start to compile button

See compiled contracts

AwardToken + all dependencies

Deploy the contract

Run tab: Deploy button

Confirm the transaction

Submit button

Check if tx is mined

Terminal logs in Remix

See autogenerated UI

Interactive UI for AwardToken.sol contract

Start a new Ballot

Execute startRound transaction

Confirm the transaction

Submit button

Check if tx is mined

Terminal logs in Remix

Expand tx log

Terminal logs in Remix

Get ballot's address

Execute currBallot call

Copy ballot's address

currBallot output

Switch to Ballot

Run tab: dropdown

Access  Ballot contract

Paste address + click At Address

See autogenerated UI

Interactive UI for Ballot.sol contract

Add a new proposal

Expand addProposal function

Copy your address

Run tab: Account

Type the proposal

Write inputs in string format

Add your address

Paste the address

Execute addProposal

transact button

Confirm the transaction

Submit button

Check if tx succeeded

Terminal logs in Remix

Execute getProposals

getProposals call

See Proposals Addresses

Terminal logs in Remix

Vote for one Proposal

Paste Proposal Address you want to vote for

Execute vote transaction

vote button

Confirm the transaction

Submit button

Check if tx succeeded

Terminal logs in Remix

Let's try it out

Let's check results

Thank you

@ninabreznik @ryestew @yann300 @serapath @iurimatias

Edcon presentation/workshop

By Nina Breznik

Edcon presentation/workshop

  • 1,364