create account

RE: How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified) by winglessss

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @maxnachamkin/how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified

· @winglessss ·
Thanks for this post.  However I am having difficulty verifying my source code.

I keep getting the error

Missing Constructor Arguments for function MyToken(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol)



Here is my Source Code any help would be greatly appreciated.  I'll throw you at least $5 worth of steem if you can help me out.

pragma solidity ^0.4.11;
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

contract MyToken  {
    /* Public variables of the token */
    string public standard = 'Token 0.1';
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function MyToken(
        uint256 initialSupply,
        string tokenName,
        uint8 decimalUnits,
        string tokenSymbol
        ) {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
        totalSupply = initialSupply;                        // Update total supply
        name = tokenName;                                   // Set the name for display purposes
        symbol = tokenSymbol;                               // Set the symbol for display purposes
        decimals = decimalUnits;                            // Amount of decimals for display purposes
    }

    /* 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
    }

    /* Allow another contract to spend some tokens in your behalf */
    function approve(address _spender, uint256 _value)
        returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        return true;
    }

    /* Approve and then communicate the approved contract in a single tx */
    function approveAndCall(address _spender, uint256 _value, bytes _extraData)
        returns (bool success) {
        tokenRecipient spender = tokenRecipient(_spender);
        if (approve(_spender, _value)) {
            spender.receiveApproval(msg.sender, _value, this, _extraData);
            return true;
        }
    }        

    /* A contract attempts to get the coins */
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        require(_to != 0x0);                                // Prevent transfer to 0x0 address. Use burn() instead
        require(balanceOf[_from] >= _value);                // Check if the sender has enough
        require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
        require(_value <= allowance[_from][msg.sender]);    // Check allowance
        balanceOf[_from] -= _value;                         // Subtract from the sender
        balanceOf[_to] += _value;                           // Add the same to the recipient
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }

    function burn(uint256 _value) returns (bool success) {
        require(balanceOf[msg.sender] >= _value);           // Check if the sender has enough
        balanceOf[msg.sender] -= _value;                    // Subtract from the sender
        totalSupply -= _value;                              // Updates totalSupply
        Burn(msg.sender, _value);
        return true;
    }

    function burnFrom(address _from, uint256 _value) returns (bool success) {
        require(balanceOf[_from] >= _value);                // Check if the targeted balance is enough
        require(_value <= allowance[_from][msg.sender]);    // Check allowance
        balanceOf[_from] -= _value;                         // Subtract from the targeted balance
        allowance[_from][msg.sender] -= _value;             // Subtract from the sender's allowance
        totalSupply -= _value;                              // Update totalSupply
        Burn(_from, _value);
        return true;
    }
}
👍  , , , , , , , , , ,
properties (23)
authorwinglessss
permlinkre-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20170726t235801357z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1"}
created2017-07-26 23:57:57
last_update2017-07-26 23:57:57
depth1
children6
last_payout2017-08-02 23:57:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,007
author_reputation208,894,886,989
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id9,851,836
net_rshares0
author_curate_reward""
vote details (11)
@ccmut ·
besides not having inserted throw if your stil having issues check                                       

balanceOf[_from] -= _value;                         // Subtract from the sender's allowance

 allowance[_from][msg.sender] -= _value;             // Subtract from the targeted balance
  
  totalSupply -= _value;                              // Update totalSupply

i also believe you can delete 
allowance[_from] line completly
👍  
properties (23)
authorccmut
permlinkre-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20170729t070128911z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1"}
created2017-07-29 07:01:36
last_update2017-07-29 07:01:36
depth2
children0
last_payout2017-08-05 07:01:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length433
author_reputation70,425,903,947
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id10,092,999
net_rshares0
author_curate_reward""
vote details (1)
@coinjokerscript · (edited)
Good article with worthwhile information. meanwhile, try this  link to know about step by step process of creating erc20 token, erc223 token creation, erc721 token creation-https://www.cryptoexchangescript.com/erc20-token-creation
properties (22)
authorcoinjokerscript
permlinkre-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20180828t074809188z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1","links":["https://www.cryptoexchangescript.com/erc20-token-creation"]}
created2018-08-28 07:48:03
last_update2018-08-28 07:48:39
depth2
children0
last_payout2018-09-04 07:48:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length230
author_reputation2,808,208,518
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,578,309
net_rshares0
@theoriginal3ddee ·
Thank you so much! One of the best posts on steemit!!! Can I just paste this in windows 7 notepad?
👍  ,
properties (23)
authortheoriginal3ddee
permlinkre-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20180207t235313784z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1"}
created2018-02-07 23:53:24
last_update2018-02-07 23:53:24
depth2
children0
last_payout2018-02-14 23:53:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length98
author_reputation580,827,569
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id35,777,951
net_rshares615,035,572
author_curate_reward""
vote details (2)
@tombola ·
HI - I can see from here that you havent completed the following:

![](https://steemitimages.com/DQmUMHFTiqpYeKvTEDk35kq4hiYwr1ESMU4D1ymDaRkyJnD/image.png)
properties (22)
authortombola
permlinkre-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20180213t134750805z
categoryethereum
json_metadata{"tags":["ethereum"],"image":["https://steemitimages.com/DQmUMHFTiqpYeKvTEDk35kq4hiYwr1ESMU4D1ymDaRkyJnD/image.png"],"app":"steemit/0.1"}
created2018-02-13 13:47:51
last_update2018-02-13 13:47:51
depth2
children1
last_payout2018-02-20 13:47:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length155
author_reputation0
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id37,219,966
net_rshares0
@tombola ·
Sorry - see you have fixed it!
properties (22)
authortombola
permlinkre-tombola-re-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20180213t134822096z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1"}
created2018-02-13 13:48:21
last_update2018-02-13 13:48:21
depth3
children0
last_payout2018-02-20 13:48:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length30
author_reputation0
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id37,220,058
net_rshares0
@winglessss ·
I looked at this again today  I think I figured it out
properties (22)
authorwinglessss
permlinkre-winglessss-re-maxnachamkin-how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified-20170727t231833643z
categoryethereum
json_metadata{"tags":["ethereum"],"app":"steemit/0.1"}
created2017-07-27 23:18:27
last_update2017-07-27 23:18:27
depth2
children0
last_payout2017-08-03 23:18:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length54
author_reputation208,894,886,989
root_title"How To Create Your Own Ethereum Token In An Hour (ERC20 + Verified)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id9,961,698
net_rshares0