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.

Filter by
Sorted by
Tagged with
1
vote
0answers
33 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 ...
1
vote
1answer
52 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
164 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
139 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
75 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
69 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
120 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(...
2
votes
2answers
142 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?
3
votes
1answer
249 views

What is the reason for appearance of “misaligned reference”?

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 ...
4
votes
1answer
99 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 received the specific action, it will go ...
1
vote
1answer
69 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
511 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
91 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> #...
2
votes
3answers
236 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 ...
3
votes
1answer
410 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 ...
3
votes
1answer
210 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
46 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
133 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
415 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?
4
votes
2answers
690 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
83 views

How to format string in a contract [closed]

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
47 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
148 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
427 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
326 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.
3
votes
1answer
371 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 ...
1
vote
0answers
60 views

Signing a users account contract deployment remotely with a users arbitrary signature

What I am trying to do is deploy a contract on the behalf of the user, by getting them to sign the deployment remotely. I have been informed that if I get a arbitrary signature on the setcode, I can ...
2
votes
1answer
60 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". ...
2
votes
1answer
135 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
1answer
67 views

How to check number of std::hash locally?

I can not reproduce hash number of these code at local neither at ubuntu or mac environment. Can anyone tell me how to write a local code that can reproduce the hash result. Below is the code hash ...
1
vote
2answers
343 views

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

I found that there are two types of transfer I can use in an EOS contract, but I don't know what is the difference between them. 1st type 2nd type
3
votes
1answer
163 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 ...
2
votes
1answer
81 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
44 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
162 views

If I issue an EOS token, how do I 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; ...
3
votes
1answer
177 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
2answers
244 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
82 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
74 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 ...
2
votes
1answer
591 views

How can I convert a uint128_t to a string?

I am using a uint128_t as an id type for a contract I am working on. For a certain check, I need to convert this variable to a string so I can check for it in another table (whose type cannot be ...
3
votes
1answer
341 views

How can multisig trigger an action in contract other than eosio.token contract?

Other than eosio.token contract how can we call the inline actions in contract from multisig contract. For example, I have a contracts namely mltisigmetup(with action meetup). Now I need a ...
2
votes
1answer
42 views

How to publish an auditable EOS Smart Contract in a trustless way?

In Ethereum every smart contract is public. This can obviously have downsides, but an important upside is the auditability and trustworthiness of contracts. In EOS by default contracts are NOT public. ...
2
votes
2answers
233 views

unpack_action_data for transfer in newer CDT version

in the newer version of CDT, currency is removed from eoslib. Therefore, for unpack_action_data<currency::transfer>(), what value should substitute currency::transfer?
1
vote
1answer
110 views

Is there a way to have a 2 dimensional vector in my table?

I can have a string vector by manually changing the type in my abi file to string[] but if I try string[][] I get an ABI error in my node: Error 3015004: The type defined in the ABI is invalid Any ...
5
votes
1answer
189 views

eosio multisig exec problem

For multisig transaction, 1. Firstly I have created two accounts(partner1 and partner2) with same key(EOS....HoCF) cleos create account eosio partner1 EOS8FE********HoCF cleos create account ...
3
votes
1answer
157 views

how to implement a 48-char-long symbol token with balances like “10.0000 custom.name.of.the.token”?

I need to create my.token smart contract on EOS that will be exactly the same as eosio.token contract but my.token's symbol_code will allow a much bigger string. Something like 50 character long ...
3
votes
1answer
225 views

Issue setting permissions for use of eosio.token in smart contract

I have an action in a smart contract called submanager that I want to make use of the transfer action from eosio.token (I'm using eosio.cdt v1.3). ACTION subscribe(name from, name to, asset quantity,...
2
votes
1answer
109 views

ABI File To Communicate With Unity Game Engine

So I'm building an HTML5 Unity game that will run in an internet browser attached to the Interplanetary File System. Unity allows for JSON files to be used to send and receive binary data between ...
2
votes
1answer
207 views

How do trade eosio token and other token (NFT) in contract?

I'm trying to develop NFT's contract with reference to unicoeos/eosio.nft. Also I'm trying to develop NFT's shop contract in order to trade NFT and eosio.token. The logic trading NFT and eosio....
2
votes
1answer
169 views

Send same action as `cleos push action hello hi …` in smart contract tutorial

I finished smart contract tutorial, and it worked well. Now I'm trying to send same action as cleos push action hello hi '["bob"]' -p user@active in tutorial by using RPC API, cause need to implement ...

1
4 5
6
7 8
12