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
5 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
31 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
29 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
11 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
23 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
27 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
25 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
24 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
21 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
53 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
32 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
19 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
18 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
30 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
22 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
15 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
0answers
7 views

How do I record LOG in eosio smart contract?

I am writing eosio smart contract. I want to record the logs using a smart contract. How can I do this? I searched but didn't get any satisfying answer. Any help would be appreciated.
0
votes
1answer
11 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
32 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
14 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
46 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
45 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
12 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
19 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
17 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
23 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
43 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
51 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
32 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
34 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
22 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
21 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
36 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
51 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
39 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 ...
0
votes
0answers
15 views

Tools for development at the current stage of EOS

I am a developer coming here from Ethereum. Joining your Telegram chats and following the discussions in it, in my view, you have a lot of experience and helps the new devs. You are actually my dream ...
0
votes
0answers
12 views

Use EOS to check integrity of data

I would like to use EOS to guarantee the integrity of my data stored in a database. Each time I save the data in BD I send the corresponding hash in the Blochain. My questions are as follows: 1- Is ...
0
votes
2answers
70 views

Use UUID as primary key in multi_index

How can I use a uuid as the primary. struct [[eosio::table]] blackboxdata { name user; std::string uuid; std::string hash; std::string sqlrequest; uint64_t ...
0
votes
1answer
34 views

Is it possible to see the RAM delta of a multi_index table operation, or see who is currently paying for a row in a table

My question is in the context of smart contract development, so I'm looking for solutions that work within smart contracts: 1st: Is is possible to see the RAM delta of either an individual ...
0
votes
2answers
26 views

I have some doubts about open function of eosio.token smartcontract

async function openAccount (tokenCreator ) { try{ const result = await api.transact({ actions: [{ account: tokenCreator, //'eosio.token', name: 'open', //'transfer'...
0
votes
0answers
15 views

Callback never gets called

I've got a basic contract working that issues a query and gets a query ID. however, the callback is never getting called. I have the CONTRACT_NAME and ORACLIZE_NETWORK_NAME set correctly (the latter ...
0
votes
0answers
9 views

Checking query IDs on the testnet?

I'm entering query IDs I get when running on Kylin on this website: https://app.provable.xyz/home/check_query but it's failing to find my IDs. I have a feeling that site is looking at mainnet (even ...
0
votes
0answers
11 views

Provable: incorrect account

in reading through this guide: https://docs.provable.xyz/#eos-advanced-topics I'm attempting to see the queries issued to the contract: cleos get actions oraclizeex1a -1 -4 --console but the account ...
0
votes
0answers
18 views

When does start eos_vm in 2.0.0-rc3?

Recently I downloaded the v2.0.0-rc3. I want to know how can eos_vm work on blockchain and when does it start. So I found it. void wasm_interface::apply(...) #ifdef EOSIO_EOS_VM_OC_RUNTIME_ENABLED ....
0
votes
0answers
25 views

How to limit the maximum CPU usage in transcation in EOS smart contracts?

when I used "cleos push action ..... or push transation .....",I used "--max-cpu-usage-ms" to limit the actions not consume more cpu usage. and choice the most economical way to send Non-emergency ...
0
votes
1answer
23 views

on_notify fails to compile

I'm following the guidance at https://developers.eos.io/eosio-home/docs/notification-handlers where it states I can decorate a method with: [[eosio::on_notify("eosio.token::transfer”)]] however, ...

1
2 3 4 5
12