Skip to main content

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.

Filter by
Sorted by
Tagged with
12 votes
1 answer
2k 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 ...
Leo Ribeiro's user avatar
  • 3,023
11 votes
2 answers
3k 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 ...
PunchPlump's user avatar
11 votes
1 answer
981 views

What are naming rules for actions, tables and contracts?

Since strings internally are converted to uint64 for space efficiency on the eos.io blockchain what are the restrictions that need to be followed for: actions tables index identifiers (within ...
Dallas Johnson's user avatar
7 votes
3 answers
1k 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 long ...
Riccardo Persiani's user avatar
6 votes
4 answers
2k 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 ...
eclipse's user avatar
  • 213
6 votes
1 answer
51 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 ...
cSun's user avatar
  • 61
5 votes
1 answer
592 views

What could be the reason for 'Error 3050008: Abort Called'

I'm getting the following error without any further description. What could be the issue for that? I'm performing some binary arithmetics when calling this action, are there any known problems with ...
cmadh's user avatar
  • 1,929
5 votes
1 answer
219 views

Different actions count returned in every request

I launched private EOS network with bios boot tutorial. Then I pushed some transactions to the network. Now I want to retrieve all actions for an account useraaaaaaah. But every time I make a request ...
hungl's user avatar
  • 51
5 votes
1 answer
338 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 ...
guaiguaihw's user avatar
4 votes
3 answers
3k views

How to get operations history of account?

Should I analyze all the blocks or are there some methods in the eosjs library?
 Captain's user avatar
4 votes
2 answers
287 views

How to calculate `action_mroot`

UPDATE #3 for future action_mroot calculators: The two critical bits of info needed to do this (that are neither easy to find nor documented) are: There exists an extra action (which has a receipt) ...
gskapka's user avatar
  • 91
4 votes
2 answers
532 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 ...
friedger's user avatar
  • 833
4 votes
2 answers
1k 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 ...
mochunhei's user avatar
  • 277
4 votes
2 answers
725 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"...
aza-eos.ar's user avatar
4 votes
1 answer
754 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 ...
Joshua Shope's user avatar
3 votes
1 answer
3k 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 ...
Mitch Pierias's user avatar
3 votes
1 answer
302 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. ...
Gopalakrishnan Nadar's user avatar
3 votes
2 answers
2k 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....
friedger's user avatar
  • 833
3 votes
1 answer
448 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 ...
fen chen's user avatar
  • 163
3 votes
2 answers
128 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" ...
Phil's user avatar
  • 31
3 votes
1 answer
466 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 ...
luffy's user avatar
  • 31
3 votes
2 answers
1k 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: ...
niksyrov's user avatar
3 votes
1 answer
597 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 ...
Magic Man Xpress's user avatar
3 votes
1 answer
72 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, ...
Charles Ju's user avatar
3 votes
1 answer
732 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 ...
Magic Man Xpress's user avatar
2 votes
1 answer
101 views

Is it possible to create new contract from another?

Ethereum has a opportunity to create new contract from another. Does eosio has the same? I found a code with new account creation, but I didn't find nothing about setting code and abi from contract.
harriton's user avatar
2 votes
2 answers
699 views

Make a transfer inline

I would like to send SYS token owned by the smart contract account to a third party account when anyone call a specific action. I have tried the following code but I am getting an error: [[eosio::...
poiuytrez's user avatar
  • 165
2 votes
1 answer
63 views

Cannot pass arguments to push action in bash script

I am using a bash script to push actions. Here is the script : echo "------------------> Pushing action $1" #cleos -u https://api-kylin.eoslaomao.com:443 push action user1account issue '["...
Piyush Kumar's user avatar
2 votes
1 answer
416 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.
kkurian's user avatar
  • 695
2 votes
1 answer
77 views

Symbol prints wrong value

I have a method like this: void token::test(asset qty) { print("\n", qty); print("\n", qty.symbol); } and the output I get is something like this: 10.00000000 XXX 8,XXX3 why the 3? ...
ekkis's user avatar
  • 515
2 votes
1 answer
193 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": [{ ...
Dominic's user avatar
  • 131
2 votes
1 answer
385 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 [email protected] as part of its active ...
cmichel - LearnEOS.dev's user avatar
2 votes
2 answers
72 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?
Gaurav Kumar's user avatar
2 votes
2 answers
2k 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 ...
cookiekid's user avatar
  • 528
2 votes
1 answer
103 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/...
Tim Zhang's user avatar
  • 103
2 votes
1 answer
242 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 ...
Ariel Scarpinelli's user avatar
2 votes
1 answer
155 views

Execution order of actions

I want to implement "continious minting" which means first I should call issue, and only then transfer. My contract has a functionality of eosio.token . I call create to create my token with ...
Tigran Sahakyan's user avatar
2 votes
0 answers
53 views

How to get the parent action in the inline action?

There's a contract A with action void a(string memo), it calls an inline action for contract B with action void b(), can I get the "memo" parameter in the function void b()? Note that I can't modify ...
Jimmy Guo's user avatar
  • 1,066
2 votes
0 answers
32 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?
Me-'s user avatar
  • 21
2 votes
3 answers
430 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 ...
Nirdesh Kumar's user avatar
2 votes
1 answer
75 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 ...
Dennis's user avatar
  • 23
2 votes
0 answers
376 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 <...
Kabir's user avatar
  • 843
1 vote
3 answers
337 views

Interacting with a smart contract

How can a user interact with the contract? Is typing the command cleos push action the only option?
Gaurav Kumar's user avatar
1 vote
1 answer
135 views

Dispatcher in smart contract

I want to implement dispatcher in a smart contract. I research about this and understand theoretically but I am not getting practically. Exactly why the dispatcher is to be used? The basic thing I got ...
Varsh's user avatar
  • 307
1 vote
2 answers
174 views

Passing a string to an action?

I have an action that needs to operate on a string: void token::MyAction(std::string key); so I would expect I can make the call like this: cleos push action MyAccount MyAction '["burn"]' -p ...
ekkis's user avatar
  • 515
1 vote
1 answer
632 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?
Jimmy Guo's user avatar
  • 1,066
1 vote
1 answer
154 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 ...
kkurian's user avatar
  • 695
1 vote
2 answers
50 views

How do I confirm that the person sending an action is the same as a user in the parameter?

Specific example from a contract: ... void hi(name user){ // verification here, require_auth(user)? print(user); } ... I've tried require_auth(user) but that seems to always fail unless the user ...
requires_verification's user avatar
1 vote
1 answer
151 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 ...
Ashish Chandra's user avatar
1 vote
1 answer
59 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 ...
noisy's user avatar
  • 727