Questions tagged [eosio.cdt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
1k 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?
3
votes
3answers
189 views

Set source file properties called with incorrect number of arguments

When attempting to compile a new contract, I am getting this error. I'm using eosio version 2.1 for this. CMake Error at /home/michael/eosio.cdt/build/lib/cmake/eosio.cdt/EosioCDTMacros.cmake:18 (...
3
votes
1answer
94 views

Returning values from actions

I am trying to return a value from an action as follows: [[eosio::action("test2")]] int test2(int x) { return x; } The code compiles correctly, and the ABI file shows the correct action ...
3
votes
1answer
181 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 ...
3
votes
1answer
43 views

How to pass specific eosio-cpp/eosio-ld options via cmake

I'm typically using CMake to compile my contracts, like described here. How can I pass specific eosio-cpp/eosio-ld options (specifically -stack-size) described here?
3
votes
1answer
100 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 ...
3
votes
2answers
257 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 terminal stopped ...
3
votes
1answer
491 views

how to convert a hex string to checksum256

I'm having a hard time figuring out how to convert a hex string into a checksum256/capi_checksum256 (or vice versa), any help?
2
votes
1answer
196 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
2answers
755 views

How to solve fatal error: 'eosiolib/types.hpp' file not found #include <eosiolib/types.hpp>?

After installing eosio.cdt 1.4.1, I am receiving this error from the compilation of my code where is included the header file eosiolib/types.hpp: fatal error: 'eosiolib/types.hpp' file not found #...
2
votes
1answer
199 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 ...
2
votes
1answer
157 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 ./...
2
votes
1answer
93 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 ...
2
votes
1answer
126 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 ...
2
votes
1answer
172 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
269 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 ...
1
vote
1answer
500 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 ...
1
vote
2answers
530 views

Multi_index query with new CDT

Because name is no longer a uint64_t type I created my struct like this: struct [[eosio::table]] game { uint64_t id; //auto increment name host; name guest= name("none"); name ...
1
vote
1answer
118 views

EOSIO_ABI macro problem on MacOS, can't use for contract implementations

I have been fighting a bit with the EOSIO_ABI macro in C++. I am trying to implement a very simple Ping/Pong contract using the latest eosio.cdt tools installed on my machine. When I try to compile ...
1
vote
1answer
143 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/../...
1
vote
1answer
281 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 ...
1
vote
1answer
496 views

How to uninstall CDT and reinstall?

On Ubuntu 16 / Windows with Linux Module. For reinstalling EOSIO, I'm just removing my eosio_1.5.0-1-ubuntu-16.04_amd64.deb Then: wget https://github.com/eosio/eos/releases/download/v1.5.0/eosio_1....
1
vote
2answers
296 views

keosd not found

After installing eosio.cdt, eos/build/programs/ directory is not found. I cant find programs directory inside build folder. My intention is to run keosd manually. Why programs directory is not formed ...
1
vote
2answers
633 views

No matching constructor for initialization AddressBook example

Dependencies: EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1 My code: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; CONTRACT ...
1
vote
1answer
21 views

cdt1.8.1 compile issue

error encountered when compile the contracts with cdt 1.8.1, any idea? /usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/bin/../include/boost/pfr/detail/core17_generated.hpp:38:9: error: type 'swaps_row'...
1
vote
1answer
145 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
58 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* ...
1
vote
2answers
161 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 (...
1
vote
1answer
218 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: [*** ...
1
vote
1answer
137 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
369 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
51 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 ...
1
vote
1answer
210 views

multi_index in eos with AddressBook example

I building AddressBook by link https://developers.eos.io/eosio-home/docs/data-persistence, Dependencies: EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1 Here is my code: #include &...
1
vote
1answer
15 views

confusion with contract names and account names in eosio testnet

When writing contracts, the contract class in file name_a.cpp is defined as follows: class[[eosio::contract("name_a")]] name_b : public contract {..} In my understanding the name of the ...
1
vote
1answer
30 views

Can I make a http request from smart contract code?

I know that eosio has http plugins, which is why I'm thinking that maybe a http library is embedded to the eosio.hpp and that I can use it internally to send http requests. Is this possible? My goal ...
1
vote
0answers
101 views

eosio: assertion failure with message: datastream attempted to read past the end

Im getting this error "eosio: assertion failure with message: datastream attempted to read past the end" when i try to call transfer function from another mine smart contract. void simplenft:...
1
vote
0answers
22 views

Build existing autoconf C project to include in smart contract

I'd like to include GNU's GMP library in my smart contract project. It's an autotools/autoconf project, how can I compile it as a standalone webassembly library and then include it in my smart ...
1
vote
0answers
110 views

Assertion failure with message: failed to allocate pages

Any help on this server error? I'm trying to fill in some gaps on a eosio python library, sending an assert sale action. {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3050003, ...
1
vote
0answers
14 views

getting error when i try to add permission to a user who is signing a smart contract action

here is what i am trying to do : users will sign a specific action which will take their username, permission_name, smart_contract_name, action_name, public_key i am trying to assign the user ...
1
vote
1answer
65 views

Compile Error: fatal error: 'eosiolib/eosio.hpp' file not found

eosio.cdt version 1.6.2 OS: Debian GNU/Linux 10 Code Contract #include <eosio/eosio.hpp> using eosio::contract; using eosio::print; using eosio::name; CONTRACT hello : public contract { ...
1
vote
0answers
96 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, ...
1
vote
0answers
26 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 ...
1
vote
2answers
677 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.
1
vote
0answers
110 views

Can't build or install eosio.cdt

I can't seem to install or build from source following the tutorials on eos.io. Trying to install from package results in a huge list of errors that look like: E: Release 'eosio.cdt-1.3.2.x86_64.deb' ...
1
vote
1answer
193 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
0answers
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 ...
0
votes
1answer
142 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 { ...
0
votes
1answer
358 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
2answers
562 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
2answers
186 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; ...