Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. contract MyERCToken {
  2. // Note: This function returns a boolean value
  3. // indicating whether the transfer was successful
  4. function transfer(address _to, uint256 _amount) returns (bool success) {
  5. // If the sender has sufficient funds to send
  6. // and the amount is not zero, then send to
  7. // the given address
  8. if (balances[msg.sender] >= _amount
  9. && _amount > 0
  10. && balances[_to] + _amount > balances[_to]) {
  11. balances[msg.sender] -= _amount;
  12. balances[_to] += _amount;
  13. // Fire a transfer event for any
  14. // logic that's listening
  15. Transfer(msg.sender, _to, _amount);
  16. return true;
  17. } else {
  18. return false;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement