Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. modifier inActivePeriod() {
  2. require((startFirstStepICO < now && now <= endFirstStepICO) || (starSecondStepICO < now && now <= endSecondStepICO));
  3. _;
  4. }
  5.  
  6. // low level token purchase function
  7. function buyTokens(address _sender) inActivePeriod payable {
  8. require(_sender != 0x0);
  9. require(msg.value >= minTransactionAmount);
  10.  
  11. uint256 weiAmount = msg.value;
  12. raisedForEther = raisedForEther.add(weiAmount);
  13.  
  14. // calculate token amount to be created
  15. uint256 tokens = weiAmount.mul(rate);
  16. tokens += getBonus(tokens);
  17.  
  18. tokenReserve(_sender, tokens);
  19.  
  20. forwardFunds();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement