0

我尝试使用 myetherwallet 创建一个新的加密令牌并且它可以工作,除了初始供应不正确。我问了 100,000,000,000 并且只得到了 1000,000 。

我可以通过 myetherwallet 设置初始供应量,还是应该使用 Myst?

这是我创建合同的方式:

  1. 在迷雾中

    pragma solidity ^0.4.8;
    contract tokenRecipient { function receiveApproval(address _from, uint256 
    _value, address _token, bytes _extraData); }
    
    contract ForCoin {
    /* Public variables of the token */
    string public standard = 'ForCoin 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 ForCoin(
        uint256 initialSupply,
        string tokenName,
        uint8 decimalUnits,
        string tokenSymbol
        ) {
        initialSupply = 100000000000;
        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
    }
    
  2. 将代码复制到 myetherwallet 并部署。

备注:我还在myst本身右侧填写了初始供应值。

谢谢!

4

1 回答 1

0

您必须将小数位指定为 5。

于 2017-08-22T08:50:41.377 回答