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
1
vote
1answer
324 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!
0
votes
1answer
167 views

Invalid packed transaction

I am trying RPC API. Here is the code which I am using on cmd for testing a dummy transaction. curl --request POST --url http://localhost:8080/v1/chain/push_transaction --header 'accept: application/...
0
votes
0answers
34 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(...
1
vote
1answer
60 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....
0
votes
0answers
19 views

EOS deferred transaction Error while running

I'm doing this but i'm getting an error, what should i improve? void mainloan::checkdaily(uint64_t loan_id) { auto itr = loan_table.find(loan_id); auto borrower = itr->borr_name; eosio::...
0
votes
2answers
97 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
0answers
17 views

Missing permission of account, but permission is given to acting account

I have account1 and account2. account1 has a contract with an action called update(): void mycontract::update(){ require_auth(get_self()); table_t t(get_self(),scope); auto r = t.find(index); ...
0
votes
0answers
21 views

Eosio 1.8 is released and live, but are the features activated as of today 2019 Oct 7?

I read that the eosio 1.8 is live, but much of the new features are not activated. Where can we see what 1.8 features are activated or pending activation?
0
votes
0answers
24 views

Resources for EOS Smart Contract Source Code

What are some educational EOS Smart Contract Examples like Elemental Battles? The best way to learn coding smart contracts and using EOS blockchain is to get some really good example references of ...
1
vote
0answers
7 views

what is the native?

eos/chain/apply_context.cpp 66 line i had been found the something where account_name newly was created like eosio.token, eosio.rex.... So, i found some hint controller.cpp // 321 Line #define ...
0
votes
0answers
26 views

eosjs sign data does not match with eosio assert_recover_key data

at client, I create a signature from seed like this. the key pair is [ '5KgLbwEy7d4qufeLqPnPL1YQU1tscJXCnpqTTn7REaZsjYBjDWr', 'EOS5Mk748B6ojrZdTHP8BoLBXyKjQzzthaqGa4v97vfiGEfbEM2Np'] import ...
0
votes
1answer
139 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
93 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? ...
1
vote
0answers
26 views

How can EOSIO know the block number?

I have made my EOS world. If you follow the Nodeos biosboot manual (https://developers.eos.io/eosio-nodeos/docs/bios-boot-sequence), you would know eosio is to be BP. BP have to make a lot of blocks. ...
0
votes
0answers
8 views

what is maxium tps eos.io can gives in private setup / fork [duplicate]

I am Setting up EOS private Multi-Host Network, was wondering what is maximum TPS eos.io can give in private setup/fork.
1
vote
1answer
77 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 ...
0
votes
1answer
18 views

EOS Application Specific Chains

With the cost of RAM for provisioning users with accounts and storing data, the main chain feels expensive. As a solution I'd like to explore the setting up of application specific chains which start ...
0
votes
0answers
39 views

how can i convert fc::sha256 to hex?

I wanted to see a Transaction ID. And The type is fc::sha256. So I inserted some code : std::cout << "The transaction ID : " << trx->get_transaction().id() << std::endl; But ...
0
votes
0answers
54 views

How to solve the error - action's authorizing actor 'bob' does not exist

string data = "{\n" " \"compression\" : \"none\",\n" " \"transaction\" : {\n" " \"actions\" : [ {\n" " \"account\" : \"eosio\",\n" ...
0
votes
0answers
16 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
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 ...
0
votes
1answer
57 views

Create test account using EOSIO

I am new with EOSIO. I have created account using cleos command. cleos create account eosio bob YOUR_PUBLIC_KEY cleos create account eosio alice YOUR_PUBLIC_KEY It's successfully created. But, I ...
0
votes
0answers
22 views

How efficient is the EOSIO software for distributed locking, relative to other database software?

I am researching the best software for distributed locking purposes, and came across this article: https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html I think the Redlock ...
0
votes
0answers
76 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 ...
0
votes
1answer
100 views

Add multiple permissions to account in EOS

When I try to set a single permission, it is working fine: cleos --url https://jungle2.cryptolions.io set account permission market active '{"threshold": 1,"keys": [{"key": "MARKET PUBLIC KEY","...
1
vote
1answer
51 views

RPC Wallet integration API throwing an error

I am new with blockchain services. I have created wallet using command line. curl -X POST http://127.0.0.1:8888/v1/wallet/create -d '"WalletTest" It's created successfully. But, I'm trying to ...
0
votes
1answer
263 views

Why is [[eosio::on_notify(“eosio.token::transfer”)]] not working?

Network: kylin testnet. I transferred eos to this contract, but it the "deposit" function was not called. What do I miss?
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 ...
0
votes
0answers
24 views

Where is the code for validating incoming blocks in the EOS repo?

I am trying to get the exhaustive list of validation checks a node performs when it hears about a new block. I am wading through the code to get this list. I assume that other nodes validate the ...
0
votes
0answers
22 views

Before install EOSIO, Why install the Graphviz?

To my knowledge, Graphviz shows the code graph tool. But I haven't found the code graph in 'eos' directory. So I want to know the reason. And How can I use the graphviz in EOSIO?
1
vote
1answer
20 views

Should a contracts class be labelled `public contract` or `public eosio::contract`

In the Address Book example I notice the contract structure is #include <eosio/eosio.hpp> using namespace eosio; class [[eosio::contract("addressbook")]] addressbook : public eosio::contract {...
0
votes
2answers
227 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 ...
1
vote
1answer
125 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 ...
0
votes
0answers
15 views

EOS token payment gateway

I was trying to create an API which integrates with nodeos on my server, rpc calls can be made by the web api for the purpose of a payment gateway for eos . My question is how to integrate an API with ...
0
votes
1answer
73 views

What does FC_REFLECT do?

In most of the system contracts of EOSIO, I found FC_REFLECT function repeatedly used. What does this function actually do? I wonder if any of you can tell the answer for this. Thanks in advance.
2
votes
1answer
110 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
1answer
95 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 ...
2
votes
0answers
106 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 ...
5
votes
1answer
226 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/...
1
vote
2answers
147 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.
0
votes
1answer
38 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/...
0
votes
1answer
44 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 ...
0
votes
0answers
84 views

Regex validation on smart contracts

Is is possible to use regex validation in a smart contract?
1
vote
0answers
8 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?
0
votes
1answer
104 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}...
1
vote
2answers
173 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 ...
1
vote
1answer
21 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.
1
vote
1answer
144 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 ...
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 ...
1
vote
0answers
29 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 ( ...