3

Does anyone know how to pass an assets symbol_name in as an argument to an action? I have been trying the following:

.abi

"types": [{
"new_type_name": "symbol_name",
"type": "uint64"
}]

and .cpp

void contract::getsymbol(symbol_name sym) {
    print("Symbol is ", name{sym});
}

However when I try to pass in a symbol like TEST a get the following error:

Couldn't parse uint64_t

1

void contract::getsymbol(string sym) { symbol_type symb = string_to_symbol(4,sym.c_str()); print("Symbol is ", sym); print(symb.name()); }

|improve this answer|||||
  • As I am not able to see your code but I think you would probabily imported the symbol.hpp .Did your code work ? – Nirdesh Kumar Choudhary Aug 24 '18 at 12:09

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.