Questions tagged [eosio.cdt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
101 views

what is receiver account for and what is ds, in new version of eosio contract's constructor declaration

In the new version of eosio we declare the constructor as : addressbook(name receiver, name code, datastream<const char *> ds) : contract(receiver, code, ds){} How does datastream ds work here ...
0
votes
1answer
27 views

What is the difference between std::string and eosio::string?

Why should I use eosio::string over std::string? What are the use cases where it would make a difference?
0
votes
2answers
129 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() ...
0
votes
2answers
373 views

How to do arithmetic with asset amount particulary decimals

How do I compute a percentage of an amount? I tried multiplying by 10000 and after dividing afterward but I get an error when sending that amount.
0
votes
0answers
10 views

Unable to connect local node with EOS Studio using custom network mode

I have set up EOSIO using windows subsystem for linux (ubuntu 16.04). Nodeos and Keosd are running. I am able to get a response in browser using the chain api http://localhost:8888/v1/chain/get_info ...
0
votes
1answer
19 views

Check public keys on contract level

Is it meanwhile possible to check the public key of an account name on contract level? (Not with Cleos) Example: The contract contains some public keys (not the account names). If a user performs a ...
1
vote
1answer
116 views

error: no type named 'transaction' in namespace 'eosio'

During the tutorial on https://developers.eos.io/eosio-home/docs at the last step (step 2.9, the section about deferred transactions) when trying to compile the code, I get this error: [*** ...
0
votes
2answers
448 views

error: unable to handle compilation, expected exactly one compiler job in ''

I am not able to compile, getting error: unable to handle compilation, expected exactly one compiler job in '' not able to compile a simple hello world smart contract
0
votes
1answer
146 views

Failed to get existing code hash, continue without duplicate check… on set contract

Update 12/17/18: I solved this by updating my CDT to latest. Still unsure what the issue was. OS: Windows with Linux/Ubuntu Sub Module Nodeos: v1.5 CDT: v1.3.2 So I'm trying to set a simple ...
0
votes
0answers
7 views

How to interpret the contract?

LLVM was designed the way(Picture). And I want to know if i understand correctly. Smart Contract is byte code. So EOSIO need to interpret the byte code. EOSIO use WAVM converting to Middle End IR ...
1
vote
1answer
141 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 ...
1
vote
1answer
78 views

How to include boost when building using eosio.cdt?

I'd like to use the multiprecision library, but i'm having problems including the header filer. CMakeLists: include(ExternalProject) cmake_minimum_required(VERSION 3.10) # if no cdt root is given ...
0
votes
0answers
16 views

A non-producing block, create account stuck

I am having a non-producing node for my chain. But when I run the command cleos create account eosio myaccount PUB_KEY PUB_KEY But it stuck somewhere. No output for a long time. I have put --print-...
2
votes
1answer
85 views

How do I pass an iterator?

suppose I have a table: struct [[eosio::table]] _stuff { symbol curr; // other stuff uint64_t primary_key() const { return curr.code().raw(); } }; typedef eosio::multi_index<name("...
2
votes
1answer
246 views

Samples with eosio.cdt v1.3.0? multi_index with secondary indexes and get_index

Has anyone been successful getting a contract which uses secondary indexes to compile against the latest versions of the CDT (1.3.2)? I'm having trouble and don't see any updated samples which use ...
0
votes
1answer
52 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 { ...
2
votes
1answer
65 views

fatal error: 'future' file not found

I want to write a contract by using CPR library. Unfortunately I have an error: fatal error: 'future' file not found #include <future> I am using EOSIO cdt v1.5.0 on Ubuntu 18.04. I had the ...
0
votes
0answers
12 views

Using eosio.cdt with Clang-Specific Compiler Options

As the cdt is build around Clang 7, is it possible to use the cdt with Clang-specific compiler options? There are some options to customize/optimize the compilation-process like -ffast-math which ...
0
votes
0answers
130 views

ABI file not generated

I have compiled a smart contract using eosio-cpp -o addbook.wasm addbook.cpp --abigen command. Compilation was successfull and wasm file got generated. But I cant find abi. eosio-cpp version is, ...
0
votes
1answer
112 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
0answers
67 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
192 views

How to create composite primary key?

I have a table of prices where I want to store 2 prices per cross defined like this: struct [[eosio::table]] _prices { symbol base; symbol quote; float value = 0.0; uint128_t ...
0
votes
2answers
155 views

Do SHA256 with CDT 1.6

I have a problem, when I was in the 1.3 version of eosio.CDT I successfully reproduce the same SHA256 in my contract and with multiple external method. It work like the dice contract. You generate in ...
1
vote
1answer
83 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/../...
0
votes
0answers
58 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
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 ...
0
votes
1answer
29 views

What is the usage of intrinsic read_action_data to set more than one action data?

Working on eosio native testing for unit testing and find an example that only for setting only one action data value: intrinsics::set_intrinsic<intrinsics::read_action_data>( [](void* ...
0
votes
0answers
74 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
78 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","...
2
votes
1answer
131 views

CPU-Usage Optimization

I'm trying to figure out how to optimize one of my smart contracts for less billed CPU-usage. There are typically different methods to optimize performance of algorithms but I'm not clear about if a ...
3
votes
1answer
82 views

Ricardian Contract

Does eosio also sign the transaction with the ricardian contract of user consent and/or how does the application proove that a party agreed on said ricardian contract? I have integrated the ricardian ...
0
votes
1answer
240 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?
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?
0
votes
0answers
33 views

How to return a record found?

suppose I have: struct [[eosio::table]] _test { asset supply; uint64_t primary_key() const { return supply.symbol.code().raw(); } }; typedef eosio::multi_index<name("test"), _test> ...
3
votes
1answer
157 views

eosio.cdt 1.3.2 indexed_by error: non-type template argument is not a constant expression

I'm trying to shift my contract and build it with the latest CDT, v1.3.2. The transition docs say to use the new ""_n name constructor but it doesn't appear to be working. I have: typedef ...
1
vote
2answers
136 views

Contract compilation fails during elemental battles tutorial

I have followed the elemental battles tutorial until lesson 2 step 4, and at the end of it, the tutorial instructs to compile the existing code with eosio-cpp -o destination.abi source.cpp -abigen (...
0
votes
1answer
99 views

How do you define uuid indexes in contract tables?

I would get table entries by uuid. how can I convert string format 16cadf15-dda7-4be2-8026-c3c7875322d0 to an indexable eosio type ( uint64_t, uint128_t, uint256_t, double or long double). Or even ...
1
vote
1answer
116 views

Issue while compiling smart contract - eosio.cdt

I have installed eosio.cdt in Ubuntu system by using commands from EOS Developers Portal wget https://github.com/EOSIO/eosio.cdt/releases/download/v1.4.1/eosio.cdt-1.4.1.x86_64.deb sudo apt install ./...
1
vote
1answer
100 views

Serialization Error Processing WASM while following hello.cpp tutorial

I am following along the tutorial on the EOS website at https://developers.eos.io/eosio-home/docs/your-first-contract At the first smart contract development section, I cannot manage to publish the ...
1
vote
1answer
320 views

on_notify not being fired on local or jungle testnet

I'm using the following contract on both my local and jungle testnets, the on_notify methods are not being fired. Everything appears to be in order, I'm hoping I've missed something obvious. I ...
1
vote
1answer
43 views

How to compile uint with single quotes?

When I compile my code I get this error: warning: missing terminating ' character const static uint32_t default_max_block_cpu_usage = 200'000; /// max block cpu usage in ...
4
votes
2answers
699 views

How to get current time in different versions of EOSIO

Depending on which version of EOSIO you use, there are different options available for finding the current time. What are they?
1
vote
1answer
193 views

Why does the -abigen option in eosio.cdt not work?

When trying to compile my contract, I use the -abigen flag in order to auto-generate the necessary ABI file. This did not work, and gave no errors or warnings. The code to compile the contract is as ...
0
votes
3answers
313 views

Custom dispatcher new CDT

I'm having compilation issues when creating a custom dispatcher. I'm getting issues when calling EOSIO_DISPATCH. Is it related to changes in new CDT? class [[eosio::contract("mycontract")]] ...
0
votes
2answers
133 views

Multi_index issues

I'm getting a lot of errors related to multi_index after updating to the newest eosio.cdt. Here is part of my code related to hash. struct st_hash { capi_checksum256 hash; uint64_t expiration; ...
1
vote
0answers
71 views

Command 'nodeos' not found

Till yesterday nodeos on my machine was working fine, today I installed eosjs after that eosio commands giving errors. Just like nodeos command giving following error: Command 'nodeos' not found, ...
0
votes
1answer
180 views

Indexing a table by asset symbol — how to find?

suppose I declare: struct [[eosio::table]] tst { asset component; uint64_t primary_key() const { return component.symbol.code().raw(); } }; where I mean to keep a list of assets. ...
1
vote
0answers
22 views

What is the function of the braces?

in the symbol.hpp of the CDT I see the following definition: constexpr symbol_code code() const { return symbol_code{value >> 8}; } but I need a little help to understand... the method ...
0
votes
3answers
261 views

unknown type name `account_name` in current version of eosio.token contract?

I'm attempting to follow this guide, which seems official: https://developers.eos.io/eosio-home/docs/token-contract which uses the v1.4.0 branch of the EOSIO contracts when I follow the steps, the ...
2
votes
1answer
135 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 ...