can't find action in smart contract
I am trying to set eosio.token contract to account eosio.token following the instructions on tutorial. But when I call the action create in the contract. The cleos print following error message
Error 3050000: action exception Error Details: Unknown action create in contract eosio.token
I set the contract again but get error message
2533207ms thread-0 main.cpp:2541 main ] Failed with error: Assert Exception (10) account.code_version != code_id: contract is already running this version of code
I can't figure out the problem. Please help
What's version about your code?And can I see your command to call the action?
I use the eosio.token contract download from git yesterday. Here is what I did from command line
root@294022306f98:~# cleos wallet create -n xieyi
"/opt/eosio/bin/keosd" launched
Creating wallet: xieyi
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5Jr1mz5mE3hG5KFPr2yd9BxPPPnJN6RXqUxUrGN9HdGVcUTkGAm"
root@294022306f98:~# cleos create key
Private key: 5KfieiShgZv3cyeNYBwV68RSNhxup4KP3ef3CV8Bb87T7FDqQDH
Public key: EOS5MMHE3sgXGj66xaC1d3rPZnUATX4uXQJpHiVngr6sbuWqj8hMt
root@294022306f98:~# cleos wallet import -n xieyi 5KfieiShgZv3cyeNYBwV68RSNhxup4KP3ef3CV8Bb87T7FDqQDH
imported private key for: EOS5MMHE3sgXGj66xaC1d3rPZnUATX4uXQJpHiVngr6sbuWqj8hMt
root@294022306f98:~# make -C eosio.token/
make: Entering directory '/root/eosio.token'
make: Nothing to be done for 'all'.
make: Leaving directory '/root/eosio.token'
root@294022306f98:~# cleos create account eosio eosio.token EOS5MMHE3sgXGj66xaC1d3rPZnUATX4uXQJpHiVngr6sbuWqj8hMt
executed transaction: 2dcc0428b7cede508f4b3399e35ec481fc717b5d4874a59d9e22bece960a5d66 200 bytes 487 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"eosio.token","owner":{"threshold":1,"keys":[{"key":"EOS5MMHE3sgXGj66xaC1d...
warning: transaction executed locally, but may not be confirmed by the network yet
root@294022306f98:~# cleos set contract eosio.token eosio.token -p eosio.token
Reading WAST/WASM from eosio.token/eosio.token.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: 5afef1239f9f32a0c38979376686d7cdba60d0fa5589ccbec237d3aad401c122 7952 bytes 2695 us
# eosio <= eosio::setcode {"account":"eosio.token","vmtype":0,"vmversion":0,"code":"0061736d01000000017e1560037f7e7f0060057f7e...
# eosio <= eosio::setabi {"account":"eosio.token","abi":"0e656f73696f3a3a6162692f312e3000000000000000"}
warning: transaction executed locally, but may not be confirmed by the network yet
root@294022306f98:~# cleos push action eosio.token create '{"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"}' -p eosio.token
Error 3050000: action exception
Error Details:
Unknown action create in contract eosio.token
I'm getting this same error while running: cleos push action currency create '{"issuer":"currency", "maximum_supply":"10000.0000 CUR", "can_freeze":"0", "can_recall":"0", "can_whitelist":"0"}' -p currency!!
In my case error 3050000: action exception
Unknown action create in contract currency.
I'm using latest DAWN
You can check if the abi file related to the "token" contract has "create" action.
yes, I created it using eosiocpp -g token.abi token.cpp and then ran the contract using cleos set contract token.cpp, which was errorless but then I got this error 3050000!
@LeslieRan I find no create action in abi file. but I follow the instructions given on wiki. Is there any problem with the instructions?
This is my abi file:
{ "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-05-28T02:59:06", "version": "eosio::abi/1.0", "types": [], "structs": [{ "name": "hi", "base": "", "fields": [{ "name": "user", "type": "name" } ] } ], "actions": [{ "name": "hi", "type": "hi", "ricardian_contract": "" } ], "tables": [], "ricardian_clauses": [], "error_messages": [], "abi_extensions": [] }
@deba10106 that is an outdated contract, rebuild EOS
@deba10106 Did you modify the eosio.token.hpp and eosio.token.cpp files?
@breadbread1984 You can update the code and rebuild it.
Okay, I was following a tutorial on youtube, which is outdated. I did the same with eosio.token what I did with the newly created currency contract and I got success! It seems to be a problem with the empty abi file!
@LeslieRan is the docker version OK? How do you tell whether the a contract is outdated?
This is my abi file generated the way told in tutorial
{
"____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-05-28T06:33:21",
"version": "eosio::abi/1.0",
"types": [],
"structs": [],
"actions": [],
"tables": [],
"ricardian_clauses": [],
"error_messages": [],
"abi_extensions": []
}
No, don't do with currency. Instead do this: cd ~/eos/contracts/eosio.token
(you may need to unlock your wallet with flag -n default --password "password") cleos create account eosio eosio.token owner_public_key active_public_key eosiocpp -o eosio.token.wast eosio.token.cpp cleos set contract eosio.token ~/eos/contracts/eosio.token/ cleos push action eosio.token create '{"issuer":"eosio.token&co", "maximum_supply":"1000000.0000 CUR"}' -p eosio.token
You don't need to create currency and currency abi or wast files. New DAWN has in-built eosio.token contract with abi (non-empty) and you just create wast file. This contract does the same job as the currency contract shown in the tutorial!
@deba10106 I use the latest contract code and follow the tutorial on wiki, but still can't call the create function of the contract eosio.token. Is it a problem caused by using docker version of eosio?
@breadbread1984 how did you solved this issue?
issue SYS, before you issue your token.
Hi friends, I created an account and abi file has generated but after this ii found an error like. This is my abi file ~/eos/contracts/sabrin/eosio$ node server.js deprecated, change Eos.Localnet(..) to just Eos(..) { broadcast: true, transaction: { compression: 'none', transaction: { expiration: '2018-07-05T07:10:05', ref_block_num: 17095, ref_block_prefix: 2476869178, net_usage_words: 0, max_cpu_usage_ms: 0, delay_sec: 0, context_free_actions: [], actions: [Array], transaction_extensions: [] }, signatures: [ 'SIG_K1_KVF4jt2NahBv8JRHqt9EpKMbmwdRN89dqjnso5T9CQXg1L9okTGKbAUDUAh3RE2ZNqYjcM1d5t7T7K9m5pDnuxsQtWRwhC' ] }, transaction_id: '2f42ae2696b5e66331f28ca06729c130747bf88343b2f0e2b24d7006c08d2434', processed: { id: '2f42ae2696b5e66331f28ca06729c130747bf88343b2f0e2b24d7006c08d2434', receipt: { status: 'executed', cpu_usage_us: 9318, net_usage_words: 2384 }, elapsed: 9318, net_usage: 19072, scheduled: false, action_traces: [ [Object] ], except: null } } { broadcast: true, transaction: { compression: 'none', transaction: { expiration: '2018-07-05T07:10:05', ref_block_num: 17095, ref_block_prefix: 2476869178, net_usage_words: 0, max_cpu_usage_ms: 0, delay_sec: 0, context_free_actions: [], actions: [Array], transaction_extensions: [] }, signatures: [ 'SIG_K1_KequpSCo7sJj993Ee8LYr27bikLok2GvBayL2CzpCoJy4Zd1UXssVqLhJfD5237ZE1XqrDG4FSV4ysvhMx9f9nHpj3PTou' ] }, transaction_id: '951f64eb8bdd5ee824db50d25ea1f25a780b854fe88732168941691e778ac0af', processed: { id: '951f64eb8bdd5ee824db50d25ea1f25a780b854fe88732168941691e778ac0af', receipt: { status: 'executed', cpu_usage_us: 3915, net_usage_words: 40 }, elapsed: 3915, net_usage: 320, scheduled: false, action_traces: [ [Object] ], except: null } }
cleos push action ias hi '["user"]' -p ias Error 3050000: action exception help me to rectify this error
Hi friends, I created an account and abi file has generated but after this ii found an error like. This is my abi file ~/eos/contracts/sabrin/eosio$ node server.js deprecated, change Eos.Localnet(..) to just Eos(..) { broadcast: true, transaction: { compression: 'none', transaction: { expiration: '2018-07-05T07:10:05', ref_block_num: 17095, ref_block_prefix: 2476869178, net_usage_words: 0, max_cpu_usage_ms: 0, delay_sec: 0, context_free_actions: [], actions: [Array], transaction_extensions: [] }, signatures: [ 'SIG_K1_KVF4jt2NahBv8JRHqt9EpKMbmwdRN89dqjnso5T9CQXg1L9okTGKbAUDUAh3RE2ZNqYjcM1d5t7T7K9m5pDnuxsQtWRwhC' ] }, transaction_id: '2f42ae2696b5e66331f28ca06729c130747bf88343b2f0e2b24d7006c08d2434', processed: { id: '2f42ae2696b5e66331f28ca06729c130747bf88343b2f0e2b24d7006c08d2434', receipt: { status: 'executed', cpu_usage_us: 9318, net_usage_words: 2384 }, elapsed: 9318, net_usage: 19072, scheduled: false, action_traces: [ [Object] ], except: null } } { broadcast: true, transaction: { compression: 'none', transaction: { expiration: '2018-07-05T07:10:05', ref_block_num: 17095, ref_block_prefix: 2476869178, net_usage_words: 0, max_cpu_usage_ms: 0, delay_sec: 0, context_free_actions: [], actions: [Array], transaction_extensions: [] }, signatures: [ 'SIG_K1_KequpSCo7sJj993Ee8LYr27bikLok2GvBayL2CzpCoJy4Zd1UXssVqLhJfD5237ZE1XqrDG4FSV4ysvhMx9f9nHpj3PTou' ] }, transaction_id: '951f64eb8bdd5ee824db50d25ea1f25a780b854fe88732168941691e778ac0af', processed: { id: '951f64eb8bdd5ee824db50d25ea1f25a780b854fe88732168941691e778ac0af', receipt: { status: 'executed', cpu_usage_us: 3915, net_usage_words: 40 }, elapsed: 3915, net_usage: 320, scheduled: false, action_traces: [ [Object] ], except: null } }
cleos push action ias hi '["user"]' -p ias Error 3050000: action exception help me to rectify this error
I can't understand what you pasted. you may redescribe your problem clearly and format your code