Questions tagged [smart-contract]

Anything related to decentralized application (dApp) development, concepts, and possibilities with smart contracts, or technical questions for the development of smart contracts.

Filter by
Sorted by
Tagged with
0 votes
1 answer
8 views

Get table row count or property from the last row

As I said I need to get the count of rows in a table. Preferly via rpc with http plugin or from a new action inside the Smart Contract. This is my Smart Contract: #include <eosio/eosio.hpp> ...
0 votes
0 answers
14 views

High Cost to Mint an NFT on Wax Network

I am trying to mint an NFT on the wax network by following this tutorial: https://developer.wax.io/en/tutorials/create-nft/nft_use.html For some reason, the cost is 377084 bytes of RAM. Console-Output:...
0 votes
0 answers
19 views

What is the maximum size of smart contract?

I'm developing a smart contract and yesterday I couldn't deploy it into testnet with error: root@698a02be20d9:/# cleos --verbose set contract myaccount /work/mycontract -p myaccount@active Reading ...
  • 11
0 votes
2 answers
14 views

Get Action Index (or contract) from inside notification

Is there a way to get the index (ordinal) of the current action that is being processed? If you could access apply_context you could do get_action_id() but afaik that isn't exposed inside an action. ...
  • 101
0 votes
0 answers
23 views

Lost value of vector when passed from one function to another

I have a function that receives a vector and passes it to another function. However, when the second function tries to use it, the vector seems to have lost its values. void getTeam(const vector<...
  • 51
0 votes
1 answer
13 views

Efficency of Actions

I am new to smart contracts, and I am developing a smart contract for a game. I am trying to understand if the smart contract that I created is efficient or not. I have deployed the smart contract on ...
0 votes
1 answer
14 views

How to get name of account which is processing action recent in contract?

I need to authorize with admin table of contract. but I could not account name which is processing action of contract. Let me know about any eos function to get account name, if anyone know well. ...
  • 1
0 votes
0 answers
20 views

Adding Ricardian Clause

I am new to eosio and so far I have been learning using EOS Studio. I have come to the point where I would like to be able to write some Ricardian Clauses in the abi file but EOS Studio does not seem ...
0 votes
1 answer
14 views

how can my on_notify trigger calls contract actions (permisson issue)

I need to write a contract that automaticaly mint nfts when tokens are being transferred. So i have my : [[eosio::on_notify("*::transfer")]] void logdeposit(name from,name destination, ...
  • 1
0 votes
1 answer
28 views

how to get cpu usage of prev. actions in contract call?

Is it possible to figure out before transaction is completed, how much CPU an action in a smart contract will use? E.G. I make transaction with X actions + call to my smart - contract. Is possible to ...
  • 109
0 votes
1 answer
19 views

What is the eosio private key when running on local?

I was trying to test the smart contract I created in my local but I am currently blocked as I cant create a new account. As per EOS documentation, I used the command below to create a new account: ...
0 votes
0 answers
22 views

How to get index of week from time_point_sec(current_time_point())

How to get index of week from time_point_sec(current_time_point()) uint64_t addDay = (86400 * 3); time_point_sec start_at = time_point_sec(current_time_point()); time_point_sec end_at = create_at + ...
  • 1
0 votes
0 answers
27 views

Smart Contracys - Migration from Ethereum to EOS

I spent a lot of time to develop a number of smart contracts for the Ethereum blockchain, with custom functions I would use for my personal projects. Now I am exploring EOS and I would like to migrate ...
  • 11
0 votes
0 answers
52 views

Deploy contract from downloaded WASM and ABI file

I'm trying to redeploy an old version of a currently deployed contract to a new account. I have tried downloading the .wasm and .abi file from a block explorer and deploying it to a this new account ...
  • 1
0 votes
0 answers
10 views

Can I make a snapshot which contains less blocks than the actual blockchain?

My goal is to make a snapshot which contains the state of the blockchain untill a specific block (probably not block header). So the specific block must be "older" than the block header. For ...
0 votes
0 answers
52 views

Get multiple rows in eosio smart contract

I have table with multiple rows for one account and i need to get all of his rows in mu smart contract, but i can't understand how i can get all rows in one time . Can someone explain me? thanks
0 votes
1 answer
99 views

How to deploy a smart contract on the mainnet?

I created and tested my smart contract on testnet. Now I want to deploy it on mainnet, I assume I have to purchase some EOS token and buy ram, cpu and net... I can't find anything in the docs about ...
  • 111
0 votes
0 answers
36 views

Using std::map inside multi-index

I was thinking on good practices when creating the persistence using the multi-index API, more specifically regarding future updates to the table model (ie. adding new members to the struct). All the ...
0 votes
0 answers
13 views

any way to know inline action depth on blockchain explorer

the following error was encountered recently, any way to check the inline action depth of the transaction on blockchain explorer or other approach? max inline action depth per transaction reached
1 vote
1 answer
37 views

confusion with contract names and account names in eosio testnet

When writing contracts, the contract class in file name_a.cpp is defined as follows: class[[eosio::contract("name_a")]] name_b : public contract {..} In my understanding the name of the ...
  • 13
1 vote
1 answer
87 views

Can I make a http request from smart contract code?

I know that eosio has http plugins, which is why I'm thinking that maybe a http library is embedded to the eosio.hpp and that I can use it internally to send http requests. Is this possible? My goal ...
  • 111
0 votes
0 answers
39 views

How to link an external library to my eosio smart contract?

I normally use eosio-cpp to compile my smart contract, but recently I needed to use an external lib and link to it to build my project. I checked the docs here, but it basically shows how to use cmake ...
  • 111
0 votes
0 answers
42 views

how can i pass array of integers to smartcontract action using SwiftSDK

I have following action in my smartcontract: ACTION uploadfile1 (name creator, vector<uint8_t> content, string filename) I'm trying to push action from my Swift application using following code:...
  • 21
0 votes
1 answer
48 views

Immutable smart contract

In EOS, smart contracts can be updated by the account owner. This could be a problem for certain applications in finance. For instance, if I want to deploy a token, the transfer function should be non-...
0 votes
0 answers
16 views

Does anybody have a complete code example of changing the e.g. active key of a contract account from within that contract?

I want a contract to set its active permission to a hardcoded key (an "EOSxxxx" string) from within the contract code, but I can't find an actual complete code example that works. This ...
0 votes
1 answer
18 views

Caller of action detail in code

I need to check Account of caller action ,as in ethereum we have a concept of msg.sender to get the caller eth_address, similar is there a way to get caller of action details in EOS.
  • 1
0 votes
1 answer
911 views

WAX - Signature error : "Message: transaction declares authority, but does not have signatures for it."

I'm trying to send a transaction from my react frontend to local chain, I have signed in wax cloud wallet and made a transaction. But at last I met this signature error. "Message: transaction ...
0 votes
1 answer
43 views

Nested depth exceeded

kipping set abi because the new abi is the same as the existing abi Publishing contract... Error 3070002: Runtime Error Processing WASM Error Details: Nested depth exceeded pending console output: ...
1 vote
1 answer
29 views

cdt1.8.1 compile issue

error encountered when compile the contracts with cdt 1.8.1, any idea? /usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/bin/../include/boost/pfr/detail/core17_generated.hpp:38:9: error: type 'swaps_row'...
0 votes
1 answer
62 views

EOSIO failed when using Smart Contract Action with updated Parameters

I deploy a Smart Contract first time and the action becomes usable as it's supposed to be, but when Action's parameters is updated with a new one between existing p1 and p2 old parameters (result: p1, ...
1 vote
1 answer
134 views

Is it allowed to look up tables of another contract?

Imagine if I have an account with contract. Is it allowed for me to look up tables of some another contract from my contract action?
0 votes
1 answer
78 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", "...
  • 297
0 votes
2 answers
296 views

How to call Wax action in PHP

All of the tutorials on building dApps, they use Javascript and then they tell you how NOT to do it by using your PK to create a signature. So I'd like to use PHP on the backend and grab my key from a ...
0 votes
1 answer
66 views

Cleos set contract, Internal Service error timeout_exception

I am running EOS on my laptop. If I execute the "cleos set contract" command and the contract size is more than 200kb, I get an error: error 2021-06-01T17:44:30.084 http-1 http_plugin.cpp:...
  • 1
0 votes
1 answer
74 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; ...
  • 297
1 vote
1 answer
93 views

Can a smart contract perform actions on a scheduled delay indefinitely?

I am pretty new to working with EOS, so please excuse my ignorance and improper terminology. I am trying to repeatedly excecute a given action on a set time delay. For example, trying to submit a ...
1 vote
0 answers
28 views

Build existing autoconf C project to include in smart contract

I'd like to include GNU's GMP library in my smart contract project. It's an autotools/autoconf project, how can I compile it as a standalone webassembly library and then include it in my smart ...
0 votes
1 answer
135 views

Tables of a smart contract: public or private?

I was wondering about the ramifications of having tables declared public. Since EOSIO is a transparent blockchain anyone can read tables of any contract. So having them declared public in a smart ...
0 votes
1 answer
56 views

How much RAM does a smart contract consume?

I have a smart contract compiled resulting in a 10,961 Bytes wasm file and a 2,372 Bytes abi file. However, when deploying the contract on chain it consumes about 110,000 Bytes which is almost 10x the ...
0 votes
1 answer
62 views

Compiling smart contract not getting done

I have a setup of multi-node of 4 peers blockchain. Blockchain is running, few days before I deployed the smart contract and using it to save data on the blockchain. Now, I did some changes to the ...
  • 297
0 votes
1 answer
68 views

Using a smart contract table. How can I query a row using another field instead of the primary key id?

How can I query a smart contract table to return a row instead of using the primary key id? I have the following: https://jungle.bloks.io/account/mybest111111?loadContract=true&tab=Tables&...
0 votes
2 answers
38 views

how to make sure the tx to be included in block

as subject, any way to make sure the tx to be included in block, what i think of is, if the tx meet the condition, then notify the contract to execute the specified action, otherwise notify an account ...
0 votes
3 answers
81 views

on_notify does not get triggered

I am using a very simple example: mycontract.hpp: [[eosio::on_notify("eosio.token::transfer")]] void depos(name from, name to, asset quantity, string memo); mycontract.cpp: [[eosio::...
0 votes
1 answer
69 views

Issues regarding the update of a staking contract

Suppose that we need a token staking mechanism (similar to the stake and lock function introduced in the EOSIO training). Someone owns that contract. Now the question is: How would the rest of the ...
1 vote
1 answer
96 views

How to access data inside multi-index table when using 2D vector / 2D array?

What is going on? :D I write data, but cannot find it after I write it. The following code successfully emplaces the row into the multi-index table: See specifically the vector<vector <...
1 vote
0 answers
20 views

getting error when i try to add permission to a user who is signing a smart contract action

here is what i am trying to do : users will sign a specific action which will take their username, permission_name, smart_contract_name, action_name, public_key i am trying to assign the user ...
  • 11
1 vote
0 answers
31 views

How can i update a table by TransactionID? And can transactionId be the same when we update the data?

I am running my nodeos on my local machine, I can retrieve all the data via api and do some CRUD also. I have succeeded update the table by tableId, But can someone suggest to me how do I update the ...
1 vote
1 answer
98 views

nested stuff inside index_table

I'm trying to build a small hearthstone like game and I've finished up the front-end for the game client. I created a NoSQL mockup of the user data and now it's time to move those to the index_table ...
0 votes
2 answers
39 views

How check deferred transaction logs on EOS jungle testnet?

As I working on jungle testnet and perform a 1 deferred transaction with some scheduled automatic time. But I failed to see transaction logs on the jungle testnet. Can any please guide me here with ...
1 vote
1 answer
33 views

How to get table data from Jungle testnetwork?

I am trying to get all the insert data using get table on jungle testnet. But I was failed and get only an empty row value. command: cleos --url https://jungle3.cryptolions.io:443 get table ...

1
2 3 4 5
13