Caseys-MBP:eosio.token casey$ cleos push action eosio.token create '[ "eosio", "1000000000.0000 SYS"]' -p eosio.token@active
Error 3015004: The type defined in the ABI is invalid
Error Details:
account
Caseys-MBP:eosio.token casey$ cleos push action eosio.token create '{"issuer":"eosio", "maximum_supply":"1000000000.0000 SYS"}' -p eosio.token@active
Error 3015004: The type defined in the ABI is invalid
Error Details:
account

I get this error every time I try to create a token using the developers tutorial. I can't find a solution online.

I can deploy the contract fine in the step previously:

Caseys-MBP:eosio.token casey$ cleos set contract eosio.token /Users/casey/contracts/eosio.contracts/eosio.token --abi eosio.token.abi -p eosio.token@active
Reading WASM from /Users/casey/contracts/eosio.contracts/eosio.token/eosio.token.wasm...
Publishing contract...
executed transaction: b1baa91009caf28de48dbfdeab08e13f3deeb01a6eb89f1bd8d98bb69747ccee  9696 bytes  1663 us
#         eosio <= eosio::setcode               {"account":"eosio.token","vmtype":0,"vmversion":0,"code":"0061736d0100000001aa011c60037f7e7f0060047f...
#         eosio <= eosio::setabi                {"account":"eosio.token","abi":"0e656f73696f3a3a6162692f312e30000605636c6f73650002056f776e6572046e61...
warning: transaction executed locally, but may not be confirmed by the network yet 

ABI file for token:

{
    "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Sat Oct 27 16:30:01 2018",
    "version": "eosio::abi/1.0",
    "structs": [
        {
            "name": "close",
            "base": "",
            "fields": [
                {
                    "name": "owner",
                    "type": "name"
                },
                {
                    "name": "symbol",
                    "type": "symbol"
                }
            ]
        },
        {
            "name": "create",
            "base": "",
            "fields": [
                {
                    "name": "issuer",
                    "type": "name"
                },
                {
                    "name": "maximum_supply",
                    "type": "asset"
                }
            ]
        },
        {
            "name": "issue",
            "base": "",
            "fields": [
                {
                    "name": "to",
                    "type": "name"
                },
                {
                    "name": "quantity",
                    "type": "asset"
                },
                {
                    "name": "memo",
                    "type": "string"
                }
            ]
        },
        {
            "name": "open",
            "base": "",
            "fields": [
                {
                    "name": "owner",
                    "type": "name"
                },
                {
                    "name": "symbol",
                    "type": "symbol"
                },
                {
                    "name": "ram_payer",
                    "type": "name"
                }
            ]
        },
        {
            "name": "retire",
            "base": "",
            "fields": [
                {
                    "name": "quantity",
                    "type": "asset"
                },
                {
                    "name": "memo",
                    "type": "string"
                }
            ]
        },
        {
            "name": "transfer",
            "base": "",
            "fields": [
                {
                    "name": "from",
                    "type": "name"
                },
                {
                    "name": "to",
                    "type": "name"
                },
                {
                    "name": "quantity",
                    "type": "asset"
                },
                {
                    "name": "memo",
                    "type": "string"
                }
            ]
        }
    ],
    "types": [],
    "actions": [
        {
            "name": "close",
            "type": "close",
            "ricardian_contract": ""
        },
        {
            "name": "create",
            "type": "create",
            "ricardian_contract": ""
        },
        {
            "name": "issue",
            "type": "issue",
            "ricardian_contract": ""
        },
        {
            "name": "open",
            "type": "open",
            "ricardian_contract": ""
        },
        {
            "name": "retire",
            "type": "retire",
            "ricardian_contract": ""
        },
        {
            "name": "transfer",
            "type": "transfer",
            "ricardian_contract": ""
        }
    ],
    "tables": [
        {
            "name": "accounts",
            "type": "account",
            "index_type": "i64",
            "key_names": [],
            "key_types": []
        },
        {
            "name": "stat",
            "type": "currency_stats",
            "index_type": "i64",
            "key_names": [],
            "key_types": []
        }
    ],
    "ricardian_clauses": [],
    "abi_extensions": []
} 
  • Could you please add details of your abi file? – friedger Oct 27 at 21:48
  • Added the details above – Casey Gardiner Oct 27 at 21:58

You need to define account and currency_stats in the structs part of your abi.

See https://developers.eos.io/eosio-home/docs/the-abi#section-explicit-structs for details and https://developers.eos.io/eosio-home/docs/the-abi#section-putting-it-all-together for a full abi of token contract.

  • I used the ABI file and I keep getting the same error – Casey Gardiner Oct 27 at 22:27
  • Verify that you have deployed the correct file by downloading the abi from the chain. – friedger Oct 27 at 22:36
  • Could you guide me in how to do that? – Casey Gardiner Oct 27 at 23:19
  • For example deploy the file again with cleos and see whether it complains that the same code version is already running. – friedger Oct 29 at 7:24

from the issues page of eosio.contracts says that the file named eosio.token.abi is wrong, maybe bad code of eosio.cdt.

So, download the correct file, which you can found from the post, or just click here and overlay the file named eosio.token.abi generated by eoscpp in the eosio.contract/eosio.token/ and re-excute cleos set contract ....

Have fun!

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.