Browse Source

Added overridable getTokenAmount function

George Spasov 7 years ago
parent
commit
ebdba08218
1 changed files with 5 additions and 1 deletions
  1. 5 1
      contracts/crowdsale/Crowdsale.sol

+ 5 - 1
contracts/crowdsale/Crowdsale.sol

@@ -59,12 +59,16 @@ contract Crowdsale {
     return new MintableToken();
   }
 
-
   // fallback function can be used to buy tokens
   function () external payable {
     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
   function buyTokens(address beneficiary) public payable {
     require(beneficiary != address(0));