Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract MyERCToken {
- // Note: This function returns a boolean value
- // indicating whether the transfer was successful
- function transfer(address _to, uint256 _amount) returns (bool success) {
- // If the sender has sufficient funds to send
- // and the amount is not zero, then send to
- // the given address
- if (balances[msg.sender] >= _amount
- && _amount > 0
- && balances[_to] + _amount > balances[_to]) {
- balances[msg.sender] -= _amount;
- balances[_to] += _amount;
- // Fire a transfer event for any
- // logic that's listening
- Transfer(msg.sender, _to, _amount);
- return true;
- } else {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement