Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. require(balances[fundsWallet] >= amount);
  2.  
  3. function() payable{
  4. totalEthInWei = totalEthInWei + msg.value;
  5. uint256 amount = msg.value * unitsOneEthCanBuy;
  6. require(balances[fundsWallet] >= amount);
  7.  
  8. balances[fundsWallet] = balances[fundsWallet] - amount;
  9. balances[msg.sender] = balances[msg.sender] + amount;
  10.  
  11. Transfer(fundsWallet, msg.sender, amount); // Broadcast a message to the blockchain
  12.  
  13. //Transfer ether to fundsWallet
  14. fundsWallet.transfer(msg.value);
  15. }
  16.  
  17. uint256 amount = msg.value * unitsOneEthCanBuy / 1000000000000000000;
  18.  
  19. function() payable{
  20. totalEthInWei = totalEthInWei + msg.value;
  21. uint256 amount = msg.value * unitsOneEthCanBuy / 1000000000000000000;
  22. require(balances[fundsWallet] >= amount);
  23.  
  24. balances[fundsWallet] = balances[fundsWallet] - amount;
  25. balances[msg.sender] = balances[msg.sender] + amount;
  26.  
  27. //Transfer ether to fundsWallet
  28. fundsWallet.transfer(msg.value);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement