This meetup agenda covers an introduction to ERC20 tokens on Ethereum. The first part will be an overview of ERC20 tokens presented by Destry. They will discuss what defines a token and examples of existing ERC20 tokens like BAT, Augur, and OmiseGO. The second part will involve reviewing sample ERC20 smart contracts and the minimum requirements to create an ERC20 token, noting that copying and publishing existing code could create a new token. Risks discussed include malicious contracts and tokens only being as useful as the applications that support them.
1. TUCSON BLOCKCHAIN DEVELOPERS
MEETUP #2
Agenda:
15min - Introductions
30min - ERC20 Overview by Destry
15min - Discussion/Planning
Ground Rules:
1. No Prices. No Politics.
2. Don’t be an asshole.
This week’s sponsors:
Connect Coworking
Unchained-Capital.com
2. What’s a Token?
Blockchains have a native coin/token that the chain is built with. These
coins/tokens are required to execute transactions, send data, are rewards for
mining, etc.
But it may be possible to encode additional metadata in the chain which
represents a token.
Depending on the chain, this can be easy or hard.
4. Examples of ERC20 Tokens
https://etherscan.io/tokens - 34,000+ ERC20 tokens on the ethereum chain.
5. EOS
“Ethereum-killer” new Blockchain.
Launched a year-long open ICO - basically a pre-sale.
They will use the balances on the ERC20 as a starting balance on their own chain.
“The EOS Tokens do not have any rights, uses, purpose, attributes, functionalities
or features, express or implied, including, without limitation, any uses, purpose,
attributes, functionalities or features on the EOS Platform.”
6. AUGUR
Decentralized Prediction Market
The REP ERC20 token is used as their internal currency for determining the truth.
People ‘vote’ with their REP on what actually happened.
Aside: Oracles are hard.
8. BAT - Basic Attention Token
A token for paying web creators. Integrates with the Brave browser.
Basically a use-constrained currency. Get paid to view ads, pay content
producers, content producers sell tokens to advertisers.
Classic disclaimer - “BAT is not a digital currency, it is a utility token. “
11. 1. Ethereum.org example - https://www.ethereum.org/token
2. BAT’s token contract -
https://etherscan.io/address/0x0d8775f648430679a709e98d2b0cb6250d2887ef#code
3. AUGUR’s token contract -
https://etherscan.io/address/0xe94327d07fc17907b4db788e5adf2ed424addff6#code
Let’s look at some contracts
12. Things to look for
Balances and Allowances are stored in mappings:
Usually some SafeMath library is used to guard against overflows
Is issuance in the contract, or was that handled externally?
13. Could you print your own ERC20? (yes.)
1.Copy someone’s ERC20 code (or use the ethereum.org template),
2.Change the name of the token
3.Publish.
14. Dangerzone
1. The ERC20 contract can be malicious/broken
2. Owners need the ability to execute transfer() function.
3. The ERC20 is only as good as the application around it.
4. Tokens may look like stocks, but are usually closer to airline miles.