SlideShare une entreprise Scribd logo
1  sur  16
How to create an
Ethereum Token
Roger
What's an ICO/Token Lunch?
◈ Initial Coin Offering
◈ A fundraising tool that trades future cryptocoins in exchange for
cryptocurrencies.
◈ Case
⬥ Basic Attention Token
(USD 35 million in 24 seconds)
⬥ Status
(USD 100 million in 1 hour)
2
Why ICO/Token Lunch?
◈ For company
⬥ The company can raise funds
⬥ The value of the token will change with the company's future development
◈ For investors
⬥ Use the token in exchange for product use rights
⬥ Sell the token, earn the spread from it
3
ERC-20 Token Standard
◈ ERC-20 defines a common list of rules for all Ethereum tokens to
follow.
◈ ERC-20 will allow dapps and wallets to handle tokens across
multiple interfaces/dapps.
4
ERC-20 Specification
◈ function totalSupply() constant returns (uint256 totalSupply)
◈ function balanceOf(address _owner) constant returns (uint256 balance)
◈ function transfer(address _to, uint256 _value) returns (bool success)
◈ function transferFrom(address _from, address _to, uint256 _value) returns (bool success)
◈ function approve(address _spender, uint256 _value) returns (bool success)
◈ function allowance(address _owner, address _spender) constant returns (uint256
remaining)
◈ event Transfer(address indexed _from, address indexed _to, uint256 _value)
◈ event Approval(address indexed _owner, address indexed _spender, uint256 _value)
Github: zeppelin ERC-20 Standard Token
5
Create your own ethereum token
◈ Inherit Standard Token
◈ Basic Parameters
// A Plan Coin
string public name = "A Plan Coin";
string public symbol = "APC";
uint8 public decimals = 18;
// Crowdsale details
address public beneficiary; // Company addres
uint256 public minAmount = 10 ether;
uint256 public maxAmount = 95279487 ether;
uint256 public minAcceptedAmount = 40 finney; // 1/25 ether
contract APCToken is Owned, StandardToken { . . . }
6
Create your own ethereum token (cont.)
◈ Exchange Rate Parameters
◈ Solidity Time Unit
// Eth to APC rate
uint256 public rateAngelMinutes = 650;
uint256 public rateFirstMinutes = 550;
uint256 public rateSecondMinutes = 475;
uint256 public rateThirdMinutes = 425;
uint256 public rateLastMinutes = 400;
uint256 public rateAngelMinutesEnd = 1 minutes;
uint256 public rateFirstMinutesEnd = 2 minutes;
uint256 public rateSecondMinutesEnd = 3 minutes;
uint256 public rateThirdMinutesEnd = 4 minutes;
uint256 public rateLastMinutesEnd = 5 minutes;
1 == 1 seconds , 1 minutes == 60 seconds , 1 hours == 60 minutes
1 days == 24 hours , 1 weeks == 7 days , 1 years == 365 days
7
Create your own ethereum token (cont.)
◈ Modifiers
enum Stages {
InProgress,
Ended,
Withdrawn,
Proposed,
Accepted
}
/* Throw if at stage other than current stage */
modifier atStage(Stages _stage) {
if (stage != _stage) {
Throw;
}
_;
}
/* Access is restricted to owner */
modifier onlyOwner() {
if (msg.sender != owner) throw;
_;
}
/* Throw if sender is not beneficiary */
modifier onlyBeneficiary() {
if (beneficiary != msg.sender) {
Throw;
}
_;
}
8
Create your own ethereum token (cont.)
◈ Payment Methods
function () atStage(Stages.InProgress) payable {
if (now < start) {
throw;
}
if (now > end) {
throw;
}
// Enforce min amount
if (msg.value < minAcceptedAmount) {
throw;
}
createTokens();
}
function createTokens() payable {
uint256 tokens = toAPC();
totalSupply += tokens;
balances[msg.sender] += tokens;
raised += msg.value;
deposit[msg.sender] = msg.value;
// Notify listners
Transfer(msg.sender, owner, msg.value);
Transfer(owner, msg.sender, tokens);
}
function toAPC() payable returns (uint256 amount){
// Convert `eth to APC using the current rate
} 9
Create your own ethereum token (cont.)
◈ Withdraw Methods
/* Function to end the crowdsale */
function endCrowdsale() atStage(Stages.InProgress)
{
// Crowdsale not ended yet
if (now < end) {
throw;
}
stage = Stages.Ended;
}
/** Unlocks the token irreversibly so that the
transfering of value is enabled*/
function unlock() onlyOwner returns (bool
success) {
locked = false;
return true;
}
/* Transfer to the company address */
function withdraw() onlyBeneficiary
atStage(Stages.Ended) {
// Confirm that minAmount is raised
if (raised < minAmount) {
throw;
}
0;
uint256 amountToSend = raised;
if (!beneficiary.send(amountToSend)) {
throw;
}
stage = Stages.Withdrawn;
}
10
Create your own ethereum token (cont.)
◈ Refund Methods
function refund() atStage(Stages.Ended) {
// Only allow refunds if minAmount is not raised
if (raised >= minAmount) throw;
uint256 receivedAmount = deposit[msg.sender];
uint256 tokenAmount = balances[msg.sender];
deposit[msg.sender] = 0;
balances[msg.sender] = 0;
totalSupply -= tokenAmount;
raised -= receivedAmount;
if (receivedAmount > 0 && !msg.sender.send(receivedAmount)) {
deposit[msg.sender] = receivedAmount;
balances[msg.sender] = tokenAmount;
totalSupply += tokenAmount;
raised += receivedAmount;
}
} 11
Create your own ethereum token (cont.)
◈ Block number condition
function APCToken(address _beneficiary, uint256
_start, uint256 _end) {
beneficiary = _beneficiary;
balances[msg.sender] = 0;
totalSupply = 0;
locked = true;
start = _start;
end = _end;
}
12
function () atStage(Stages.InProgress) payable {
if (block.number < start) throw;
if (block.number > end) throw;
// Enforce min amount
if (msg.value < minAcceptedAmount) {
throw;
}
createTokens();
}
DEMO
13
14
Cryptocurrency Exchange
15
Other Ethereum Tokens
Any questions?
16

Contenu connexe

Tendances

Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Gene Leybzon
 
Ravada VDI Eslibre
Ravada VDI EslibreRavada VDI Eslibre
Ravada VDI Eslibrefrankiejol
 
Socket.io under the hood
Socket.io under the hoodSocket.io under the hood
Socket.io under the hoodHaokang Den
 
Cyclone + Eventsource (realtime push-сообщения)
Cyclone + Eventsource (realtime push-сообщения)Cyclone + Eventsource (realtime push-сообщения)
Cyclone + Eventsource (realtime push-сообщения)MoscowDjango
 
Callbacks and control flow in Node js
Callbacks and control flow in Node jsCallbacks and control flow in Node js
Callbacks and control flow in Node jsThomas Roch
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.ioArnout Kazemier
 
it's only abuse if it crashes
it's only abuse if it crashesit's only abuse if it crashes
it's only abuse if it crashesEleanor McHugh
 
Hello world contract
Hello world contractHello world contract
Hello world contractGene Leybzon
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contractsGene Leybzon
 
Avoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jsAvoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jscacois
 
Docker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterDocker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterdotCloud
 

Tendances (20)

Textile
TextileTextile
Textile
 
Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3
 
Ravada VDI Eslibre
Ravada VDI EslibreRavada VDI Eslibre
Ravada VDI Eslibre
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Ns tutorial
Ns tutorialNs tutorial
Ns tutorial
 
Socket.io under the hood
Socket.io under the hoodSocket.io under the hood
Socket.io under the hood
 
Shaky ERC20 Allowances
Shaky ERC20 AllowancesShaky ERC20 Allowances
Shaky ERC20 Allowances
 
Cyclone + Eventsource (realtime push-сообщения)
Cyclone + Eventsource (realtime push-сообщения)Cyclone + Eventsource (realtime push-сообщения)
Cyclone + Eventsource (realtime push-сообщения)
 
Callbacks and control flow in Node js
Callbacks and control flow in Node jsCallbacks and control flow in Node js
Callbacks and control flow in Node js
 
SPICE Model of M1FE60(PDF)
SPICE Model of M1FE60(PDF)SPICE Model of M1FE60(PDF)
SPICE Model of M1FE60(PDF)
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.io
 
Node js lecture
Node js lectureNode js lecture
Node js lecture
 
it's only abuse if it crashes
it's only abuse if it crashesit's only abuse if it crashes
it's only abuse if it crashes
 
Hello world contract
Hello world contractHello world contract
Hello world contract
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
 
Introduction to asyncio
Introduction to asyncioIntroduction to asyncio
Introduction to asyncio
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 
Avoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jsAvoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.js
 
Lecture16
Lecture16Lecture16
Lecture16
 
Docker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at TwitterDocker links | Docker workshop #2 at Twitter
Docker links | Docker workshop #2 at Twitter
 

Similaire à How to create ethereum token (A plan coin ico)

ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token ContractKC Tam
 
“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip PandeyEIT Digital Alumni
 
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryTucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryDestry Saul
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12Aludirk Wong
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session 병완 임
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumTomoaki Sato
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor ConcurrencyAlex Miller
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeShakacon
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2rohassanie
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial ENNicholas Lin
 
Kostas Kloudas - Extending Flink's Streaming APIs
Kostas Kloudas - Extending Flink's Streaming APIsKostas Kloudas - Extending Flink's Streaming APIs
Kostas Kloudas - Extending Flink's Streaming APIsVerverica
 
Facts about multithreading that'll keep you up at night - Guy Bar on, Vonage
Facts about multithreading that'll keep you up at night - Guy Bar on, VonageFacts about multithreading that'll keep you up at night - Guy Bar on, Vonage
Facts about multithreading that'll keep you up at night - Guy Bar on, VonageCodemotion Tel Aviv
 
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015ThierryAbalea
 
Cvim half precision floating point
Cvim half precision floating pointCvim half precision floating point
Cvim half precision floating pointtomoaki0705
 
Hot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-upHot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-upMark Price
 
BitVisor Summit 11「2. BitVisor on Aarch64」
BitVisor Summit 11「2. BitVisor on Aarch64」BitVisor Summit 11「2. BitVisor on Aarch64」
BitVisor Summit 11「2. BitVisor on Aarch64」BitVisor
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarNapier University
 

Similaire à How to create ethereum token (A plan coin ico) (20)

ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
 
“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey
 
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryTucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Ethereum A to Z
Ethereum A to ZEthereum A to Z
Ethereum A to Z
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
Advanced smart contract
Advanced smart contractAdvanced smart contract
Advanced smart contract
 
Kostas Kloudas - Extending Flink's Streaming APIs
Kostas Kloudas - Extending Flink's Streaming APIsKostas Kloudas - Extending Flink's Streaming APIs
Kostas Kloudas - Extending Flink's Streaming APIs
 
Facts about multithreading that'll keep you up at night - Guy Bar on, Vonage
Facts about multithreading that'll keep you up at night - Guy Bar on, VonageFacts about multithreading that'll keep you up at night - Guy Bar on, Vonage
Facts about multithreading that'll keep you up at night - Guy Bar on, Vonage
 
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
 
Cvim half precision floating point
Cvim half precision floating pointCvim half precision floating point
Cvim half precision floating point
 
Hot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-upHot Code is Faster Code - Addressing JVM Warm-up
Hot Code is Faster Code - Addressing JVM Warm-up
 
4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf
 
BitVisor Summit 11「2. BitVisor on Aarch64」
BitVisor Summit 11「2. BitVisor on Aarch64」BitVisor Summit 11「2. BitVisor on Aarch64」
BitVisor Summit 11「2. BitVisor on Aarch64」
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
 

Plus de 承翰 蔡

Notes for AWS IoT
Notes for AWS IoTNotes for AWS IoT
Notes for AWS IoT承翰 蔡
 
Node-red Chatbot module
Node-red Chatbot moduleNode-red Chatbot module
Node-red Chatbot module承翰 蔡
 
Bitcoin developer guide
Bitcoin developer guideBitcoin developer guide
Bitcoin developer guide承翰 蔡
 
The 3rd generation blockchain
The 3rd generation blockchainThe 3rd generation blockchain
The 3rd generation blockchain承翰 蔡
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction承翰 蔡
 
AWS IoT introduction
AWS IoT introductionAWS IoT introduction
AWS IoT introduction承翰 蔡
 
IoT開發平台NodeMCU
IoT開發平台NodeMCUIoT開發平台NodeMCU
IoT開發平台NodeMCU承翰 蔡
 
Node mcu x raspberrypi2 x mqtt
Node mcu x raspberrypi2 x mqttNode mcu x raspberrypi2 x mqtt
Node mcu x raspberrypi2 x mqtt承翰 蔡
 
Arduino mqtt client introduction
Arduino mqtt client introductionArduino mqtt client introduction
Arduino mqtt client introduction承翰 蔡
 
Webduino introduction
Webduino introductionWebduino introduction
Webduino introduction承翰 蔡
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x BenchmarkMongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark承翰 蔡
 
Kimono sharing
Kimono sharingKimono sharing
Kimono sharing承翰 蔡
 

Plus de 承翰 蔡 (13)

Notes for AWS IoT
Notes for AWS IoTNotes for AWS IoT
Notes for AWS IoT
 
Node-red Chatbot module
Node-red Chatbot moduleNode-red Chatbot module
Node-red Chatbot module
 
Ipfs
IpfsIpfs
Ipfs
 
Bitcoin developer guide
Bitcoin developer guideBitcoin developer guide
Bitcoin developer guide
 
The 3rd generation blockchain
The 3rd generation blockchainThe 3rd generation blockchain
The 3rd generation blockchain
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
 
AWS IoT introduction
AWS IoT introductionAWS IoT introduction
AWS IoT introduction
 
IoT開發平台NodeMCU
IoT開發平台NodeMCUIoT開發平台NodeMCU
IoT開發平台NodeMCU
 
Node mcu x raspberrypi2 x mqtt
Node mcu x raspberrypi2 x mqttNode mcu x raspberrypi2 x mqtt
Node mcu x raspberrypi2 x mqtt
 
Arduino mqtt client introduction
Arduino mqtt client introductionArduino mqtt client introduction
Arduino mqtt client introduction
 
Webduino introduction
Webduino introductionWebduino introduction
Webduino introduction
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x BenchmarkMongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
 
Kimono sharing
Kimono sharingKimono sharing
Kimono sharing
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

How to create ethereum token (A plan coin ico)

  • 1. How to create an Ethereum Token Roger
  • 2. What's an ICO/Token Lunch? ◈ Initial Coin Offering ◈ A fundraising tool that trades future cryptocoins in exchange for cryptocurrencies. ◈ Case ⬥ Basic Attention Token (USD 35 million in 24 seconds) ⬥ Status (USD 100 million in 1 hour) 2
  • 3. Why ICO/Token Lunch? ◈ For company ⬥ The company can raise funds ⬥ The value of the token will change with the company's future development ◈ For investors ⬥ Use the token in exchange for product use rights ⬥ Sell the token, earn the spread from it 3
  • 4. ERC-20 Token Standard ◈ ERC-20 defines a common list of rules for all Ethereum tokens to follow. ◈ ERC-20 will allow dapps and wallets to handle tokens across multiple interfaces/dapps. 4
  • 5. ERC-20 Specification ◈ function totalSupply() constant returns (uint256 totalSupply) ◈ function balanceOf(address _owner) constant returns (uint256 balance) ◈ function transfer(address _to, uint256 _value) returns (bool success) ◈ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) ◈ function approve(address _spender, uint256 _value) returns (bool success) ◈ function allowance(address _owner, address _spender) constant returns (uint256 remaining) ◈ event Transfer(address indexed _from, address indexed _to, uint256 _value) ◈ event Approval(address indexed _owner, address indexed _spender, uint256 _value) Github: zeppelin ERC-20 Standard Token 5
  • 6. Create your own ethereum token ◈ Inherit Standard Token ◈ Basic Parameters // A Plan Coin string public name = "A Plan Coin"; string public symbol = "APC"; uint8 public decimals = 18; // Crowdsale details address public beneficiary; // Company addres uint256 public minAmount = 10 ether; uint256 public maxAmount = 95279487 ether; uint256 public minAcceptedAmount = 40 finney; // 1/25 ether contract APCToken is Owned, StandardToken { . . . } 6
  • 7. Create your own ethereum token (cont.) ◈ Exchange Rate Parameters ◈ Solidity Time Unit // Eth to APC rate uint256 public rateAngelMinutes = 650; uint256 public rateFirstMinutes = 550; uint256 public rateSecondMinutes = 475; uint256 public rateThirdMinutes = 425; uint256 public rateLastMinutes = 400; uint256 public rateAngelMinutesEnd = 1 minutes; uint256 public rateFirstMinutesEnd = 2 minutes; uint256 public rateSecondMinutesEnd = 3 minutes; uint256 public rateThirdMinutesEnd = 4 minutes; uint256 public rateLastMinutesEnd = 5 minutes; 1 == 1 seconds , 1 minutes == 60 seconds , 1 hours == 60 minutes 1 days == 24 hours , 1 weeks == 7 days , 1 years == 365 days 7
  • 8. Create your own ethereum token (cont.) ◈ Modifiers enum Stages { InProgress, Ended, Withdrawn, Proposed, Accepted } /* Throw if at stage other than current stage */ modifier atStage(Stages _stage) { if (stage != _stage) { Throw; } _; } /* Access is restricted to owner */ modifier onlyOwner() { if (msg.sender != owner) throw; _; } /* Throw if sender is not beneficiary */ modifier onlyBeneficiary() { if (beneficiary != msg.sender) { Throw; } _; } 8
  • 9. Create your own ethereum token (cont.) ◈ Payment Methods function () atStage(Stages.InProgress) payable { if (now < start) { throw; } if (now > end) { throw; } // Enforce min amount if (msg.value < minAcceptedAmount) { throw; } createTokens(); } function createTokens() payable { uint256 tokens = toAPC(); totalSupply += tokens; balances[msg.sender] += tokens; raised += msg.value; deposit[msg.sender] = msg.value; // Notify listners Transfer(msg.sender, owner, msg.value); Transfer(owner, msg.sender, tokens); } function toAPC() payable returns (uint256 amount){ // Convert `eth to APC using the current rate } 9
  • 10. Create your own ethereum token (cont.) ◈ Withdraw Methods /* Function to end the crowdsale */ function endCrowdsale() atStage(Stages.InProgress) { // Crowdsale not ended yet if (now < end) { throw; } stage = Stages.Ended; } /** Unlocks the token irreversibly so that the transfering of value is enabled*/ function unlock() onlyOwner returns (bool success) { locked = false; return true; } /* Transfer to the company address */ function withdraw() onlyBeneficiary atStage(Stages.Ended) { // Confirm that minAmount is raised if (raised < minAmount) { throw; } 0; uint256 amountToSend = raised; if (!beneficiary.send(amountToSend)) { throw; } stage = Stages.Withdrawn; } 10
  • 11. Create your own ethereum token (cont.) ◈ Refund Methods function refund() atStage(Stages.Ended) { // Only allow refunds if minAmount is not raised if (raised >= minAmount) throw; uint256 receivedAmount = deposit[msg.sender]; uint256 tokenAmount = balances[msg.sender]; deposit[msg.sender] = 0; balances[msg.sender] = 0; totalSupply -= tokenAmount; raised -= receivedAmount; if (receivedAmount > 0 && !msg.sender.send(receivedAmount)) { deposit[msg.sender] = receivedAmount; balances[msg.sender] = tokenAmount; totalSupply += tokenAmount; raised += receivedAmount; } } 11
  • 12. Create your own ethereum token (cont.) ◈ Block number condition function APCToken(address _beneficiary, uint256 _start, uint256 _end) { beneficiary = _beneficiary; balances[msg.sender] = 0; totalSupply = 0; locked = true; start = _start; end = _end; } 12 function () atStage(Stages.InProgress) payable { if (block.number < start) throw; if (block.number > end) throw; // Enforce min amount if (msg.value < minAcceptedAmount) { throw; } createTokens(); }

Notes de l'éditeur

  1. Solidity Global Variables: http://solidity.readthedocs.io/en/develop/units-and-global-variables.html top50 ethereum token: https://ethplorer.io/top token contract: https://etherscan.io/token-search Zeppelin github: https://github.com/OpenZeppelin/zeppelin-solidity
  2. top 40 exchange: https://www.bestbitcoinexchange.io/
  3. top 50 ethereum tokens: https://ethplorer.io/top search token contract: https://etherscan.io/token-search