Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [smart-contract]

Anything related to decentralized application (dApp) development, concepts and possibilities with smart contracts, or technical questions for the development of smart contracts

0
votes
0answers
5 views

no matching function for call to unpack_action_data

#include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> #include <../eosio.token.hpp> using namespace eosio; These are the codes that i added for dependency at start but the ...
0
votes
1answer
16 views

Access public variables of a TABLE in an EOS Smart Contract

I'm trying to access data inside a smart contract. The contract is visible here for example. The documentation for the smart contract is accessible here An example of an instance of the contract (...
0
votes
1answer
17 views

What is the ledger in EOS?

When I create a smart contract, e.g: game. what does the ledger store? (EOS tokens, or heathy points, level of user). If the ledger stores heathy points, level, so how I can push it into block (...
0
votes
2answers
27 views

EOSIO Tutorial : publishing contract error

I'm working on EOSIO tutorial and now I'm workingon https://developers.eos.io/eosio-home/docs/data-persistence part. Right now, I'm stuck on deploying contract. jongbok@DESKTOP-96ICBPJ:~/eos/...
0
votes
1answer
20 views

How to get balance using smartcontract in the new CDT

Is there a way to access the balance(of EOS or any token for that matter) of a given account using smart contract in the new CDT? Thank you
0
votes
1answer
15 views

How to include external library to smart contract?

I am trying to add libcryptopp library to my contract but when I try to compile with eosio-cpp I get an error that header files cannot be found. This is my code: #include <eosiolib/eosio.hpp> #...
0
votes
1answer
35 views

get data from a smart contract

I am a bit out of my depth here but I'm trying hard to keep up. I'm trying to call a method from a smart contract on EOS. That's the Bancor Smart Contract I'm interested in in particular. Just for ...
2
votes
0answers
13 views

how to solve Error Details: Cannot charge RAM to other accounts during notify on testnet

I need help for an issue developing an EOS dapp. I want to call a contract function when someone transfer EOS to my contract. For this i used the apply method to call the function upon any transfer ...
0
votes
1answer
18 views

Using Proxy token contract from a smart contract

I am reading through the documentation of EOS Proxy contract but I am having hard time understanding the following You can do this from a smart contract without using this intermediate proxy. ...
2
votes
1answer
30 views

What is a context free action?

I have been doing some digging into the system smart contracts and eosio core code, and I found context free actions. Can somebody please explain what the difference between a context free action and ...
1
vote
0answers
25 views

Payment to dapp with text comments best practice

I am new in eos, so maybe i say something strange. I want to create a dapp that can receive payments from mobile wallets with text comments. I imagine this like front end where user type text and ...
0
votes
0answers
19 views

Serialization Error Processing WASM

So I have nodeos up and running perfectly. I created a directory for a test project where I'm trying to use the eosio.token files in eosio.cdt to create a new token. When I run... cleos set ...
1
vote
1answer
34 views

How to get number of users, transactions and volume for a given EOS contract on given day?

I am trying to figure out how to get the number of users, transactions, and volume for any given EOS contract for any given date. Does anyone know how to do this?
0
votes
2answers
32 views

How to get list of active smart-contracts on EOS

It appears cleos has no way of returning a list of active smart-contracts. Is there another way?
2
votes
1answer
25 views

Constructor error message

I am writing a smart contract for use within the EOSIO system contract. I am receiving this error message multiple times: constructor for 'eosio::multi_index<13510798882111488, BP>::item' must ...
2
votes
1answer
24 views

static_assert failed "Types with user specified constructors (non-aggregate initializable types) are not supported

I am writing a smart contract for use with the EOSIO system contract, and am receiving this error message multiple times when I try to compile the code. I have checked my constructors and they are ...
1
vote
1answer
21 views

Makefile Compiler Error

I have been using this tutorial from Medium to build my first smart contract. I've come far, finally got a nodeos local node up and running and producing blocks on my Ubuntu VM. I've hit a snag though ...
2
votes
1answer
52 views

How to send a data from on contract to other?

https://developers.eos.io/eosio-home/docs/sending-an-inline-transaction-to-external-contract In above tutorial, I can see that 'addressbook' send notofication message to 'abcounter', but the data(...
1
vote
1answer
24 views

How do tokens that pay dividends work?

If a token is created as a standard eosio.token, what are some approaches for paying out dividends to token holders?
1
vote
0answers
26 views

What is the reason “misaligned reference” appearence?

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 ...
2
votes
1answer
20 views

BUG when two accounts send action at the same time to modify multiindex table

It took me several days to find the bug. I got a table like this TABLE t {uint64_t key, name player1, name player2, uint64_t status}; when the contract recieved the specific action , It will ...
1
vote
1answer
34 views

is that a good way to gather smart contract action data in backend with Demux.js?

there is a Bill functionality in my DApp, which need gather millions of EOS action data to make up a token transfer data for front end to display. the question is, it takes quite a long time. if it ...
1
vote
1answer
29 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
1
vote
0answers
14 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
1
vote
1answer
30 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 ...
2
votes
1answer
33 views

Example Smart Contract for Staking and Unstaking your own Token

I'm searching for an example Smart Contract snippet for staking and unstaking a token, for example how KARMA / POKER / DICE are working. If I stake the token, I'm able to collect dividends. If I ...
2
votes
1answer
30 views

Error message: Exceeded call depth maximum

I am writing a smart contract and I am receiving this error message: Error 3070002: Runtime error processing WASM Error details: Exceeded call depth maximum I am confused, since I believe this ...
2
votes
1answer
33 views

Can one provably disable user-initiated transfers from an account?

In this scenario a deployed smart contract should have and retain full control of the funds (excluding BPs of course) on the account. How can one stop transfers from an account by the account owner? ...
1
vote
1answer
41 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 = ...
3
votes
2answers
60 views

Is it possible to use a type other than uint64_t for a table primary key?

I want to use a uint128_t as a primary key in a multi_index table. Is this possible? If so, how should the ABI file be written to accomodate it?
2
votes
1answer
54 views

Accessing current transaction ID within a smart contract

Is it possible to access the current transaction ID from within a smart contract?
1
vote
0answers
28 views

How to format string in a contract

I'm trying to format string using boost library, but EOS gives error <atomic> is not supported on this single threaded system. But, as for me, boost format is the most convenient solution. ...
1
vote
1answer
26 views

Why don't need ram_payer for erase method in mulit_index class?

mulit_index class has three methods (emplace, modify, erase) to update a table. emplace and modify methods need to select ram_payer. But erase method doesn't need to select it. I think these methods ...
1
vote
2answers
47 views

Divide funds by % to send to different wallets

I need a contract that can send funds at 1 time to multiple addresses by percentage. Ex: n disbursements 1@ 20% Another - 14% Another - x% Another - x% and so on. Ethereum does NOT have this ...
1
vote
2answers
68 views

How to call get_balance function in eos contract in 1.3.2?

In the old version, I can get self balance by these code: auto token = eosio::token(N(eosio.token)); const asset balance = token.get_balance(_self, symbol_type(EOS_SYMBOL).name());...
2
votes
3answers
61 views

Need to perform automatic smart contract function execution

Can we have a function in a smart contract to be executed automatically after some time? for example, transfer some tokens after every 5 seconds.
2
votes
0answers
70 views

EOS signatures vs Ethereum signatures

So I'm trying to find a way to sign a message with a certain private key, and then to be able to recover it's corresponding public key/address on both Ethereum and EOS. The thing is I'm having some ...
0
votes
0answers
19 views

Generate public key through smart contract

I'm trying to create new account through a smart contract and i need to provide a public key to the inline action. How can i generate a public key dynamically through my smart contract? Is there any ...
1
vote
1answer
23 views

How to auth the issue permission to another contract?

I created a token "ABC" from account "tokenabc" and deployed a airdrop contract "airdroptoken". And I hope that everyone who transfers EOS token to this contract will get some airdrop token "ABC". ...
1
vote
0answers
17 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 ? ...
1
vote
2answers
45 views

What is the difference between transaction.send and action.send?

I found that there are two type of transfer. I can use in the eos contract, but I dont know what is the difference between them. 1st========================== 2nd =============================...
2
votes
1answer
32 views

Storing the data in “Memo” of block chain transaction

Can I store large size of data such as MP3 in Memo? Are there any implementation examples? To store the data or any comments in Memo, should I send some amount of EOS? Can I store the data without ...
1
vote
0answers
25 views

Reclaim RAM for dApp that creates an account and transfers funds

A dApp that creates a new account and transfers EOS to that account will have to 'pay' for 240 bytes of RAM for the new balance object on the new account. When the new account transfers some funds, ...
1
vote
0answers
8 views

How to deserialise extended amount?

How to deserialise extended amount from "0x00924c50832000000000000000000000" to a number in JS or PHP?
1
vote
0answers
18 views

how to use singleton in eos contract? no member named 'get_or_default' [duplicate]

no member named 'get_or_default' #include <eosiolib/singleton.hpp> struct [[eosio::table]] glo { uint64_t key; uint32_t stamp; EOSLIB_SERIALIZE(glo, (key)(stamp)) }; typedef eosio:...
1
vote
1answer
30 views

if i issue a eos token, how to 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; ...
2
votes
1answer
55 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 ...
2
votes
2answers
79 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 ...
2
votes
1answer
41 views

do i still need to pay after deployed an eos contract

I have deployed a contract. and I am confused about the fees: Do I still need to pay for resources such as RAM and CPU for actions like emplace and modify after I deployed a contract? Or can I just ...
1
vote
1answer
35 views

Private Transactions inside Smart Contract

Is there a way to make some transactions private inside a smart contract? It's needed for a game theoretic model. Like imagine poker on blockchain: you'd like not to reveal cards until some point in ...