Presentation is loading. Please wait.

Presentation is loading. Please wait.

Duke University and NBER

Similar presentations


Presentation on theme: "Duke University and NBER"— Presentation transcript:

1 Duke University and NBER
Innovation and Cryptoventures Logger Campbell R. Harvey* Duke University and NBER *Prepared with the help of Joey Santoro

2

3 Overview You are interacting with Ethereum (Testnet)
Manually check in each day via tx Contract knows who you are Campbell R. Harvey 2019

4 Overview Data are stored variables with important info
Public functions can either update data or view data Owner functions are only for admin use Campbell R. Harvey 2019

5 Logger Data owner_ : the address who can access owned functions
Currently set to Joey’s address: “0x25Cb ” addressToName : a map of your addresses to names wasInClass : a list of 12 attendance sheets, one/class Live : True if contract is open (during class) and False if not Class : number representing which class day it is Campbell R. Harvey 2019

6 Logger Data studentAddresses : list of addresses
registered : checklist for who has registered Notice no owner_ below: it is inherited other contract Campbell R. Harvey 2019

7 Link to Website Contract is called every time you push “Register” or “Check In” Web data is formatted into Ethereum transaction by MetaMask Website reflects contract data and updates Campbell R. Harvey 2019

8 Logger Public Functions : Register
Input a string called “name” Student is the message sender If not registered, add student and register Update name Campbell R. Harvey 2019

9 Logger Public Functions : CheckIn
Logger must be “live” Student must be registered Set wasInClass for today to “true” Campbell R. Harvey 2019

10 Logger View Functions Can view all data publicly
Chart uses getAttendanceDay function Campbell R. Harvey 2019

11 Logger Owner Functions
Only the owner can: Change the day Open/close the contract Check in another student manually Contract enforces this via “onlyOwner” Requires message sender to equal owner_ Campbell R. Harvey 2019

12 Etherscan.io Block explorer Nothing is hidden
Shows transactions, accounts, data, times, etc. Nothing is hidden Trying to game the system works against you... Campbell R. Harvey 2019

13 Etherscan.io Top box: people checking in on Friday Middle box: Joey
Bottom box... Campbell R. Harvey 2019

14 Sample Check In Success Friday - 12:30pm Call to CheckIn
Data = hash of function name 0xe8e... Campbell R. Harvey 2019

15 Joey’s Calls Open contract Change day (to day 4) 0xf18… Func: 0x827…
Input: Campbell R. Harvey 2019

16 Epic Fail Check in attempt 7:30 pm on Thurs We know who you are
0xe8e... Failed 7:30 pm on Thurs We know who you are Campbell R. Harvey 2019

17 Takeaways Smart contracts are robust databases
Complex financial and business logic Can’t break the rules All attempts are recorded Campbell R. Harvey 2019

18 Development plan Mobile app development over the summer
Harvest GPS information Proof of Attendance (PoAT) or Proof of Presence (PoP) Potentially, a more general idea. Store offers you $10 if you go to the store and spend at least five minutes in the store. Campbell R. Harvey 2019


Download ppt "Duke University and NBER"

Similar presentations


Ads by Google