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
6 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> #...
1
vote
1answer
27 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
34 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
11 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
13 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
15 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
19 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
27 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
34 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
24 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
24 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
19 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
19 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
30 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
30 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
28 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
10 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
45 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
25 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
11 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
8 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
14 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
22 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
22 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
7 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
32 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
120 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
27 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
15 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
37 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
15 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
23 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
28 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 ...
0
votes
1answer
16 views

How min_activated_stake and total_activated_stake is calculated?

I have a query, in the producer_pay contract, i don't understand how min_activated_stake is calculated here. Also how total_activated_stake is calculated, I've seen that default it's value is defined ...
0
votes
0answers
40 views

Code abstraction

I need a little guidance. I've been structuring my code like this: #include <eosio/eosio.hpp> class [[eosio::contract("table")]] Square { private: struct [[eosio::table]] square { ...
0
votes
1answer
162 views

call to implicitly-deleted copy constructor

I'm unable to compile a small test contract and am hoping for guidance. I have a class called Account, in the following 2 files: // --- account.hpp #pragma once #include <string> #include &...
0
votes
1answer
8 views

What should I do to specify an optional action parameter for cleos?

I wrote an action that has an optional parameter, as something like: [[eosio::action]] void foo(..., const std::optional<name>& recipient); Then in the generated .abi, it is represented as:...
0
votes
1answer
121 views

How can we retrieve table data with secondary Index in EOS table

this is my table struct [[eosio::table]] payment_made { uint64_t pay_id; uint64_t loan_id; uint64_t pay_amunt; time_point_sec pay_date_req; time_point_sec pay_date_approve; ...
0
votes
2answers
34 views

SELECT value from “column” for which row is retrieved

Problem Say I have a table with the following structure. int value | asset tokenType 4 | 0 bitcoin 7 | 0 altcoin. Now I also have this function where I pass in an asset and i want to ...
0
votes
0answers
31 views

Problem in deferred transaction function

I have added the problem statement as a comment in code so please read the commented line in code. void mainloan::checkdaily(uint64_t loan_id) { require_auth(_self); auto itr = loan_table.find(...
0
votes
2answers
79 views

how do i use current_time_point() to store date in eos table

I have tried This way and its not getting store,infact its giving me error,please sugguest if im making any mistake. error: use of undeclared identifier 'current_time_point'; did you mean '...
0
votes
1answer
15 views

Return token to owner after initiating a transfer to my contract

Good Day, I am working on a contract where for example, If I send 2 ETH to a contract, ( 1 ETH = 2 Cryptokitty tokens ) then that contract is supposed to return me 4 Cryptokitty tokens. What I Have ...
0
votes
0answers
12 views

How to use md5.sum in eos contract

I search nothing about md5 in eosio source code. When i use external md5 lib, i encounter the link error like this 'env._Z7md5sum6NSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE ...
0
votes
1answer
52 views

Store enum value in table

I have a simple enum (or enum class, neither one is working ) enum vote_option { upvote = 0, downvote and a table which will store a value of that enum type. struct [[eosio::table]] poll { ...

1
2 3 4 5
12