-
Notifications
You must be signed in to change notification settings - Fork 1.4k
throw depreciated doc update #625
Comments
The pull request I made updating the tutorial to the new syntax was merged a while back but it seems it's not yet active on the live website (#614). If you want to look at how to rewrite that you can look at the token file in the repo, that already contains the updated code: https://github.com/ethereum/ethereum-org/blob/master/views/content/token.md So for your example it would become: /* Send coins */
function transfer(address _to, uint256 _value) {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
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
} Basically it means replacing |
/* This unnamed function is called whenever someone tries to send ether to it */ contract MyAdvancedToken is owned, token {
} there still "throw" in the code, I think there still three of it, so how can I fix it?? help |
@clone1612 thank you that is very helpful :) |
@alexvandesande i realized that the code is not updated on the ethereum website, but at github is right =D |
It will be updated shortly! ;-) |
Hello there:
Was trying to get my hands dirty and follow one of your tutorials but copying and pasting your code did not work due to the new
throw
depreciation in favor to other things.So please update ethereum-org/views/content/token.md
And let me know how you would rewrite the following:
The text was updated successfully, but these errors were encountered: