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
3answers
16 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":[{...
0
votes
0answers
17 views

How to get/change resource limits for account?

On Jungle testnet I have bidded account name and the auction is closed now, so the name is "mine". I try to create an account with that name and receive an error: account xxxxx has insufficient ram; ...
0
votes
1answer
13 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 ...
1
vote
0answers
23 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 ...
0
votes
0answers
39 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
27 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 = ...
0
votes
0answers
12 views

How to get active key within smart-contract

I need to get account public key within smart contract. I tried to find public keys in system contracts, but unsuccessfully. Anybody knows how to do it?
0
votes
1answer
19 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;...
0
votes
0answers
14 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, ...
0
votes
1answer
7 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 ...
0
votes
1answer
14 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?
0
votes
1answer
27 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? ...
0
votes
1answer
42 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 ...
0
votes
1answer
30 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&...
0
votes
2answers
29 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() ...
1
vote
1answer
19 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(...
0
votes
0answers
79 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 ...
1
vote
1answer
31 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 ...
0
votes
1answer
54 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 ...
0
votes
2answers
25 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 ...
0
votes
0answers
34 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 ...
0
votes
1answer
28 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 ...
1
vote
1answer
28 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 ...
1
vote
2answers
43 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 ...
1
vote
0answers
16 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 ...
1
vote
1answer
17 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 ...
1
vote
1answer
50 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.
1
vote
1answer
40 views

Is it possible to deploy contract via curl?

Using command line i am deploying smart contract "eosio.token". cleos -u http://127.0.0.1:8888 set contract eosio.token ./eosio.token -p eosio.token Is it possible to deploy smart contract using ...
0
votes
1answer
28 views

check (within smart contract) if an account is a proxy

How can I verify within a smart contract that an account is a proxy? I know that there is a function is_account, which verifies that a name is an existing account. Is there a way to check if an ...
2
votes
1answer
42 views

How can i burn the tokens i create with eosio.token

I want to burn the tokens i created for some reasons, I found the method "retire" in eosio.token. But, this method only change the supply of the token, the maximum supply is still the same as it is ...
1
vote
1answer
21 views

How to pass a map into an action

I'm trying to pass a map into action, but there is serialization error: Error: expected object containing data: undefined There is a function signature: void init(uint64_t id, const map<uint8_t, ...
3
votes
2answers
234 views

`env.is_feature_activated` error when set contract

I'm trying to set up my eos enviroment. When I post the system contracts I get this error msg: Error 3070000: WASM Exception Error Details: env.is_feature_activated unresolveable enviroment: ubuntu ...
1
vote
1answer
13 views

Is it possible to set up a smart contract with multiple .cpp and .hpp files?

If we want to make our smart contract code modular, and keep each class, contract, and table in its own file, is it possible to do this, and if so, how?
0
votes
0answers
13 views

Private MultiNode Testnet: Undefined Reference to secp256k1_rangeproof_info Error

I run into issues while building eosio.contracts repo. The link stage of eosio.contracts fails with errors similar to ”undefined reference to secp256k1_rangeproof_info". I have eos v1.8.1, eosio.cdt ...
1
vote
1answer
21 views

Can smart contract trigger some action on specified timestamp and change certain account balances?

Imagine I have a poll with specified timestamp for the end. At that point in time votes should be tallied and voters token balances should be adjusted in both directions (increase and decrease). How ...
0
votes
0answers
46 views

Search in a multi_index table by multiple fields (compound search)

Here is defined a sample table with four fields, two of them (account and type) I am going to use in my compound search: struct [[eosio::table]] total { uint64_t id; uint64_t account; ...
1
vote
1answer
57 views

what does the same_payer mean in eosio contract?

user_stakes.modify(sk,same_payer,[&](auto &s){ The variable same_payer confused me sometime, so, what does the same_payer mean in eosio contract ?
0
votes
0answers
73 views

Make a transfer from contract code on behalf of user [duplicate]

Installed: eosio: 1.7.3; eosio.cdt: 1.6.1 Implemented and locally deployed: sample market contract and eosio.token contract. In order to make an inline transfer from market contract in behalf of a ...
1
vote
0answers
15 views

Hide information in the blockchain

Lets say I want to create a player vs player game with a battlefield and moving armies, the movement and data about the armies and where is it going is put on the blockchain. My question is how to ...
0
votes
1answer
45 views

assertion failure with message: no balance object found

This error message occurs when trying to do a transfer: assertion failure with message: no balance object found What causes it and how can it be avoided?
0
votes
1answer
22 views

Unable to publish to Kylin

I have been developing against a local node, for which I created a key-pair. Now that it's time to publish to the testnet, I've imported said private key into Scatter and linked it to the account to ...
0
votes
0answers
17 views

How to use eosjs with scatter to deploy contract?

I am working on a use case that requires the smart contract to be deployed from frontend, and I am using Scatter as the wallet for the keys. Is there a way to deploy contracts on EOS Network using Eos....
1
vote
1answer
39 views

no member named 'check' in namespace 'eosio'

I am trying to build a contract and receiving this error: In file included from /usr/opt/eosio.cdt/1.6.1/bin/../include/eosiolib/contracts/eosio/system.hpp:6:[0K /usr/opt/eosio.cdt/1.6.1/bin/../...
1
vote
2answers
39 views

How to get a contract to accept tokens as payment

I keep getting the following error: transaction declares authority '{"actor":"test2","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [...
0
votes
1answer
20 views

Is there a way to issue tokens infinitely?

I want to design a system where token supply can grow infinitely. Is it possible not to fix total supply at the token creation moment?
1
vote
1answer
79 views

Transfer tokens inside a smart contract from an account to another account

I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two But I have to use not eosio.token contract but ...
1
vote
1answer
33 views

What exactly the merkle function is returning?

In the below file, https://github.com/EOSIO/eos/blob/v1.7.4/libraries/chain/merkle.cpp, what do ids.front() mean?; what exactly this function Merkle is returning? Could you please explain what this ...
2
votes
1answer
53 views

What is the meaning of “scope” in a Smart Contract?

Since I have read the tutorial. I don't understanding the following: Note that scopes are used to logically separate tables within a multi-index (see the eosio.token contract multi-index for an ...
0
votes
3answers
56 views

Can not find `eosio/eosio.hpp` while compiling with eosio-cpp

I used the documentation provided by EOSI. I made all the required installation as suggested in the docs. While writing the hello world contract, I face this issue when running the following command ...