My inline transfer causes the following error.
Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: read
I dont know how to solve it. I simplify my code in the following version
test.hpp
#ifndef TEST_HPP
#define TEST_HPP
#include <eosiolib/asset.hpp>
#include <eosiolib/eosio.hpp>
using namespace eosio;
class test: public contract {
public:
//@abi action
test(account_name _self): contract(_self) {}
void func();
};
#endif
test.cpp
#include "test.hpp"
void test::func() {
require_auth(_self);
action(
permission_level {_self,N(active)},
N(eosio.token),N(transfer),
std::make_tuple(_self,N(eosio.token),asset(10000,symbol_type(S(4,SYS))),"")
).send();
}
EOSIO_ABI(test,(func))
I altered permission to allow inline transferring with command
cleos --wallet-url http://localhost:8899 -u http://localhost:8788 set account permission test active '{"threshold":1,"keys":[{"key":"EOS5BL1oic5zZfzbS681xPKgBGH8cE6f3FiGAoB2gfqDpu15fyU1L","weight":1}],"accounts":[{"permission":{"actor":"test","permission":"eosio.code"},"weight":1}],"waits":[]}' owner -p test -x 10
How can I deal with the error?