Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [action]

Actions specify and implement the behaviour for smart contracts and operate primarily in a message-based communication model. Questions may relate to sending, receiving, analysing, interpreting, and implementing actions; action specification and rules, and others.

1
vote
0answers
14 views

When receive a transaction, how to EOS push it into block chain?

I am researching how to transaction work in Block producer(BP). I knew when BP received a transaction from user, maybe it start from push_transaction function then to apply_context::exec and ...
0
votes
1answer
23 views

cleos get actions returns empty list!

I am running EOS on my computer as a local network. I created a smart contract and am able to invoke the actions using both cleos commands and through eosjs. When I run cleos get table command I see ...
1
vote
1answer
29 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
1
vote
0answers
14 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
3
votes
1answer
58 views

Transaction took too long

I occurred this Error 3080006: transaction took too long when push my own contract action. the push action cmd had no setting '-X'. It's weird because I pushed the same action with two different ...
1
vote
1answer
48 views

correct usage for send_context_free()

I have a very simple ACTION in a contract that writes to a table (multi-index) which has two columns: a string name and an auto-generated primary key called id. This part works fine and I am able to ...
6
votes
3answers
147 views

Why the first time I execute an action I get “Error 3080006: transaction took too long”?

WHAT I WANT Call an action and see it succeed at the first execution. WHAT IS NOT WORKING The function, which I am executing, the first time fails with error: Error 3080006: Transaction took too ...
0
votes
1answer
102 views

How to pass a list / array / vector to an action? [duplicate]

I need to pass a list of integers to an action. It would be fine to use vectors or arrays, but I can't find one that works. Using vector in the smart contract compiles fine, but then I get this error ...
2
votes
0answers
20 views

Can I determine the number of actions implied in the actual running transaction?

transaction_size() returns the size in bytes but is not useful to determine the number of actions implied. Can I get the count?
1
vote
0answers
99 views

How do permissions on deferred transactions work?

I'm playing around with deferred transactions and encountered an oddity. Say, we have a contract deployed on contract, and an account account. contract has contract@eosio.code as part of its active ...
1
vote
1answer
49 views

How to pass an empty parameter into action with cleos

I have an action that looks like the following: hello ( name person ) { if ( name == 0 ) { ; // do something } else { ; // do something else } } and I wanted to pass ...
1
vote
1answer
73 views

Can we use default parameters in EOS smart contract?

I have a action in my contract : // @abi action void ContractClass::submittxn(string memo,string memo2,uint64_t a = 61) { ... } I try to set a as default parameter but when I push the ...
1
vote
1answer
35 views

How to check if smartcontract action has been actually run? How to count how many times?

Imagine an action, which is not const, and sometimes (but not always) modify a defined multi index. I would like to count, how many times a specific action was run. I do not want to introduce any ...
0
votes
0answers
47 views

Are multiple actions in a single transaction guaranteed to happen sequentially?

Suppose I have a transaction with two actions, A and B, listed one after another. Like this: { <...>, "actions": [ { "account": "my.token", "name": "action_a", <...&...
0
votes
2answers
200 views

Transfer EOS tokens inside a smart contract from an account to another

I want to implement, in my smart contract(C++), a function that forwards EOS token to another account. This is actually a basic question, but is that possible actually? Please, could you share the ...
2
votes
1answer
105 views

How to push a vector to an action

I'm troubled with a problem about how I can use command line cleos push action to push a vector to an already existing action, such as: void vectortest(const std::vector &vec) ; Anyone who can ...
1
vote
3answers
92 views

Interacting with a smart contract

How can a user interact with the contract? Is typing the command cleos push action the only option?
2
votes
2answers
51 views

A contract that generates another contract

If I want to create a smart contract with an action 'Create Game' and on calling that action a new contract be formed, how is it possible?
6
votes
1answer
36 views

Make Ledger Reflect All RAM Changes

If we want those witnessing the chain to know about our apps state without any knowledge of our service layer, what might be the best approach? Since the ledger only records the data given to it in an ...
2
votes
1answer
112 views

empty actions - abi file

Any help why I'm getting empty actions? { "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-08-22T01:21:53", "version": "eosio::abi/1.0", "types": [], "structs": [{ ...
2
votes
2answers
220 views

List of available datatypes for action parameter

I am wondering where I can find a list of supported datatypes that can be used in an actions parameters. Edit: Should have specified this better. I am writing some actions such as: /// @abi action ...
3
votes
2answers
66 views

How do I ensure my Action Listener responds only to authentic senders?

I have an apply function that listeners for transfers to my contract from eosio.token. On notification of a transfer, a function (buy) is called within the contract. How do I ensure that this "buy" ...
2
votes
1answer
387 views

How to call action of another contract within a contract?

If I'm right then to call the event of another contract, I need to configure the permissions (allow the call). For example, I have contract aliceclass: class aliceclass : public contract { public: ...
1
vote
1answer
286 views

Can we get all the actions from all blocks?

Somebody say we can get all the blocks through rpc, then we can get all the actions. But I found that in the block information, there're no inline actions, so many inline actions will lose, right?
3
votes
2answers
829 views

How to send an action from one contract to another?

From contract A, I want to send an action to contract B. How to do that? There is SEND_INLINE_ACTION but that seems to need a pointer to the contract (usually *this), correct? Solution Using action....
0
votes
1answer
140 views

How to link permission to action?

I created a publish permission, and I want to this permission can only execute the publish action in my tweet contract. How to link the permission to the action?
3
votes
3answers
1k views

How to get operations history of account?

Should I analyze all the blocks or are there some methods in the eosjs library?
2
votes
2answers
652 views

How to call an action within the contract with custom permissions?

Here is my code: void play(account_name player, asset amount) { require_auth(player); //The part that is throwing the error action { permission_level{player, N(active)}, //Using the ...
2
votes
1answer
122 views

Account of caller of action

Is there a way to get the account of the caller within an action? If not, I would need to add an extra parameter to the action containing the action name and then do some verification. It would be ...
0
votes
1answer
284 views

How to add a “memo” to an action?

In an action in my contract, I want to attach some text to it, so that users can see the text in their transaction history using a block explore like eosflare.io. I see that eosio.token has a "memo" ...
2
votes
1answer
47 views

Corrupted account name in nodeos log during action pushing

Have an issue with the action push: cleos --wallet-url "http://localhost:8889" push action contractx put '["test", "75c88c9593bec6b716f2cb9b60db79282b6f3389a39f3be9adef45e06b379b48"]' -p test Error ...
3
votes
2answers
580 views

How to perform something when my contract receives a eosio.token transfer notification?

I know a very similar question has been asked here (How to do something when your contract is an action notification recipient (like when it receives funds)?), however I don't have enough reputation ...
2
votes
0answers
203 views

Getting ALL the actions for a given account using cleos

If I run: $ cleos -u <api endpoint> -j --full <account> I do not get all the actions. I don't know what the default range is. So I tried: $ cleos -u <api endpoint> -j --full <...
2
votes
1answer
63 views

How do you stream data from an input file when writing contracts on EOS?

I emulated the tic.tac.toe tutorial code and made a simple contract that allows me to add and remove car information. However, I can only push action one at a time and this only allows me to add/...
3
votes
1answer
1k views

Reading table rows with EOSJS

Is there a way to receive the return output of an action with EOSJS? Say for example I have an action that reads columns from a table, sums a row and returns the result. How would I structure the ...
4
votes
2answers
228 views

How is the action data encoded?

Take for example this action belonging to a newaccount transaction: { "account": "eosio", "name": "newaccount", "authorization": [{ "actor": "eosio", "permission"...
3
votes
1answer
158 views

Can an action in a smart contract concurrently executed?

In a smart contract if an action is executed simultaneously and if it tries to modify the same record in a table(using multi index API), How to add mutual exclusion to the shared resources? For eg. ...
3
votes
1answer
287 views

How to pass a 'symbol_name' into an action?

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 ...
9
votes
2answers
2k views

How to do something when your contract is an action notification recipient (like when it receives funds)?

The EOSIO_ABI macro seems to only forward actions meant for our contract. How do you also listen to all other contract actions (like the very common transfer action for the account "eosio.token")? I ...
4
votes
1answer
350 views

How can a action be scheduled to execute at specific timestamp or block?

Is it possible to schedule and action defined in a contract to be automatically executed at a specific timestamp or block? I know it's possible to get a timestamp inside of a contract but, I'm not ...
4
votes
1answer
221 views

How can I create a custom permission within a contract and limit it to certain actions?

For example, say I wanted to create a custom permission called delegatee. An account with this permission would be only permitted to preform certain actions within my contract. Is this possible as of ...
3
votes
1answer
50 views

What is linked permission?

What is linked permission? The following is from authorization_manager.cpp. optional<permission_name> authorization_manager::lookup_linked_permission( account_name authorizer_account, ...
1
vote
1answer
308 views

Where is 'INLINE_ACTION_SENDER' macro defined?

I am trying to use INLINE_ACTION_SENDER to use an action from another contract but get the following error. error: use of undeclared identifier 'INLINE_ACTION_SENDER' How do I include this macro in ...
5
votes
1answer
135 views

What's the symbol that makes one action unique?

When I use the command cleos get actions <account_name> -j,I got three actions which have different receivers, but belong to the same transfer. I know that the three actions are for accounts who ...
2
votes
1answer
254 views

Example of smart contract action that itself executes a transaction

Can anyone point me to example code for writing a smart contract that calls actions on other smart contracts? The general method of doing this is documented here but example code is not provided.
1
vote
1answer
77 views

Handling require_recipient action processing errors

What would happen if the recipient has code to handle the action notification and there is an error processing it? For instance an assertion failure? Would the whole transaction fail ? Also, am I ...
2
votes
1answer
162 views

Deferred action failure handling

Is there some kind of trigger that notifies if a deferred action failed to execute; being the failure either by lack of resources for running the action in the paying account, or a non satisfied ...
1
vote
1answer
77 views

What happens when a non-producing node receives an action?

When I push an action to a non-producing node (either a node that is not producing at all or a block producing node that is not responsible for the next block) what happens to that action? How does it ...
3
votes
1answer
241 views

Can actions have return types?

I've been looking at most of the example contracts and every action seems to return void. Does this mean that you can not have a return type for your actions? Instead, would you have to send a ...
9
votes
1answer
763 views

What is the purpose of `require_recipient`?

I saw the description of the function require_recipient and it says: Add the specified account to set of accounts to be notified I would like to understand what's the purpose of receive this ...