Guest User

Untitled

a guest
Feb 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function buyback(uint amount) public returns (uint) {
  2. require(balance[msg.sender] >= amount);
  3.  
  4. // Adjust balance and total supply
  5. balance[msg.sender] -= amount;
  6. _totalSupply -= amount;
  7.  
  8. // Send ether back
  9. // Wwill fail if the contract doesn't have enough funds
  10. msg.sender.transfer(amount / rate);
  11.  
  12. // Generate transfer event
  13. Transfer(msg.sender, 0x0, amount);
  14. }
Add Comment
Please, Sign In to add comment