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
2 answers
95 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'...
AditiB's user avatar
  • 235
0 votes
1 answer
49 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, ...
ekkis's user avatar
  • 515
0 votes
1 answer
275 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?
Jimmy Guo's user avatar
  • 1,066
0 votes
1 answer
89 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?
Efraim's user avatar
  • 1
2 votes
1 answer
47 views

Amount deposited not being recorded in contract [closed]

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....
Bill's user avatar
  • 291
0 votes
3 answers
156 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.
Tommy Jiang's user avatar
0 votes
1 answer
42 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; ...
ekkis's user avatar
  • 515
0 votes
1 answer
41 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(...
guruprakash gupta's user avatar
0 votes
1 answer
155 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 ...
guruprakash gupta's user avatar
0 votes
1 answer
27 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 ...
Neel's user avatar
  • 3
0 votes
0 answers
44 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 { ...
ekkis's user avatar
  • 515
0 votes
1 answer
2k 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 &...
ekkis's user avatar
  • 515
0 votes
1 answer
145 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:...
Keisuke Kanao's user avatar
0 votes
1 answer
560 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; ...
guruprakash gupta's user avatar
0 votes
2 answers
144 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 ...
Niana 's user avatar
  • 105
0 votes
2 answers
366 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 '...
guruprakash gupta's user avatar
0 votes
1 answer
41 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 ...
Niana 's user avatar
  • 105
0 votes
1 answer
236 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 { ...
Tigran Sahakyan's user avatar
0 votes
1 answer
160 views

How to remove deployed smart contract?

I want to sorta "undeploy" smart contract as it was not deployed ever. If it is possible, I hope it will cleanup account's RAM. And I'm not talking about freezing .
Tigran Sahakyan's user avatar
1 vote
0 answers
25 views

How to retrieve tx object within contract

I'm trying to retrieve tx within contract, but I only can find tx_hash using read_transaction. Anybody can help me?
Mikky Snowman's user avatar
2 votes
1 answer
138 views

Execution order of actions

I want to implement "continious minting" which means first I should call issue, and only then transfer. My contract has a functionality of eosio.token . I call create to create my token with ...
Tigran Sahakyan's user avatar
1 vote
0 answers
26 views

How to view Macro extended code?

I use this command is ok: eosio-cpp hello.cpp -o hello.wasm But I want to view Macro extended code by option -E - Only run the preprocessor, I use this command: eosio-cpp hello.cpp -E And get ...
fospring's user avatar
1 vote
1 answer
180 views

Wondering how to fix eosio.token transfer error in contract

I am developing an EOS dapp game When the user acts on the contract after Scatter authentication, the logic is to deposit the bet amount from the user to the contract account. But I get an eosio....
Jeong-Ho Yu's user avatar
0 votes
0 answers
47 views

Catch errors when calling deposit

When I send EOS in a contract to several recipients, it can happen that this fails, e.g. because a recipient has a contract running like that: Example contract of one recipient: [[eosio::on_notify("...
elpol's user avatar
  • 1
1 vote
3 answers
223 views

How does Jungle testnet create new account?

I have created new account in https://monitor.jungletestnet.io . I have a copy of the log # eosio <= eosio::newaccount {"creator":"junglefaucet","name":"myaccount","owner":{"threshold":1,"keys":[{...
Tigran Sahakyan's user avatar
0 votes
1 answer
167 views

how to connect eos smart contact with flutter app

flutter has this package name Eosdart,Im able to get the detail from blockchain with app like account detail,but im unable to push the transaction. I want to push a transaction which carry argument ...
guruprakash gupta's user avatar
3 votes
1 answer
375 views

Sending transaction with Scatter from a single-page application

Request for help: I need a simple example of sending transaction (pushing a contract action test) by Scatter written in plain JS for a single-page browser scrip without any requirjs , vue , angularjs ...
Spark E2's user avatar
0 votes
0 answers
59 views

How can i Improve my code (Transaction took too long)

I have Enough CPU and NET i have staked 13 EOS for each and still unable to run the code. Please suggest if i can improve anything. IS there any problem of table index Got this from developer.io if ...
guruprakash gupta's user avatar
0 votes
1 answer
64 views

COMPILATION ERROR error: static_assert failed "Something went wrong. Please report this issue to the github

Getting an error when the code reaches this particular function. Is there something obvious I am missing here? Kindly Note this is Deferred transaction Please ask if anything else is required from ...
guruprakash gupta's user avatar
0 votes
1 answer
143 views

multi_index table get const_iterator at a specific position

is there a better way than a loop to get the value/const_iterator at a specific position in multi_index table? current: auto idx = _table.get_index<"name"_n>(); const_iterator b; int count = ...
sinbad's user avatar
  • 99
0 votes
1 answer
201 views

COMPILATION ERROR error: non-type template argument is not a constant expression

what is causing this error while im compiling ? struct [[eosio::table]] requestForLoan{ uint64_t req_id; name borr_name; uint64_t borr_id; name uwr_name; uint64_t uwr_id;...
guruprakash gupta's user avatar
0 votes
0 answers
417 views

Error message assertion failure with message: "read"

I made my own smart contract. and tried to erase my table. But it didn't. I will attach the following error { "code": 500, "message": "Internal Service Error", "error": { "code": 3050003, ...
T Eom's user avatar
  • 88
0 votes
1 answer
76 views

Is there RPC API endpoint to request how much resources account uses?

Is there any way to track or get information about current user account resources consumption using RPC API? I.e. how many operations can be executed with the current tokens or how much RAM or CPU is ...
shalakhin's user avatar
  • 135
2 votes
2 answers
806 views

How to free up used memory

I have this picture for my account memory: quota: 220.4 KiB used: 207.5 KiB I want to free the memory and sellram. Is it possible, and if yes, how to do that?
Tigran Sahakyan's user avatar
0 votes
1 answer
184 views

Deferred transaction on EOS [duplicate]

Is it 100% sure that deferred transaction will run on what delay is defined? Is there any possibility that deferred transaction failed to run on defined day? If it fails what is the alternative? ...
guruprakash gupta's user avatar
0 votes
1 answer
393 views

Can we store date on eosio table?

Is there any direct datatype in eosio to store date? and if not then how can we store dates in eosio table? void mainloan::paymentConfirm(uint64_t pay_id,uint64_t pay_date,double pay_amunt,name from ...
guruprakash gupta's user avatar
0 votes
1 answer
524 views

How to upgrade a multi_index table in a smart contract

I have initially the following multi_index table: struct [[eosio::table]] plastict { uint64_t id; uint64_t type; uint64_t primary_key() const { return id; } }; typedef eosio::multi_index&...
vladich's user avatar
  • 11
0 votes
2 answers
667 views

How to loop a multi_index table in a smart contract

I have very simple table items with the following structure: struct [[eosio::table]] item { uint64_t id; uint64_t state; string description; uint64_t primary_key() ...
vladich's user avatar
  • 11
1 vote
1 answer
109 views

what is get(),find(),end(),raw() keywords in eos smart contract?

how and when to useall these keywords and what they actually means? and what is the difference in these 2 statement given below auto itr = loan_table.get(loan_id); auto itr1 = loan_table.find(...
guruprakash gupta's user avatar
0 votes
0 answers
97 views

When deploying a contract what is important (overall contract/wasm size or amount of functions etc) to not get transaction took too long

when I try to deploy the system.contract I sometimes get transaction took too long with the new eosio version 1.8.1. Now I would like to know on which part of a contract do I need to pay attention ...
sinbad's user avatar
  • 99
1 vote
1 answer
96 views

EOSIO's BP Benchmark

Today, I am researching how I can draw a diagram for BPs Benchmark, and luckily I found information about Ahola. But I cannot figure it out, how I can get value from Ahola's smart contract to draw a ...
blockehainer's user avatar
0 votes
1 answer
204 views

how to compile eosio.system contracts?

I cloned the eosio.contracts folder from github and made some changes in some of the contracts. Now I would like to compile them and test them, but when I try to compile them with eosio.cdt I get ...
sinbad's user avatar
  • 99
0 votes
2 answers
54 views

Zero amount transfer?

I just want to use EOSIO as a DB of some events by sending transactions when other events fire. Is it possible to send ZERO amount transfers? The events are millions a day, and I don't know how to ...
Tigran Sahakyan's user avatar
0 votes
0 answers
81 views

env.is_feature_activated unresolvable while setting up eosio.system contract

I am following BIOS Boot Sequence. I want to set up my own private EOS network that's why I am setting up the EOSIO network. at step 1.12 I am not able to set the eosio.system contract it will give me ...
parth Kaloliya pk's user avatar
0 votes
1 answer
60 views

I'd like to swap my eos token using eosio.token with EOS coin

I am a DAPP Developer in Korea. I have publish my own token using eosio.token recently. I love to study eos main network system. Now I am trying to learn how swap my token with EOS. So that I was ...
Alan Kim's user avatar
1 vote
1 answer
62 views

What are the patterns and anti-patterns when programming for EOS?

When programming smart contracts or writing eosjs code, there are certain pitfalls that you might fall into if you are not careful. What are some of the patterns and anti-patterns to be aware of that ...
Phillip Hamnett - EOS42's user avatar
1 vote
2 answers
308 views

Transferring EOS within Smart Contract

I'm building a Smart Contract that transfers EOS from my contract account to end user accounts. I can not seem to find up to date and correct syntax for transferring EOS using eosio.token from within ...
hughjammer's user avatar
1 vote
0 answers
21 views

How does smart contract development differ between each of the EOS.IO side/sister chains?

Most tutorials that exist for smart contract development are directed at the EOS Mainnet chain. But there are several sister and side chains available, and the number is growing all the time. How does ...
Phillip Hamnett - EOS42's user avatar
1 vote
2 answers
54 views

How to tell a certain contract in indeed used in a dApp?

The dapp review sites often list the contract names a dapp is using. I see that this is added by whoever has added that dApp into the review site. But is there a verifiable way (through an explorer ...
mixdev's user avatar
  • 121
1 vote
1 answer
291 views

How can I get the balance of my account with smart contracts in cdt 1.6

All previous answers before used some function called get_balance, but there is none listed like that in the api https://eosio.github.io/eosio.cdt/1.6.0/functions.html.
Nozdrum's user avatar
  • 113

1 2
3
4 5
13