0

stdClass Object ( [code] => 500 [message] => Internal Service Error [error] => stdClass Object ( [code] => 3050000 [name] => action_validate_exception [what] => Action validate exception [details] => Array ( [0] => stdClass Object ( [message] => Unknown action hashit in contract eosio [file] => chain_plugin.cpp [line_number] => 1831 [method] => abi_json_to_bin ) [1] => stdClass Object ( [message] => code: eosio, action: hashit, args: ["boxwork1","boxwork2","0.0001 EOS","Testy McTest"] [file] => chain_plugin.cpp [line_number] => 1842 [method] => abi_json_to_bin ) ) ) )

Can I create custom action using cleos?

  • 1
    Your question title and the content of the question are quite different. The account eosio does not contain the transfer operation. You likely mean to use eosio.token account. Please make your question more clear for more assistance. – netuoso - EOS Titan Oct 31 '19 at 13:38
  • my fault, I was trying to push a custom action there called "Hash". And the issue I am facing is Unknown action hash in contract eosio. But I go the solution just going to put it below. Thanks for helping. – Sunny Kasera Nov 4 '19 at 12:48
0

Basically, I was trying to push a custom action called "hashit". So for hashit action, I have created a hash.cpp file

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class hash : public contract {
public:
  using contract::contract;
  [[eosio::action]]
  void hashit( name user ) {
     print( "Hello, ", name{user} );
  }
};

and I have generated wasm and abi file with cmd eosio-cpp -o hash.wasm hash.cpp -abigen

and then set contract with cleos. And it works.

|improve this answer|||||

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.