Skip to content

Commit

Permalink
Changing throw() to revert()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdannen committed Aug 11, 2017
1 parent 1d30c86 commit 9450015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mytoken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ contract MyToken {
/* Send coins */
function transfer(address _to, uint256 _value) {
/* if the sender doenst have enough balance then stop */
if (balanceOf[msg.sender] < _value) throw;
if (balanceOf[_to] + _value < balanceOf[_to]) throw;
if (balanceOf[msg.sender] < _value) revert;
if (balanceOf[_to] + _value < balanceOf[_to]) revert;

/* Add and subtract new balances */
balanceOf[msg.sender] -= _value;
Expand Down

2 comments on commit 9450015

@RMFogarty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mist editor requires me to add () after revert to compile

@chrisdannen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. Fixing now. Thank you for your help.

Please sign in to comment.