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
1
vote
0answers
13 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
1answer
20 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
1answer
20 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
1answer
20 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 ...
0
votes
1answer
16 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
2answers
15 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
3answers
22 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
1answer
17 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 ...
0
votes
0answers
31 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
0answers
11 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 ...
1
vote
0answers
24 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
1answer
26 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
2answers
24 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
1answer
24 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
vote
0answers
18 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 ...
2
votes
1answer
75 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 (...
1
vote
0answers
23 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 ...
3
votes
1answer
43 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 ...
3
votes
1answer
37 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?
0
votes
0answers
14 views

Implement Shamir Secret Algorithm in smart contract

I need to implement Shamir's Secret algorithm in EOS smart contract. Looking for some open source libraries which will support EOS. I researched some here https://github.com/topics/shamir from which I ...
0
votes
1answer
35 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::...
1
vote
1answer
35 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 ...
2
votes
1answer
24 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 ...
0
votes
0answers
17 views

Generate random numbers in the smart contract

I am writing smart contract and stucked on this line : int p = 0; p = (rand() % 997); This is giving error error: use of undeclared identifier 'rand' I do search and got some reference links but ...
0
votes
0answers
14 views

Read EOSIO contract state with dfuse

I need to read (not stream) data (a table row) from an EOS contract (JavaScript). How? I could use dfuse, because it's free. In fact, I need to read an article HTML (knowing its title) from Everipedia....
0
votes
1answer
22 views

Is it possible to get the initiating contract name from a token transfer?

When an external account transfers tokens to my account (which has a contract with an "on_notify" action for incoming transfers), is there any way I can get the name of the contract that ...
2
votes
1answer
17 views

cleos push action is not working on multihost peer node

I have a setup of multinode, one genesis node and another host node inita connected to the genesis node. Nodeos is running on both hosts. Genesis node is producing blocks and inita is receiving them. ...
0
votes
1answer
23 views

What does 'datastream<const char*>' mean in this code?

From this tutorial addressbook(name receiver, name code, datastream<const char*> ds): contract(receiver, code, ds) I'm not familiar with 'datastream' and Googling isn't turning up any precise ...
0
votes
1answer
30 views

Calling external action with 'action_wrapper' and 'action'

In contract we have two way to call another action: Use 'action' action(permission_level{get_self(), eosio::name{"active"}}, eosio::name{"eosio"}, ...
1
vote
1answer
25 views

Does the size of a contract affect CPU consumption

Does the size of a contract increase CPU consumption in general? To my knowledge, there may be several secondary factors that slow down the processing of transactions. For example, a memcpy command ...
0
votes
1answer
37 views

How can I change quantity in transfer

Good Day!! I want to change add_balance in transfer How can change quantity value in add_balance? Ex) invalid operands to binary expression ('eosio::asset' and 'int') add_balance( to, quantity - 100 , ...
0
votes
1answer
68 views

EOS Blockchain How to free up RAM or optimize Smartcontract

We have developed a small program that uses the EOS blockchain and we are storing some of our data in an EOS smart contract. Together with a UUID we are storing the object status. Our goal is to have ...
0
votes
0answers
13 views

invalid_ref_block_exception

I am trying to test a smart contract via eoslime tool. Using nodeos, but the node is not localhost(default). So, I installed and trying to deploy the smart contract using: eoslime deploy --network.url=...
1
vote
1answer
39 views

Smart contract compiling loop

When I try to compile the contract the process creates an infinite loop. Here is my code, please help! kjnjrwsyxszg.cpp #include "kjnjrwsyxszg.hpp" void kjnjrwsyxszg::create(const name owner,...
0
votes
0answers
14 views

what is eosio.contract 1.9.x for when 1.8.x is still developed?

i see that contract 1.9.1 is out and 1.8.4 has a rc. What are differences or when to use 1.9.x and when 1.8.x? I read somewhere (few months ago) that eosio 2.0 and contract 1.8.x have difficulties ...
1
vote
1answer
37 views

Multiple transaction hash collisions on mainnet

There are currently multiple transaction hash collisions in consecutive blocks in EOS as noted below: 7dcdcdb558028c7703faddee96e1aa48e9bbe7cd3a07cd0a74513a3599185b40 at block 10712420 and 10712421 ...
0
votes
0answers
8 views

How to find current week number inside a smart contract?

Is it any effective way to know inside eosio contract which week number is now? e.g. kind of epoch converter for eosio? Rgds
0
votes
1answer
96 views

Convert type string to type checksum256

fist off let me get this strait, yes I know the dangers of memo parsing, yes I am aware of the vulnerabilities that can be created from doing such a process, so please there is no need to lecture me ...
1
vote
0answers
6 views

is there a service that creates EOS or TRX div tokens?

is there a service that creates EOS or TRX div tokens? Or can someone point me in the right direction? Thank you
-1
votes
1answer
48 views

What's the max speed of EOSIO contract?

I try to do performance testing about EOS contract. I built private EOS network with 6 nodes. I use apache bench to formulate http requests, and post to EOS service http://127.0.0.1:8888/v1/chain/...
0
votes
1answer
45 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 ...
0
votes
1answer
31 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", ...
0
votes
1answer
30 views

eoslime test not saving data in table

This is my first experience with eoslime as I want to do unit testing for smart contracts. Not much experienced with nodejs .I am following eoslime documentation: https://docs.eoslime.limechain.tech/...
0
votes
2answers
58 views

how to define a vector with fixed size?

I want to define a vector of strings with a fixed size 3 in the multi-index table of smart contract. I search and tried different ways which I found for CPP vector like: std::vector<string> abc(...
0
votes
1answer
28 views

Wrong table name in scope response

My contract has two tables mcat and mcatmig. Problem: scope request return wrong table name mcat........1 instead of mcatmig: % cleos get scope teresacode { "rows": [{ "code": "teresacode", "...
0
votes
0answers
30 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 ...
0
votes
0answers
35 views

How to set vector type field as a secondary index in smart contract?

I want to set a group vector as a secondary index in the user smart contract. group is the list of groups. Following is the changes I am doing: struct [[eosio::table]] usertable { ...
0
votes
1answer
114 views

Multiple smart contracts with single account

I have three smart contracts (A, B, C) and one account (X). As the requirement is I just need only one authority (administrator) who is going to manage all these smart contracts data. So I deployed ...
0
votes
0answers
14 views

How to give and check relationship between two smart contracts?

I am working on two smart contracts Users and Groups. The relation is one user can have many groups. Can I have such a relation in these smart contracts? After smart contract deployment and data ...
0
votes
0answers
11 views

Does EOS.IO's ChainAPI supports Ethereum's `eth_call` style capability? [duplicate]

In Ethereum RPC, there is an eth_call that allows to execute a smart contract function on the RPC node. Does EOS.IO's ChainAPI supports the similar capability with eth_call?

1
2 3 4 5
12