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
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
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
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
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
3 votes
2 answers
127 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
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
1 vote
1 answer
630 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
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
0 votes
1 answer
342 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?
Jimmy Guo's user avatar
  • 1,066
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
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
4 votes
2 answers
519 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
0 votes
1 answer
584 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" ...
mochunhei's user avatar
  • 277
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
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
2 votes
0 answers
370 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
2 votes
1 answer
102 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
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
4 votes
2 answers
713 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
3 votes
1 answer
301 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
1 answer
596 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
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
4 votes
1 answer
753 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
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
1 vote
1 answer
541 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 ...
Magic Man Xpress's user avatar
5 votes
1 answer
337 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
2 votes
1 answer
414 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
1 vote
1 answer
123 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 ...
Ariel Scarpinelli's user avatar
2 votes
1 answer
240 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
1 vote
1 answer
152 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
3 votes
1 answer
731 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
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
1 answer
975 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

1
2