0
function transfer(address _to, uint256 _value) {             
    if (balanceOf[msg.sender] < _value) throw;                // Check if the sender has enough
    if (balanceOf[_to] + _value < balanceOf[_to]) throw;      // Check the overflows
    if (frozenaccount[msg.sender]) throw;                     // Check if frozen
    balanceOf[msg.sender] -= _value;                          // Subtract from the sender
    balanceOf[_to] += _value                                  // add the same to the recipient
    Transfer(msg.sender, _to, _value); (right here error!)                        // notify anyone listening that this transfer took place
}

all code https://gist.github.com/Sexstasy/86e8b243422aef64c3182fbd0ef1671e

1

You're missing a semicolon on the preceding line.

|improve this answer|||||
0

Correct code :

 function transfer(address _to, uint256 _value) { 
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough 
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check the overflows 
if (frozenaccount[msg.sender]) throw; // Check if frozen balanceOf[msg.sender] -= _value; // Subtract from the sender 
balanceOf[_to] += _value; // add the same to the recipient 
Transfer(msg.sender, _to, _value); // notify anyone listening that this transfer took place 
}

You should use require or assert instead throw, and use the safemath library

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.