Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buyback(uint amount) public returns (uint) {
- require(balance[msg.sender] >= amount);
- // Adjust balance and total supply
- balance[msg.sender] -= amount;
- _totalSupply -= amount;
- // Send ether back
- // Wwill fail if the contract doesn't have enough funds
- msg.sender.transfer(amount / rate);
- // Generate transfer event
- Transfer(msg.sender, 0x0, amount);
- }
Add Comment
Please, Sign In to add comment