Questions tagged [eosio-code]

Questions relating to the official eosio code--for instance, this may include questions about particular functions or data structures, certain files or contracts, compilation or building problems, related libraries, scripts, binaries, or similar.

Filter by
Sorted by
Tagged with
9
votes
1answer
485 views

Compile Rust to WebAssembly for EOS Smart Contract?

So I'm familiar with the fact that the supported language for EOS smart contracts is C++. However, the EOS docs mention that even the C++ needs to compile down to WebAssembly. So my question is, ...
7
votes
1answer
496 views

Can we add the permission to access the table?

I know how to declare ,initialize and get,set values in a table .My question is Can we add permission to access the table to a particular user inside our smart contract ?
6
votes
1answer
1k views

How I can typecast the “0.0001 EOS” into eosio::asset

I declared a variable value = "0.0001 EOS"; , inside my action I want to transfer those asset to a account .I am having difficulty to typacasting this string into the eosio::asset value . my code goes ...
5
votes
3answers
116 views

What would happen when a block producer fails to produce its blocks when it's his turn?

How would the next scheduled BP handle this mess?
5
votes
1answer
164 views

eosio multisig exec problem

For multisig transaction, 1. Firstly I have created two accounts(partner1 and partner2) with same key(EOS....HoCF) cleos create account eosio partner1 EOS8FE********HoCF cleos create account ...
5
votes
1answer
228 views

eosio.contract cannot compile with error code 1 of eosio.wasmsdk by Clion

We are compile the eosio.contract v1.2.0 using Clion by following that: Dependencies: eosio v1.1.2 eosio.wasmsdk v1.1.0 Cannot get compiler information: Compiler exited with error code 1: /usr/...
4
votes
2answers
2k views

Require inline action be sent by contract, and not account

I have contractB trigger an inline action: /// @abi action void send() { action( permission_level{ _self, N(active) }, N(contractA), N(get), std::make_tuple( _self ) ...
4
votes
3answers
818 views

How to set up a private blockchain using EOS?

I have read that it is possible to set up a private blockchain using EOS. Can anyone help me to understand how to set up a private chain using EOS. Thanks in advance
4
votes
3answers
574 views

Can not find <eosiolib/eosio.hpp> when compiling with eosiocpp #2

I'm trying to compile any smart contract. Let's say the skeleton one. When running eosiocpp -o it can't find the header file for eosio. Not a duplicate of Can not find <eosiolib/eosio.hpp> when ...
4
votes
2answers
164 views

How to calculate `action_mroot`

UPDATE #3 for future action_mroot calculators: The two critical bits of info needed to do this (that are neither easy to find nor documented) are: There exists an extra action (which has a receipt) ...
4
votes
1answer
148 views

Retrieving from Log Storage vs. RAM

I'm quite new to EOS. As far as I know, some of the output from smart contracts are also stored in the Log Storage. At the same time, I can also choose to store those outputs in RAM. My questions ...
4
votes
1answer
361 views

How does EOS prevent one contract from accessing another contract's tables without authorization?

I noticed that multi-index (which is under eosio namespace) uses the following to prevent access to another contract's tables: eosio_assert( _code == current_receiver(), "cannot create objects in ...
3
votes
2answers
172 views

Meaning of N() function in multi_index

What is the role of N() in defining tables using multi_index. The primary key function does not return string. Why so? e.g. string primary_key() const {return Some_String_Object}. This throws an error....
3
votes
1answer
275 views

Error 3160009: No wast file found

The hello world contract is not getting compiled in the EOS v1.3 and eosio.cdt. The wasm and abi file is getting created but goes undetected. https://github.com/EOSIO/eos/issues/5349
3
votes
1answer
85 views

What “[[eosio::contract(”somecontract“)]]” means in eos code?

For example, in the contract "eosio.token.hpp", in the line 20: class [[eosio::contract("eosio.token")]] token : public contract { Is that a special grammar defined in eos.io? What does it mean? ...
3
votes
4answers
197 views

Is LevelDB used in EOS?

I know Ethereum uses leveldb. When I checked into EOS I could not find that much out. I thought when I tested I did see leveldb. Can someone confirm how the immutable data is stored? EDIT I think ...
3
votes
1answer
239 views

Sending transaction from a Windows application

I want to send a transaction to EOS blockchain from my windows application. What library do I have to put into the windows application? And what are the preparations? Thanks
3
votes
1answer
301 views

How can multisig trigger an action in contract other than eosio.token contract?

Other than eosio.token contract how can we call the inline actions in contract from multisig contract. For example, I have a contracts namely mltisigmetup(with action meetup). Now I need a ...
3
votes
1answer
274 views

Why smart contract function fails with “Error 3090004: Missing required authority”?

WHAT I WANT From the contract mycontract I want to call a function function1. The function function1 calls another function of mycontract called function2. The function function2 calls an action of ...
3
votes
1answer
405 views

Whats the use of EOSLIB_SERIALIZE?

I understand that it is used for serialization and deserialization of a struct but why does anybody want to serialize/deserialize the struct? What's the use case?
3
votes
1answer
203 views

What is the reason for appearance of “misaligned reference”?

I have written a big contract with a lot of template functions and can find a place, which causes 2018-11-19T08:14:11.454 thread-0 binaryen.hpp:608 translate_one ] misaligned ...
3
votes
2answers
73 views

Commented owner/active parameters in the newaccount smart contract

In contracts/eosio.system/eosio.system.cpp, the following function has the owner and active authority parameters commented: void native::newaccount( account_name creator, ...
2
votes
1answer
67 views

Not able to find account on jungle test net 2.0

Jungle test has been update to jungle 2.0, I have some accounts on previous version . My question is Do I have to create all accounts again because API endpoints are changed a bit? Anybody have any ...
2
votes
2answers
45 views

Most appropriate version of EOS to start

Currently I am running EOS version 1.1.1 for my smart contract, But within a short time so many versions had been released. Before that I was working with 1.0.1 because of some issues I switched to ...
2
votes
2answers
53 views

How do I find and edit Hello.cpp?

I'm on a Mac, and working through the Hello World contract. I managed to create the Hello.cpp file using the touch command in Terminal... but how do I find this file, and/or how do I edit it?
2
votes
2answers
52 views

Problems with [[eosio::on_notify…]

Thanks in advance for any help. I can't seem to get on_notify to work (attempting to trigger for any tokens sent to the contract, but for the example I've tested both * and eosio.token) The method: ...
2
votes
1answer
101 views

What is the practical process by which BPs change the RAM available on the mainnet?

What is the process that BPs follow to update the RAM size at regular intervals? From what I can tell, the update is made in the eosio_global_state singleton to update the max_ram_size parameter in ...
2
votes
2answers
419 views

I can not find a definition for require_auth2, what does this do and how?

require_auth2 is used in action.hpp's require_auth. void require_auth(const permission_level& level) { require_auth2( level.actor, level.permission ); } require_auth2 is declared in action.h....
2
votes
1answer
115 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 ...
2
votes
1answer
78 views

How to have real-time communication in dapp?

How would a real-time 1v1 game work on the EOS Blockchain? I've noticed that many of the games/gambling dapps on EOS are mostly player vs. blockchain, like EOSBet. Could I have real-time updates to ...
2
votes
1answer
138 views

Fixing a smart contract written in old version of eosio.cdt

I am using Ubuntu 18.04 LTS first of all. So I am trying to look up how to start building an EOS dApp, starting with this example on Github. Here is the link: https://github.com/eosasia/eos-todo I ...
2
votes
1answer
100 views

No able to sign the transaction

I have followed the documentation and followed the mentioned steps, However I am not able to sign the transaction, I guess that's because I don't know on which port Keosd is running, also kindly send ...
2
votes
1answer
121 views

About Updation of contract

I have 2 questions about updation of contract and multi-indexed tables? 1)Can i update contract as if i want to change ram payer for multi indexed tables can i change it after deploying contract ? ...
2
votes
1answer
53 views

Need advise on creation of account

I am working on ICO based on eosio so what actually i need to do is i want to make a system in which all users come to signup and system generate a key pair for them and give them key and registered ...
2
votes
1answer
58 views

What is the command in docker to pull eosiocpp?

What is the command in docker to pull eosiocpp? Or where can I find it online?
2
votes
1answer
51 views

Split Smart Contracts or not?

Is it computationally more heavy to put all functions into one smart contract, even though you only call one function at a time? Or is it better to split all functions into individual smart contracts?
2
votes
0answers
107 views

EOS mainnet replay speed too slow after about 20M blocks

while replay the node sync speed was fast in start but after about syncing 20M blocks the speed is very very slow. mongoDb and history plugins are enabled. nodeos is not utilizing above 1500 iops ...
2
votes
1answer
121 views

Why does using available_primary_key() as scope for a table result in this behaviour?

Scenario: Two tables, each using uint64_t as a primary key Table A rows need to reference rows in Table B Why? Relational database data duplication reasoning etc etc Both table's primary keys are ...
2
votes
1answer
275 views

What is the use of eosio-code?

Some major questions I have: What does eosio-code mean? When do we require eosio-code? Why it is not mentioned in the official EOSIO developer's documentation?
2
votes
1answer
198 views

Issue while compiling contract using eosiocpp

I am facing an issue while compiling the token contract. cd eos/contract/eosio.token eosiocpp -o eosio.token.wast eosio.token.cpp But it shows the following response, eosiocpp: command ...
1
vote
2answers
148 views

Is there any IDE for eos smart contract?

Is there any IDE for compiling eos smart contract? for example ethereum have remix to compile and run solidity based smart contract.
1
vote
2answers
519 views

What is eosio.code permission?

I have seen that some contract need eosio.code permission to deploy contract. So, i have few questions regarding eosio.code that are as below What is eosio.code permission? Do we need to add ...
1
vote
2answers
154 views

Error for below code of scatter!

I am trying to call contract by scatter but i met with below error Error is Cannot read property 'find' of undefined Any other way to call contract and suggestions appretiated! function gets() { ...
1
vote
1answer
105 views

In the eosio.token contract, why are the structs private?

In my contract, I'd like to be able to check how much EOS an account has. For that, I'd write some C++ code like this: token::accounts the_table("eosio.token"_n, "useraccount1"_n.value); auto it = ...
1
vote
1answer
334 views

Code examples for ONLY_BILL_FIRST_AUTHORIZER

Can someone please add code example or describe how to only bill first authorizer? I have tried but can't get it to work. Thanks!
1
vote
1answer
85 views

How to add a key in an EOS contract table

Below I have created a table, the full_name, birth_year, nationality and ipfs_hash are all not unique values. Do I need one of them to be unique? Much like a database can I ask for a field to "auto ...
1
vote
2answers
2k views

How do I fix the error “include errors detected. Please update your includePath”

Im following along with the getting started guide and I got up to the first contract section in 2.1, I made the hello directory and cd into it, I touched hello.cpp and then opened it in VS Code, once ...
1
vote
1answer
132 views

EOS Block Producer Claim Reward

I have followed Bios boot sequence tutorial from eosio and setup a private eos blockchain. The problem is the block producers i have created , when i tried to claim reward it shows "cannot claim ...
1
vote
1answer
50 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 ...
1
vote
1answer
75 views

Is an account and a smart contract the same?

Essentially both have hash as an address and allows for execution of actions but are the actually the same thing?