Added overridable getTokenAmount function
This commit is contained in:
@ -59,12 +59,16 @@ contract Crowdsale {
|
|||||||
return new MintableToken();
|
return new MintableToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// fallback function can be used to buy tokens
|
// fallback function can be used to buy tokens
|
||||||
function () external payable {
|
function () external payable {
|
||||||
buyTokens(msg.sender);
|
buyTokens(msg.sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Override this function to create logic for periodization
|
||||||
|
function getTokenAmount(uint256 weiAmount) internal constant returns(uint256) {
|
||||||
|
return weiAmount.mul(rate);
|
||||||
|
}
|
||||||
|
|
||||||
// low level token purchase function
|
// low level token purchase function
|
||||||
function buyTokens(address beneficiary) public payable {
|
function buyTokens(address beneficiary) public payable {
|
||||||
require(beneficiary != address(0));
|
require(beneficiary != address(0));
|
||||||
|
|||||||
Reference in New Issue
Block a user