8

I'm simply copying the full coin code found in this tutorial to deploy a contract on the testnet using mist, but I get the error message "No data is deployed on the contract address". The contract then shows up as a transaction in my wallet, but it's not listed under contracts. I'm using biggest fee possible, and my own wallet address as the central minter address input argument. Is this valid? This argument only seems to be used in the line

if(centralMinter != 0 ) owner = msg.sender;

which makes it seem rather redundant to me, so any explanation of this regardless of relevance to the error message is also appreciated!

  • I'm having the same problem. Deploying the Token contract works fine but My Advanced Token gives "No data is deployed on the contract address". – tjakko Jun 10 '16 at 9:04
  • When you say you are using the biggest free possible, are you talking about gas or gasprice? You need to increase gas. Also, is you could post a transaction hash, it would be useful for us – Tjaden Hess Jun 10 '16 at 14:42
3

It's not your fault, MyAdvancedToken contract is wrong. When you extend another contract, and that contract's constructor needs parameters, you have to pass those parameters during creation phase. MyAdvancedToken inherits token but it does not pass parameters to its parent, so it does not work as expected. I fixed the example and I already sent a pull request to the official page. In the meanwhile, you can fix it by your own following these instructions.

Inside the token contract, remove the first line from the constructor:

balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens

Inside the MyAdvancedToken contract, replace wrong constructor:

/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken(
    uint256 initialSupply,
    string tokenName,
    uint8 decimalUnits,
    string tokenSymbol,
    address centralMinter
) {
    if(centralMinter != 0 ) owner = msg.sender;         // Sets the minter
    balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
    name = tokenName;                                   // Set the name for display purposes
    symbol = tokenSymbol;                               // Set the symbol for display purposes
    decimals = decimalUnits;                            // Amount of decimals for display purposes
    totalSupply = initialSupply;
}

with this one:

/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken(
    uint256 initialSupply,
    string tokenName,
    uint8 decimalUnits,
    string tokenSymbol,
    address centralMinter
) token (initialSupply, tokenName, decimalUnits, tokenSymbol) {
    if(centralMinter != 0 ) owner = centralMinter;      // Sets the owner as specified (or msg.sender if centralMinter is not specified)
    balanceOf[owner] = initialSupply;                   // Give the owner all initial tokens
}
  • I am still getting the same issue with the new update, should we call the owner constructor as well ?! – Mahdi Pedram Mar 29 '17 at 7:48

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.