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
0answers
3 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
13 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
20 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
15 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
28 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
9 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
28 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
12 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 ...
0
votes
1answer
25 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
7 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
28 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
46 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
33 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
24 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
26 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
34 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
26 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
25 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
23 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
66 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
12 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?
0
votes
1answer
33 views

How to check authorization for a particular account in EOS smart contract?

I want to write an EOS smart contract to manage users data. I need that only some admin account will able to add, update and delete users and the particular user can only update data. Can I check ...
0
votes
1answer
22 views

Complex smart contract for rule based auction in multiple currencies

The imagined application allows users to participate in an auction and make bids in cryptocurrencies. There are several behavioral rules that control the execution of the auction and determine the ...
0
votes
1answer
20 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 ...
0
votes
1answer
31 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 ...
0
votes
0answers
32 views

How to catch Error in EOS smart contract?

I am writing a smart contract to add, erase data and write logs accordingly. Below is my smart contract: #include <eosio/eosio.hpp> #include <eosio/print.hpp> #include <eosio/system....
0
votes
1answer
17 views

How to access and manipulate tables when using native unit tests?

I am trying to write unit tests for functions in a smart contract that require access to tables within the smart contract. I tried to set this up using the hello_test.cpp code as a base and when I get ...
0
votes
1answer
24 views

How do I record LOG in eosio smart contract?

I deployed and tested eosio smart contract. I want to record the logs of a smart contract using the web API. How can I do this? I searched but didn't get any satisfying answer. I tried to get logs by ...
0
votes
1answer
14 views

Question cost while using token contract

I am sorry to bother you, I am a little confused about the cost while using a token contract: the contract provider will pay all the utilities if a user using the contract including the CPU, NET and ...
1
vote
1answer
39 views

cleos data getting inserted and deleted but table shows empty record

I have written one smart contract for insert, update and delete data. The smart contract is compiled and deployed to the two accounts. I insert data using calling the action upsert, this transaction ...
0
votes
1answer
19 views

make inline transfer contract and using it on jungle testnet

hello everyone i am faceing a problem on jungle testnet i am trying to make a inline transfer but i got this error after i work with the api_endpoint the code is #include <eosio/eosio.hpp> #...
3
votes
1answer
47 views

Where is the smart contract is stored

I would like to know where the smart contract is stored after the copilation and deployment. Thanks
2
votes
0answers
48 views

Trying to execute a smartcontract action using a multisig account, but it shows executed even when the transc fails due to smartcontract constraints

I'm proposing a transaction to execute an action of some smartcontract, the transaction is showing executed irrespective of failure or success of the smartcontract action(say transferFunds), this is ...
0
votes
0answers
19 views

Make a smart contracts for trade tokens

Hello guys as the title said I want to make a program for trade between different tokens ? P.S: I tried to make a contract that's call token:transfer action for eosio.token contract but I had to add ...
0
votes
0answers
13 views

EOS and IOT to check integrity

I would like to check the integrity of the data sent by the IOT device using EOS. It is the hash of the data that is stored in EOS but the data is stored in the database. I used a smart contract to ...
1
vote
1answer
20 views

Eos-sharp jungle Error 3090003 when trying to call external smart contract

I’m trying to achieve something quite simple. I try to call eosio.token transfer from one of my smartContract (lomtaxjungle dopurchase), but after severals days i still don’t manage to do it. From ...
0
votes
0answers
18 views

Make a trade contract between two tokens like (EOS) & (SYS)

hello everyone i made a small contract that trade between two tokens using eosio.token but if i wasn't work on local test how can i have access to EOS tokens or SYS in the main net and how can i do ...
0
votes
1answer
21 views

Declare custom structs

I am trying to create a custom struct called Student in a contract. Where do I declare or define the struct? I tried to define it in the abi file, but the file was over written when I compile the ...
0
votes
1answer
27 views

Check public keys on contract level

Is it meanwhile possible to check the public key of an account name on contract level? (Not with Cleos) Example: The contract contains some public keys (not the account names). If a user performs a ...
0
votes
1answer
60 views

What is the difference between std::string and eosio::string?

Why should I use eosio::string over std::string? What are the use cases where it would make a difference?
1
vote
1answer
56 views

I have doubts about intercontract communication

I have read that: In order to call an inline action, that is to call an action of contract A from contract B, there is a need to set some special permission. In this case, the Ram payer for the ...
0
votes
1answer
36 views

Contract transaction cannot be found after i get result of pushSignedTransaction

I've send a contract trans on mainnet use eosjs@20, and i've tried for 4 times, every time i get a trans result, but all of them seemed been drop, i cannot find them on explorer or on chain, can any ...
0
votes
1answer
37 views

Strange checksum256->uint64_t casting

I'm trying to cast checksum256 to uint64_t Here is conversion code: uint64_t checksum_to_uint64(const eosio::checksum256 & digest) { auto checksum_bytes = digest.extract_as_byte_array()....
1
vote
1answer
23 views

Profiling EOS.IO smart contract code

What's the best way for profiling the code of an EOS.IO smart contract? I'd like to know what percentage of the CPU time is spent on executing each function\line (including multi index table function ...
0
votes
0answers
23 views

Is it possible to run RSA verification within contract

I am trying to implement RSA signature verification in a contract but am a bit stuck. I implemented RSA signature verification using BigInt, however, because of this, it is not possible to transfer ...
0
votes
1answer
43 views

Trouble using EOSIO built in crypto library (can't resolve headers)

I ran eosio-init on the newest CDT (1.7) and made a -bare project. newtest.cpp #include "newtest.hpp" ACTION newtest::hi( name nm ) { /* fill in action body */ print_f("Name : %\n",nm); } ...
0
votes
1answer
55 views

Is there way to retrieve auto incremented primary key after submission of transaction?

I'm working on sample dApp application to understand the working of multi_index table in EOS smart contract. I have defined two multi_index table. The primary key of table1 is auto incremented using "...
0
votes
1answer
42 views

How to check in my contract the incomming amount?

I would like to check in my contract the incomming amount. I tried these: void mycontract(name from, name to, eosio::asset quantity, std::string memo){ check( quantity.amount > 50, "must ...

1
2 3 4 5
12