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
5 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, ...
user avatar
  • 1
0 votes
1 answer
22 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 ...
user avatar
  • 109
0 votes
1 answer
15 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: ...
user avatar
0 votes
0 answers
15 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 + ...
user avatar
  • 1
0 votes
0 answers
17 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 ...
user avatar
  • 11
0 votes
0 answers
42 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 ...
user avatar
  • 1
0 votes
0 answers
9 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 ...
user avatar
0 votes
0 answers
28 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
user avatar
0 votes
1 answer
68 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 ...
user avatar
  • 111
0 votes
0 answers
23 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 ...
user avatar
0 votes
0 answers
7 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
user avatar
1 vote
1 answer
35 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 ...
user avatar
  • 13
1 vote
1 answer
68 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 ...
user avatar
  • 111
0 votes
0 answers
30 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 ...
user avatar
  • 111
0 votes
0 answers
40 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:...
user avatar
  • 21
0 votes
1 answer
41 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-...
user avatar
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 ...
user avatar
0 votes
1 answer
13 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.
user avatar
  • 1
0 votes
1 answer
752 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 ...
user avatar
0 votes
1 answer
35 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: ...
user avatar
1 vote
1 answer
26 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'...
user avatar
0 votes
1 answer
56 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, ...
user avatar
1 vote
1 answer
87 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?
user avatar
0 votes
1 answer
66 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", "...
user avatar
  • 293
0 votes
2 answers
247 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 ...
user avatar
0 votes
1 answer
54 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:...
user avatar
  • 1
0 votes
1 answer
56 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; ...
user avatar
  • 293
1 vote
1 answer
77 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 ...
user avatar
1 vote
0 answers
26 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 ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
0 votes
1 answer
53 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 ...
user avatar
0 votes
1 answer
55 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 ...
user avatar
  • 293
0 votes
1 answer
55 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&...
user avatar
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 ...
user avatar
0 votes
3 answers
61 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::...
user avatar
0 votes
1 answer
66 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 ...
user avatar
1 vote
1 answer
89 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 <...
user avatar
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 ...
user avatar
  • 11
1 vote
0 answers
30 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 ...
user avatar
1 vote
1 answer
85 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 ...
user avatar
0 votes
2 answers
34 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 ...
user avatar
1 vote
1 answer
31 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 ...
user avatar
1 vote
0 answers
21 views

How to set a eos contract on jungle network [duplicate]

As I trying to deploy a contract on Eos Jungle test network using cmd. But I failed to run. Command : cleos --url https://jungle3.cryptolions.io:443 set contract tulsipadalia addressbook -p ...
user avatar
3 votes
3 answers
287 views

Set source file properties called with incorrect number of arguments

When attempting to compile a new contract, I am getting this error. I'm using eosio version 2.1 for this. CMake Error at /home/michael/eosio.cdt/build/lib/cmake/eosio.cdt/EosioCDTMacros.cmake:18 (...
user avatar
1 vote
0 answers
33 views

Where are accounts and smart contracts stored?

I'm a bit confused by answers to the following questions: Where are new accounts stored? Where is the smart contract is stored How can everything be stored on RAM at all time? 3KB for each user means ...
user avatar
3 votes
1 answer
139 views

Returning values from actions

I am trying to return a value from an action as follows: [[eosio::action("test2")]] int test2(int x) { return x; } The code compiles correctly, and the ABI file shows the correct action ...
user avatar
3 votes
1 answer
55 views

How to pass specific eosio-cpp/eosio-ld options via cmake

I'm typically using CMake to compile my contracts, like described here. How can I pass specific eosio-cpp/eosio-ld options (specifically -stack-size) described here?
user avatar
  • 1,794
0 votes
1 answer
119 views

How to Define and use Array of Strings in Struct?

My Sample Struct and its method // Department Table struct [[eosio::table]] department_info { uint32_t ID; std::string deptname; std::string deptcode; std::...
user avatar
1 vote
1 answer
65 views

Difference between _self and get_Authorization and RAM optimization

I have build a Smart Contract with 14-15 Tables for I/O. It will be used to store important data of our platform. I have used require_auth(_self) as this contract will not be used by 3rd person. It ...
user avatar
2 votes
1 answer
40 views

how to find greatest common divisor inside smart contract?

I need the greatest common divisor between two numbers in the smart contract. I tried: int gcd = __gcd(num1, num2); num1 and num2 are two numbers. When the smart contract is compiled, its generating ...
user avatar
  • 293

1
2 3 4 5
13