Questions tagged [eosio.cdt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
107 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
388 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
135 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
137 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
73 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 ...
1
vote
1answer
95 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
0answers
15 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-...
0
votes
2answers
106 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
337 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.
2
votes
1answer
79 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
240 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
43 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
63 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
11 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
112 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
86 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
63 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
164 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
134 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
70 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
57 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
24 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
56 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
121 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
81 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
225 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
20 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
31 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
155 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
126 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
92 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
109 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
96 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
312 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
42 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
659 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
176 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
296 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
129 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; ...
0
votes
0answers
95 views

/eosio.cdt/bin/wasm-ld: error: ios.obj: undefined symbol: std::uncaught_exception() while using eosio-cpp

WHAT I AM USING CDT: eosio.cdt-1.4.1 WHAT I AM DOING I am getting this error while trying to compile a contract: /usr/local/eosio.cdt/bin/wasm-ld: error: ios.obj: undefined symbol: std::...
1
vote
0answers
65 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
168 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
251 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
133 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 ...
3
votes
2answers
211 views

eosio-cpp -abigen hello.cpp -o hello.wasm

Ubuntu 18.04.1 on VMware (Windows 10 64bit) EOSIO v1.4.1 eosio.cdt-1.3.2 i just run the compiler like this : win@ubuntu:~/eos$ eosio-cpp -abigen hello.cpp -o hello.wasm then, the ...
0
votes
1answer
188 views

How can I tell what version I am running with cleos version client?

cleos version client returns a foreign language to me. Build version: 59626f1e Is there a way I can ascertain what version I'm on from that? Is there another way of doing it besides that?