SlideShare una empresa de Scribd logo
1 de 25
ADVANCED
Presenter: Loc Doan
SMART CONTRACT
SECURITY ISSUES
❖ Race Condition
❖ Timestamp Dependence
❖ Integer Overflow and Underflow
❖ DoS with (Unexpected) revert
❖ DoS with Block Gas Limit
❖ Transfer vs Send
FROM BUSINESS REQUIREMENTS TO TECHNICAL
IMPLEMENTATION (CROWDSALE, TRANCHE SALE, ETC)
❖ Basic Functionality
❖ Basic Functionality for Token
❖ Basic Functionality for Crowdsale
Timeline
RACE CONDITION
public class Counter {
protected long count = 0;
public void add(long value){
this.count = this.count + value;
}
}
this.count = 0;
A: Reads this.count into a register (0)
B: Reads this.count into a register (0)
B: Adds value 2 to register
B: Writes register value (2) back to memory.
this.count now equals 2
A: Adds value 3 to register
A: Writes register value (3) back to memory.
this.count now equals 3
❖ Thread A wants to add 2 to this.count.
❖ Thread B wants to add 3 to this.count.
❖ Expected result => 5.
❖ Real results => 3.
REENTRANCY
mapping (address => uint) private userBalances;
function withdrawBalance() public {
uint amountToWithdraw = userBalances[msg.sender];
require(msg.sender.call.value(amountToWithdraw)()); // At this point, the caller's code is executed, and can call
withdrawBalance again
userBalances[msg.sender] = 0;
}
CROSS-FUNCTION RACE CONDITIONS
t
mapping (address => uint) private userBalances;
function transfer(address to, uint amount) {
if (userBalances[msg.sender] >= amount) {
userBalances[to] += amount;
userBalances[msg.sender] -= amount;
}
}
function withdrawBalance() public {
uint amountToWithdraw = userBalances[msg.sender];
require(msg.sender.call.value(amountToWithdraw)()); // At this point, the caller's code is executed, and can call transfer()
userBalances[msg.sender] = 0;
}
CHECKS-
EFFECTS-INTERACTIONS
1. Conditions
2. Effects (potentially changing
conditions)
3. Interaction
You need to not only avoid calling external functions
too soon, but also avoid calling functions which call
external functions.
MUTEX
t
function deposit() payable public returns (bool) {
require(!lockBalances);
lockBalances = true;
balances[msg.sender] += msg.value;
lockBalances = false;
return true;
}
MUTEX
t
contract StateHolder {
uint private n;
address private lockHolder;
function getLock() {
require(lockHolder == 0);
lockHolder = msg.sender;
}
function releaseLock() {
require(msg.sender == lockHolder);
lockHolder = 0;
}
function set(uint newState) {
require(msg.sender == lockHolder);
n = newState;
}
}
If you use mutexes to protect against race conditions, you will need to
carefully ensure that there are no ways for a lock to be claimed and
never released.
TIMESTAMP DEPENDENCE
Can be manipulated by the
miner
Use block.number + average blocktime to estimate
INTEGER OVERFLOW
AND UNDERFLOW
Beware of small int
DOS WITH BLOCK GAS LIMIT
struct Payee {
address addr;
uint256 value;
}
Payee[] payees;
uint256 nextPayeeIndex;
function payOut() {
uint256 i = nextPayeeIndex;
while (i < payees.length && msg.gas > 200000) {
payees[i].addr.send(payees[i].value);
i++;
}
nextPayeeIndex = i;
}
Don't iterate. If you have, you
can divide it into multiple
transaction.
DOS WITH (UNEXPECTED) REVERT
contract Auction {
address currentLeader;
uint highestBid;
function bid() payable {
require(msg.value > highestBid);
require(currentLeader.send(
highestBid)); // Refund the old leader, if it fails then revert
currentLeader = msg.sender;
highestBid = msg.value;
}
}
address[] private refundAddresses;
mapping (address => uint) public refunds;
// bad
function refundAll() public {
for(uint x; x < refundAddresses.length; x++) { // arbitrary
length iteration based on how many addresses participated
require(refundAddresses[x].send(
refunds[refundAddresses[x]])) // doubly bad, now a single
failure on send will hold up all funds
}
}
Solution: pull over push payment: create a refund function.
Transfer vs Send
Transfer
address x = 0x123;
address myAddress = this;
if (x.balance < 10 && myAddress.balance >= 10) x.transfer(10);
If x is a contract address, its code (more specifically: its fallback function, if
present) will be executed together with the transfer call (this is a feature of
the EVM and cannot be prevented). If that execution runs out of gas or fails
in any way, the Ether transfer will be reverted and the current contract will
stop with an exception.
Send
If the execution fails, the current contract will not stop with an exception,
but send will return false.
There are some dangers in using send: The transfer fails if the call stack
depth is at 1024 (this can always be forced by the caller) and it also fails if
the recipient runs out of gas. So in order to make safe Ether transfers,
always check the return value of send, use transfer or even better: use a
pattern where the recipient withdraws the money.
❖ Token
❖ Pricing Strategy
❖ Finalize Agent
Crowdsale
Structure
SAFE MATH OWNABLE HALTABLE
Safe unsigned safe
math.
Provides basic
authorization control.
Implement an
emergency stop
mechanism.
BURNABLE
TOKEN
RELEASABLE
TOKEN
UPGRADEABLE
TOKEN
Implement burn
functionality for token.
It means destroy, or
make the token
invalid.
Allow token to be
transfered after the
crowdsale. Still give
some special case can
be transfered
Content: Allow to
transfer token from a
contract to another
contract. This "another
contract" can have
upgraded functionality
for the token.
MINTABLE
TOKEN
CROWDSALE
TOKEN
Implement mint
functionality for token.
It means to create new
token in the system.
A crowdsaled token.
PRICING
STRATEGY
FLAT
PRICING
Interface for defining
crowdsale pricing.
Fixed crowdsale pricing
- everybody gets the
same price.
MILESTONE
PRICING
TOKEN TRANCHE
PRICING
Time milestone based
pricing with special
support for pre-ico
deals.
Tranche based pricing
with special support for
pre-ico deals.
FINALIZE AGENT NULL
FINALIZE AGENT
DEFAULT
FINALIZE AGENT
Finalize agent defines
what happens at the
end of succeseful
crowdsale.
A finalize agent that
does nothing. Token
transfer must be
manually released by
the owner.
Unlock tokens.
BONUS
FINALIZE AGENT
EXTRA
FINALIZE AGENT
At the end of the
successful crowdsale
allocate % bonus of
tokens to the team.
Unlock tokens.
At the end of the
successful crowdsale
allocate % bonus of
tokens to the team.
Do not unlock the
tokens.
CROWDSALEBASE CROWDSALE UNCAPPEDCROWDSALE
Implements basic state
machine logic, but leaves
out all buy functions so
that subclasses can
implement their own
buying logic.
Abstract base contract
for token sales with the
default buy entry
points.
Handle
Does not Handle
Intended usage
- A short time window
- Flat price
- No cap
MINTEDETHCAPPE-
CROWDSALE
MINTEDTOKENCAPPED-
CROWDSALE
RELAUNCHED-
CROWDSALE
ICO crowdsale contract
that is capped by
amount of ETH.
Tokens are dynamically
created during the
crowdsale.
ICO crowdsale contract
that is capped by amout
of tokens.
Tokens are dynamically
created during the
crowdsale.
A crowdsale that retains
the previous token, but
changes some parameters.
Investor data can be
manually fed in.
Mostly useful as a hot fix
Q&A
THANK YOU FOR LISTENING

Más contenido relacionado

La actualidad más candente

Lattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH CryptosystemLattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH Cryptosystem
Varun Janga
 

La actualidad más candente (16)

Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice Cryptography
 
Solidity
SoliditySolidity
Solidity
 
ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
 
Lattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH CryptosystemLattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH Cryptosystem
 
Introduction - Lattice-based Cryptography
Introduction - Lattice-based CryptographyIntroduction - Lattice-based Cryptography
Introduction - Lattice-based Cryptography
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
 
Fast Multiparty Threshold ECDSA with Fast TrustlessSetup
Fast Multiparty Threshold ECDSA with Fast TrustlessSetupFast Multiparty Threshold ECDSA with Fast TrustlessSetup
Fast Multiparty Threshold ECDSA with Fast TrustlessSetup
 
A survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic EncryptionA survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic Encryption
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
CRC Error coding technique
CRC Error coding techniqueCRC Error coding technique
CRC Error coding technique
 
Homomorphic encryption in_cloud
Homomorphic encryption in_cloudHomomorphic encryption in_cloud
Homomorphic encryption in_cloud
 
Multi qubit entanglement
Multi qubit entanglementMulti qubit entanglement
Multi qubit entanglement
 
CRC JAVA CODE
CRC JAVA CODECRC JAVA CODE
CRC JAVA CODE
 
Bch codes
Bch codesBch codes
Bch codes
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
 

Similar a Advanced smart contract

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
Shakacon
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
Rajeev Sharan
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event Processor
WSO2
 

Similar a Advanced smart contract (20)

“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
 
Hello world contract
Hello world contractHello world contract
Hello world contract
 
Security in the blockchain
Security in the blockchainSecurity in the blockchain
Security in the blockchain
 
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
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
 
Ethereum
EthereumEthereum
Ethereum
 
WSO2 Complex Event Processor
WSO2 Complex Event ProcessorWSO2 Complex Event Processor
WSO2 Complex Event Processor
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
PowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 EnergyPowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 Energy
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
 
Klaytn Developer Meetup_20190827
Klaytn Developer Meetup_20190827Klaytn Developer Meetup_20190827
Klaytn Developer Meetup_20190827
 
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
 
Understanding Algorand's smart contract language
Understanding Algorand's smart contract language   Understanding Algorand's smart contract language
Understanding Algorand's smart contract language
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
Autonomous transaction
Autonomous transactionAutonomous transaction
Autonomous transaction
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event Processor
 

Último

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 

Último (20)

HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 

Advanced smart contract

  • 2. SECURITY ISSUES ❖ Race Condition ❖ Timestamp Dependence ❖ Integer Overflow and Underflow ❖ DoS with (Unexpected) revert ❖ DoS with Block Gas Limit ❖ Transfer vs Send FROM BUSINESS REQUIREMENTS TO TECHNICAL IMPLEMENTATION (CROWDSALE, TRANCHE SALE, ETC) ❖ Basic Functionality ❖ Basic Functionality for Token ❖ Basic Functionality for Crowdsale Timeline
  • 3. RACE CONDITION public class Counter { protected long count = 0; public void add(long value){ this.count = this.count + value; } } this.count = 0; A: Reads this.count into a register (0) B: Reads this.count into a register (0) B: Adds value 2 to register B: Writes register value (2) back to memory. this.count now equals 2 A: Adds value 3 to register A: Writes register value (3) back to memory. this.count now equals 3 ❖ Thread A wants to add 2 to this.count. ❖ Thread B wants to add 3 to this.count. ❖ Expected result => 5. ❖ Real results => 3.
  • 4. REENTRANCY mapping (address => uint) private userBalances; function withdrawBalance() public { uint amountToWithdraw = userBalances[msg.sender]; require(msg.sender.call.value(amountToWithdraw)()); // At this point, the caller's code is executed, and can call withdrawBalance again userBalances[msg.sender] = 0; }
  • 5. CROSS-FUNCTION RACE CONDITIONS t mapping (address => uint) private userBalances; function transfer(address to, uint amount) { if (userBalances[msg.sender] >= amount) { userBalances[to] += amount; userBalances[msg.sender] -= amount; } } function withdrawBalance() public { uint amountToWithdraw = userBalances[msg.sender]; require(msg.sender.call.value(amountToWithdraw)()); // At this point, the caller's code is executed, and can call transfer() userBalances[msg.sender] = 0; }
  • 6. CHECKS- EFFECTS-INTERACTIONS 1. Conditions 2. Effects (potentially changing conditions) 3. Interaction You need to not only avoid calling external functions too soon, but also avoid calling functions which call external functions.
  • 7. MUTEX t function deposit() payable public returns (bool) { require(!lockBalances); lockBalances = true; balances[msg.sender] += msg.value; lockBalances = false; return true; }
  • 8. MUTEX t contract StateHolder { uint private n; address private lockHolder; function getLock() { require(lockHolder == 0); lockHolder = msg.sender; } function releaseLock() { require(msg.sender == lockHolder); lockHolder = 0; } function set(uint newState) { require(msg.sender == lockHolder); n = newState; } } If you use mutexes to protect against race conditions, you will need to carefully ensure that there are no ways for a lock to be claimed and never released.
  • 9. TIMESTAMP DEPENDENCE Can be manipulated by the miner Use block.number + average blocktime to estimate
  • 11. DOS WITH BLOCK GAS LIMIT struct Payee { address addr; uint256 value; } Payee[] payees; uint256 nextPayeeIndex; function payOut() { uint256 i = nextPayeeIndex; while (i < payees.length && msg.gas > 200000) { payees[i].addr.send(payees[i].value); i++; } nextPayeeIndex = i; } Don't iterate. If you have, you can divide it into multiple transaction.
  • 12. DOS WITH (UNEXPECTED) REVERT contract Auction { address currentLeader; uint highestBid; function bid() payable { require(msg.value > highestBid); require(currentLeader.send( highestBid)); // Refund the old leader, if it fails then revert currentLeader = msg.sender; highestBid = msg.value; } } address[] private refundAddresses; mapping (address => uint) public refunds; // bad function refundAll() public { for(uint x; x < refundAddresses.length; x++) { // arbitrary length iteration based on how many addresses participated require(refundAddresses[x].send( refunds[refundAddresses[x]])) // doubly bad, now a single failure on send will hold up all funds } } Solution: pull over push payment: create a refund function.
  • 13. Transfer vs Send Transfer address x = 0x123; address myAddress = this; if (x.balance < 10 && myAddress.balance >= 10) x.transfer(10); If x is a contract address, its code (more specifically: its fallback function, if present) will be executed together with the transfer call (this is a feature of the EVM and cannot be prevented). If that execution runs out of gas or fails in any way, the Ether transfer will be reverted and the current contract will stop with an exception. Send If the execution fails, the current contract will not stop with an exception, but send will return false. There are some dangers in using send: The transfer fails if the call stack depth is at 1024 (this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order to make safe Ether transfers, always check the return value of send, use transfer or even better: use a pattern where the recipient withdraws the money.
  • 14. ❖ Token ❖ Pricing Strategy ❖ Finalize Agent Crowdsale Structure
  • 15. SAFE MATH OWNABLE HALTABLE Safe unsigned safe math. Provides basic authorization control. Implement an emergency stop mechanism.
  • 16. BURNABLE TOKEN RELEASABLE TOKEN UPGRADEABLE TOKEN Implement burn functionality for token. It means destroy, or make the token invalid. Allow token to be transfered after the crowdsale. Still give some special case can be transfered Content: Allow to transfer token from a contract to another contract. This "another contract" can have upgraded functionality for the token.
  • 17. MINTABLE TOKEN CROWDSALE TOKEN Implement mint functionality for token. It means to create new token in the system. A crowdsaled token.
  • 18. PRICING STRATEGY FLAT PRICING Interface for defining crowdsale pricing. Fixed crowdsale pricing - everybody gets the same price.
  • 19. MILESTONE PRICING TOKEN TRANCHE PRICING Time milestone based pricing with special support for pre-ico deals. Tranche based pricing with special support for pre-ico deals.
  • 20. FINALIZE AGENT NULL FINALIZE AGENT DEFAULT FINALIZE AGENT Finalize agent defines what happens at the end of succeseful crowdsale. A finalize agent that does nothing. Token transfer must be manually released by the owner. Unlock tokens.
  • 21. BONUS FINALIZE AGENT EXTRA FINALIZE AGENT At the end of the successful crowdsale allocate % bonus of tokens to the team. Unlock tokens. At the end of the successful crowdsale allocate % bonus of tokens to the team. Do not unlock the tokens.
  • 22. CROWDSALEBASE CROWDSALE UNCAPPEDCROWDSALE Implements basic state machine logic, but leaves out all buy functions so that subclasses can implement their own buying logic. Abstract base contract for token sales with the default buy entry points. Handle Does not Handle Intended usage - A short time window - Flat price - No cap
  • 23. MINTEDETHCAPPE- CROWDSALE MINTEDTOKENCAPPED- CROWDSALE RELAUNCHED- CROWDSALE ICO crowdsale contract that is capped by amount of ETH. Tokens are dynamically created during the crowdsale. ICO crowdsale contract that is capped by amout of tokens. Tokens are dynamically created during the crowdsale. A crowdsale that retains the previous token, but changes some parameters. Investor data can be manually fed in. Mostly useful as a hot fix
  • 24. Q&A
  • 25. THANK YOU FOR LISTENING