Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buy(address _referal) payable{
- uint256 amount = msg.value * MULTIPLIER / tokenPrice;
- amount = amount + amount * buyDiscount / 100;
- require(balances[owner] >= amount + amount * 7 / 100);
- require(balances[msg.sender] + amount + amount * 2 / 100 >= minTokensAmount);
- require(balances[msg.sender] + amount + amount * 2 / 100 <= maxTokensAmount);
- require(balances[_referal] + amount * 5 / 100 <= maxTokensAmount);
- balances[msg.sender] = balances[msg.sender].add(amount + amount * 2 / 100);
- balances[_referal] = balances[_referal].add(amount * 5 / 100);
- balances[owner] = balances[owner] - amount - amount * 7 / 100;
- tokensSoldInCurrentStage = tokensSoldInCurrentStage.add(amount + amount * 7 / 100);
- Transfer(owner, msg.sender, amount + amount * 2 / 100);
- Transfer(owner, _referal, amount * 5 / 100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement