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
0 votes
1 answer
157 views

How to unlock my wallet using nodejs?

The code given below is my nodejs code forunlocking my wallet name "seek".I got this API from eos developers portal,but don't know how to pass input data(wallet name and password) into it.Please help ...
sachin murali's user avatar
2 votes
1 answer
396 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 ...
Jason Bert's user avatar
1 vote
2 answers
215 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.
sachin murali's user avatar
0 votes
1 answer
118 views

How to create an API for EOSIO smart contract action?

// @abi action [[eosio::action]] void create(name user,string doctor_name,string doctor_contact,string doctor_address,string patient_problem,string patient_description,string patient_solution){...
Milan Aghera's user avatar
0 votes
1 answer
70 views

Any python api for getting account name by inputting public key?

Is there any python api for getting account name by inputting public key? I have got this code from developers portal, but I don't know how to use it. import requests url = "http://host/:port/v1/...
sachin murali's user avatar
0 votes
1 answer
61 views

Is there a library for encryption/decryption in EOS? [duplicate]

I want to perform some encryption on a given message, so I am wondering if there is a library that I can use in EOS? And I have checked the post Cryptographic Operations in Smart Contracts?, but the ...
Sean's user avatar
  • 1
0 votes
0 answers
270 views

Regex validation on smart contracts

Is is possible to use regex validation in a smart contract?
user3040's user avatar
1 vote
0 answers
13 views

How to build a macos homebrew bottle like eos at local machine?

Can anyone tell me that how can I use Homebrew in MacOS to compile the forked eosio tar file from GitHub to brew bottle package at local machine? Can give me the sample formula?
Purson Chan's user avatar
1 vote
1 answer
27 views

Is it possible that contract can pay the cpu/net for its users in the future?

Is it possible that contract can pay the cpu/net for its users in the future? It will greatly reduce the gap between users and eos I think.
fightinglion's user avatar
1 vote
0 answers
53 views

cannot get latest state of table after modifying table in inline action

As shown with code below, I modify table in an inline action, and then want to get the latest data. But the data I get is not the latest. Why? void mycontract::myfunc() { action ( ...
yiqi chen's user avatar
2 votes
1 answer
97 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 ...
Taner Seytgaziyev's user avatar
3 votes
1 answer
114 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? ...
user2953's user avatar
0 votes
1 answer
178 views

Passing the action name having return type to EOSIO_DISPATCH in EOSIO smart contract

I have following EOSIO smart contract: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; class random : public contract { public: using contract::...
Varsh's user avatar
  • 307
5 votes
4 answers
2k 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
Muhzin's user avatar
  • 510
0 votes
0 answers
283 views

Getting "code":404,"message":"Not Found" error while creating a wallet address in node js

Here is my node.js code as described here var request = require("request"); var options = { method: 'POST', url: 'http://127.0.0.1:8888/v1/wallet/create', headers: { 'content-type': 'application/...
Deepak M's user avatar
  • 101
0 votes
1 answer
139 views

Does permission_level (_self) means that only contract can use this method?

If yes, then how do I make sure that anyone or any specified address can call a method? If not then what is the usage of permission_level (_self ...)? action{ permission_level{_self, "active"_n}...
kpopguy's user avatar
1 vote
2 answers
1k 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 ...
Mr.Y's user avatar
  • 957
1 vote
1 answer
342 views

Max inline action depth per transaction reached on simple EOS transfer action call?

I am seeing the error Error 3040000: Transaction exception Ensure that your transaction satisfy the contract's constraint! Error Details: max inline action depth per transaction reached after a ...
jwjop1's user avatar
  • 71
2 votes
1 answer
193 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 ...
aion-alpha's user avatar
1 vote
3 answers
302 views

Cannot read string data from table row. But when I put "" data, it works

//@abi action void testhand() { gamecurrents gamecurrenttable(_self, _self); auto existing = gamecurrenttable.find( _self ); if(existing == gamecurrenttable.end()) { ...
Lawyer Kenny's user avatar
0 votes
2 answers
385 views

I have got "cannot modify objects in table of another contract" when trying to modify a table in my transfer function

I saw some contract implement a handler which will be triggered when receiving EOS token via eosio.token::transfer. I tried to have the same transfer handler and change some row of my table. But I ...
feleio's user avatar
  • 121
1 vote
2 answers
241 views

How refund if I undelegate cpu with serveral times?

If delegate some cpu form accountnum11 to accountnum12, then I want to undelegate with the below command: cleos system undelegatebw accountnum11 accountnum12 '0.0000 EOS' '10.0000 EOS'. In normal ...
michael's user avatar
  • 113
1 vote
3 answers
75 views

What is different between 'build eosio from source' and 'using pre-build binary'

setting eos with pre-build binary is super fast with less errors. What is good thing with building from source?
n3wbie's user avatar
  • 71
1 vote
2 answers
165 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() { ...
Mr.Y's user avatar
  • 957
2 votes
1 answer
78 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 ...
Nirdesh Kumar Choudhary's user avatar
0 votes
2 answers
337 views

Unable to resolve contract folder on ubuntu 18.04

My test contract cpp file is in /home/boby/hackathon/contracts/test/ folder, when I run cleos set contract bob /home/boby/hackathon/contracts/test/ -p bob@active I get an error unable ...
ovicko's user avatar
  • 133
1 vote
0 answers
26 views

How to deploy my samrt contract on testnet in EOS [duplicate]

I have successfully pushed the transaction and deployed the smart contract on private net, I want to know How to deploy it on testnet. I have created the account on Jungle testnet.. Kindly tell me ...
Danish's user avatar
  • 75
3 votes
1 answer
273 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 ...
Philipp Ponomarev's user avatar
1 vote
2 answers
209 views

How can I create an EOS block producer?

I am entering into EOS development and seek advice from experts on how to produce EOS blocks and what are the rewards? Also, will a regular development device be sufficient to build such a producer?
Rohan Dhar's user avatar
2 votes
1 answer
318 views

Runtime Error Processing WASM in ``` std::stof```?

[[eosio::action]] void hi(){ string strNum; strNum.push_back('3'); float currNum = std::stof(strNum);// print("currNum=",currNum); } ...
Lou Treaser's user avatar
1 vote
1 answer
240 views

How can i solve the error: iostreams currently clash with eosio::datastream?

I am trying to compile some code which compiled successfully with the old compiler eosiocpp, but with the new eosio-cpp gives me: eosio.cdt/1.4.0/bin/../include/libcxx/iostream:13:2: error: "iostreams ...
Riccardo Persiani's user avatar
2 votes
3 answers
307 views

Can I use uint256_t in EOS smart contracts?

I want to use uint256_t in my EOS smart contract but I am getting following error unknown type name 'uint256_t'; did you mean 'uint16_t'? I thought EOS supports uint256_t as I read it in some EOS ...
Vivek Kumar's user avatar
1 vote
1 answer
109 views

How do I get my transaction Id to sign the transaction?

While signing the transaction there are 3 parameters that we need to pass, 1) txn 2) keys 3) id How Can I get my id and also what should be the structure of the transaction parameter, Kindly help
Danish's user avatar
  • 75
1 vote
0 answers
40 views

Is there a json schema file for eos that defines accounts, keys, transactions, blocks, etc

Is there a json schema file or data-model for eos that defines accounts, keys, transactions, blocks, etc...
grahappa's user avatar
1 vote
0 answers
83 views

Transaction exception while pushing transaction

While calling the push transaction API with the following body { "signatures": ["SIG_K1_K5umBpyieHE6czvtDMEAVjypG5Zz5sYo4NKbUkqJfe562mX22aLGwwZsYSQJLhBZi5s3hvjg6zVfS3ZucM97Ji5KNXSm4a"], ...
Danish's user avatar
  • 75
1 vote
1 answer
146 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 = ...
Gassa's user avatar
  • 598
2 votes
1 answer
144 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 ...
Danish's user avatar
  • 75
2 votes
1 answer
154 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 ? ...
Mr.Y's user avatar
  • 957
1 vote
1 answer
179 views

If I issue an EOS token, how do I afford the running fee?

I got a question about how to afford the cost of emplace action... code in eosio.token like : statstable.emplace( _self, [&]( auto& s ) { s.supply.symbol = maximum_supply.symbol; ...
liu Rick's user avatar
  • 101
3 votes
1 answer
382 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 ...
Swapna's user avatar
  • 85
5 votes
1 answer
234 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 ...
Swapna's user avatar
  • 85
3 votes
1 answer
494 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 ...
Riccardo Persiani's user avatar
1 vote
0 answers
37 views

Why EOSIO going to discard eosiocpp tool?

EOSIO introduced new eosio.cdt tool for contract development and there is many changes related to typedefs in this tool. Is eosio.cdt official by eos ? asking this because they have not mentioned ...
Mr.Y's user avatar
  • 957
3 votes
4 answers
283 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 ...
Trevor Lee Oakley's user avatar
3 votes
1 answer
609 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?
Vivek Kumar's user avatar
1 vote
1 answer
96 views

Can EOS assure privacy?

In ethereum (public network), the data is all open access. Functions can be controlled via function modifiers. But anyone can view data stored in the contract. Is this the same in EOS? Once data is ...
Trevor Lee Oakley's user avatar
3 votes
1 answer
319 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
rohan agarwal's user avatar
0 votes
1 answer
193 views

Contract Table Query Exception

As i was following eosio developers documentation #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; using namespace std; class addressbook : public ...
Swapna's user avatar
  • 85
1 vote
1 answer
168 views

Failing EOSIO manual build, Could NOT find WASM (missing: WASM_CLANG WASM_LLC WASM_LLVM_LINK)

I tried to follow instruction from https://developers.eos.io/eosio-nodeos/docs/manually-build for manual build but kept failing the cmake step. cmake -DBINARYEN_BIN=~/binaryen/bin -DWASM_ROOT=~/wasm-...
user4826904's user avatar
1 vote
2 answers
30 views

Who are the founders of EOS and are any of them anonymous like satoshi?

Was EOS created by 1 person or a team of people and are they all public?
Patoshi パトシ's user avatar