5

If not do I need to have cron run every minute on my system and monitor the weather api and if its sunny, it will execute the smart contract on EOS? Yes, you'd need to make an explicit call to the blockchain yourself as the network cannot make calls to external services. The closest native mechanism you may have to "self-execution" is deferred transactions:...


3

The contract rightfully encapsulates the implementation details as private. Instead, it provides the following function as the public interface: static asset get_balance( name token_contract_account, name owner, symbol_code sym_code ) A better version of the code to get EOS balance is thus as follows: auto how_much = token::get_balance("eosio.token"_n, "...


3

Take a look at inline actions (executed in the same transaction) or deferred transactions (executed in another transaction. Inline Actions The link refers to the official developer portal. Inline actions will execute in the same transaction as the initiating action. If the inline action fails the whole transaction will fail. These actions also count to the ...


2

You need to include eosio.hpp before the other includes. #include <eosio/eosio.hpp> Sidenote: this actually seems to be a problem with cdt 1.6.1 and will hopefully be fixed with next releases Issue#532


2

require_auth(user) will ensure the sender of the transaction has the correct permission, which is what you're intending. Perhaps the way you're calling the action is incorrect? When using cleos push action ... the -p (or --permission) option allows you to specify the account authority you want to use.


1

template <typename T, typename Lambda> void migrate_table(name code, uint16_t batch_size, name source_scope, name destn_scope, Lambda&& mapper) { T source(code, source_scope.value); T destination(code, destn_scope.value); auto lastdest = destination.end(); if (lastdest == destination.begin()) { return; // empty table ...


1

It isn't possible to use future in smart contracts, because the whole thing is single-thread C++. Multithreading isn't supported and wouldn't work within the contract because it would potentially make the results of any code non-deterministic


1

In recently version of eos_compiler. Some data type are deprecated. including account_name .. downgrade your compiler or edit code, or add typedef yourself. good day :)


1

using the command: dpkg -c eosio.cdt-1.3.2.x86_64.deb The folder where the files are installed are shown: the CDT files are stored in /usr/opt/eosio.cdt/


1

The issue was inside an emplace(). Basically, I was not setting the payer. After, hard coding the payer as N(mycontract), I don't get the error anymore and the functions work correctly.


Only top voted, non community-wiki answers of a minimum length are eligible