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
10 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
9 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
24 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
16 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
26 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
14 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
13 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
6 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
9 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 ...
0
votes
1answer
19 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
12 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
44 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
40 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
17 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
16 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
19 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
21 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
36 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
41 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
26 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
31 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
21 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
32 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
41 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
29 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
11 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
54 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
28 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
14 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
17 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, ...
0
votes
0answers
9 views

How to interpret the contract?

LLVM was designed the way(Picture). And I want to know if i understand correctly. Smart Contract is byte code. So EOSIO need to interpret the byte code. EOSIO use WAVM converting to Middle End IR ...
0
votes
1answer
47 views

How to parse json string in contract?

My contract want to receive transfer with memo in json format, is there any libraries supporting the json parse?
0
votes
0answers
123 views

eosio.contract unit_test error “critical check validate()” when added new global table and bps change

i get the an error from the eosio.contract unit_test as follow: /eosio/1.8/include/eosio/testing/tester.hpp(364): fatal error: in "eosio_system_tests/vote_producers_in_and_out": critical check ...
0
votes
1answer
34 views

I would like to make listener contract

I would like to make a contract, wich listens to the incoming transfers. How do I make a listener contract, wich listens to incoming transfers on the account?
0
votes
0answers
17 views

Amount deposited not being recorded in contract

I'm learning to make my own contract and I'm having a hard time getting LNX that is transferred to the contract to be recorded ad a balance. #include <eosio/eosio.hpp> #include <eosio/asset....
0
votes
2answers
43 views

How to pay for user resources cost for payable action?

I have a smart contract which has a payable action defined. I want to cover the cost of transfering token to my contract, what's the best way to do this? Thanks.
0
votes
1answer
29 views

Static values get mangled

if you run the following (on eosio v1.8.4): #include <eosio/eosio.hpp> #include <eosio/asset.hpp> namespace eosio { class UTL { public: static name code; ...
0
votes
0answers
16 views

Intersect multi index with vector

So i have a vector with eosio::names and my table has a primary key of the same type. I want the result of the intersection in my table as end result. Existing table data (other row fields) need to be ...
0
votes
1answer
24 views

Function not giving expected output Eos smart contract

My contract .Cpp part void mainloan::adduwr(name acc_name, double interest, uint64_t loan_amount ) { print("Adding underwriter", acc_name); // require_auth( _self ); uwr_table.emplace(get_self(...
0
votes
1answer
44 views

Convert String to double (flaot32/float64) in EOSIO [duplicate]

serialize support for float types is not added in flutter and thats why i have to come to this way,so if anyone have any working example for this,ill be really thankful for that. I have tried this ...

1
2 3 4 5
12