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
0 votes
0 answers
19 views

Error: assertion failure with message: Signing value already used

I try to do several actions in one transaction on Wax blockchain in Node.JS. All accounts share same active key. Sometimes it works and everything is fine, but mostly I get an error: "assertion ...
Solvo doo's user avatar
0 votes
1 answer
35 views

How to get account name of current action?

I am gonna get account name of caller(wallet) in my action of smart contract. I used functions current_receiver(), get_sender(), get_first_receiver(). but I got contract`s account name and empty ...
Back-end expert's user avatar
0 votes
1 answer
107 views

Is there a C++ library just like eosjs?

I want to sign and send transactions (generally trigger any smart contract action) from a c++ external app. How can I do this? If my app was in javascript, that would be easy since I know that I can ...
basilisk's user avatar
  • 131
0 votes
1 answer
104 views

Passing struct as a parameter to smart contract action

I want to save data in the blockchain table whose format is as below: { "docsample": { "id": 1, "creationDate": "2012-05-16T18:25:43.511Z", "...
Varsh's user avatar
  • 307
0 votes
1 answer
157 views

Building a contact in EOS Studio and getting eosio.code permissions when calling it

After deploying a contract built in EOS Studio ... on my call to another action where I have called 'permission_level()' ... I get a permission error "transaction declares authority '{"actor&...
Todd Vance's user avatar
0 votes
1 answer
89 views

Traverse multi-index table through non-primary value and delete the record

Below is my smart contract: #include <eosio/eosio.hpp> #include <eosio/print.hpp> #include <eosio/system.hpp> #include <string> using namespace eosio; using std::string; ...
Varsh's user avatar
  • 307
1 vote
1 answer
39 views

Difference between Action and functions?

I want to know what is an action? What is the difference between actions and functions.
Zain's user avatar
  • 13
0 votes
1 answer
51 views

cleos: add auth level to account with specific key pair and limited permissions

Each EOS account has two key pairs: "@owner" and "@active". I want to add another key pair under the name "@limited" which I can use in an unsafe environment (VPS) to ...
mschoenebeck's user avatar
1 vote
1 answer
28 views

addressbook example. Where is the message used in the notify action?

Section 2.6 of the EOSIO developer docs https://developers.eos.io/welcome/latest/getting-started/smart-contract-development/adding-inline-actions describes how send an inline action. It all works fine ...
tommccann's user avatar
1 vote
1 answer
133 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
0 votes
1 answer
52 views

EOSlime TypeError: Contract.actionname is not a function

This is my test file: const assert = require('assert'); const TOKEN_WASM_PATH = './contracts/group/group.wasm'; const TOKEN_ABI_PATH = './contracts/group/group.abi'; describe("EOSIO Group", ...
Varsh's user avatar
  • 307
0 votes
0 answers
87 views

How to generate unique string id from given array of strings in smart contract?

I am writing an EOS smart contract in which need to write the action to generate a unique id from the given array. Array consisting of n number of string elements (UUID). Suppose I pass 10 strings to ...
Varsh's user avatar
  • 307
0 votes
1 answer
38 views

Take output from GetActions and send to database using eossharp

I am using eos-sharp to get data from the eos smart contract. I am trying to get actions data by using: var resultaction = await eos.GetActions("dqzmember", 0, 30); I need information from ...
Varsh's user avatar
  • 307
0 votes
1 answer
102 views

how to save data in mongodb from eos smart contract?

I am getting the actions log data using an action constructor in a smart contract. I need to save this data in MongoDB from the smart contract. How can I do this? I didn't get exactly my required ...
Varsh's user avatar
  • 307
0 votes
1 answer
149 views

What should I do to specify an optional action parameter for cleos?

I wrote an action that has an optional parameter, as something like: [[eosio::action]] void foo(..., const std::optional<name>& recipient); Then in the generated .abi, it is represented as:...
Keisuke Kanao's user avatar
0 votes
1 answer
81 views

Are all actions on a transaction supposed to be included in the block?

I've noticed something strange that is confusing me. I have a transaction that includes multiple actions on it, but it appears that the "transfer" action did not get recorded in the actual block. You ...
Deezy's user avatar
  • 1
4 votes
2 answers
283 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
0 votes
1 answer
43 views

Return token to owner after initiating a transfer to my contract

Good Day, I am working on a contract where for example, If I send 2 ETH to a contract, ( 1 ETH = 2 Cryptokitty tokens ) then that contract is supposed to return me 4 Cryptokitty tokens. What I Have ...
Niana 's user avatar
  • 105
2 votes
1 answer
146 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
0 votes
0 answers
60 views

How can i Improve my code (Transaction took too long)

I have Enough CPU and NET i have staked 13 EOS for each and still unable to run the code. Please suggest if i can improve anything. IS there any problem of table index Got this from developer.io if ...
guruprakash gupta's user avatar
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
1 vote
1 answer
464 views

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

I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two But I have to use not eosio.token contract but ...
Dim's user avatar
  • 21
1 vote
0 answers
35 views

How to view links between actions and permissions?

Currently I create permissions perm* for user user, and authorize it to push action action* to the code-containing account code like so: cleos set account permission user perm* PUBLIC_KEY active ...
LemmeTestThat's user avatar
0 votes
2 answers
145 views

How to automatically push an action when EOS is sent to the contract

I am looking for an alternative to the payable function of Ethereum in EOSIO. I want to invoke an action when EOS is sent to the contract. Is it possible?
Muhzin's user avatar
  • 510
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
2 votes
1 answer
99 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
0 answers
52 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
0 votes
2 answers
84 views

Transaction took too long while using std::shuffle

Get the error when I push a action on my contract on the local testnet: But if I remove this code from the action I called, there is no problem: class urng: Does anyone know what caused this?I just ...
Lich's user avatar
  • 3
5 votes
1 answer
588 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
2 votes
2 answers
698 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
62 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
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
0 votes
1 answer
82 views

Is it possible to overload contract actions?

I had a method: -- t.hpp -- [[eosio::action]] void exchange(); -- t.cpp -- void token::exchange() { ... } EOSIO_DISPATCH(eosio::token, (exchange)) and then decided that if a parameter were ...
ekkis's user avatar
  • 515
1 vote
2 answers
173 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
0 votes
1 answer
795 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 ...
Jyothi's user avatar
  • 73
1 vote
1 answer
615 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> #...
Riccardo Persiani's user avatar
1 vote
0 answers
103 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> #...
Riccardo Persiani's user avatar
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
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
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
0 votes
1 answer
972 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 ...
Max's user avatar
  • 411
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
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
1 vote
2 answers
353 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 ...
Magic Man Xpress's user avatar
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 Choudhary'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
0 votes
0 answers
343 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", <...&...
Gassa's user avatar
  • 598
0 votes
2 answers
2k 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 ...
Riccardo Persiani's user avatar
3 votes
1 answer
447 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
1 vote
3 answers
336 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