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

1
vote
0answers
9 views

Where are deferred transaction errors logged to?

I'm trying to learn about deferred transactions. I'm creating a bogus deferred transaction that invokes a non-existent action "fakeaction": transaction out{}; out.actions.emplace_back(...
0
votes
1answer
23 views

Can a contract know the creation date of accounts?

Is the creation date of accounts part of consensus? Can I query it within contracts? If so, how to do it?
0
votes
1answer
24 views

How to list all balances of tokens managed by an eosio.token contract?

Let's say I have deployed the standard eosio.token contract to an account called "myeosiotoken," and I have used it to create an "ABC" token. Then, I issue 1,000 ABC to "someaccount1" and 2,000 ABC to ...
1
vote
1answer
33 views

How to extend the functionality of eosio.token?

I want to create an EOSIO token with additional functionality. For example, I want users to be able to claim() an additional token per day (since e.g. account creation date). Should I create a new ...
0
votes
1answer
14 views

Token transfer missing_auth_exception

{ "code":500,"message":"Internal Service Error", "error":{"code":3090004,"name":"missing_auth_exception", "what":"Missing required authority", "details":[{"message":"missing authority of thomsoimj21","...
0
votes
1answer
16 views

How to deploy a contract to api-kylin.eosasia.one testnet

I have written a helloworld contract and got compiled that successfully thomsonim123 is my kylin testnet account with some EOS when I want to deploy the contracct to the testnet I get few errors. ...
0
votes
1answer
16 views

Is it possible to overload contract actions?

I had a method: -- t.hpp -- [[eosio::action]] void exchange(); -- t.cpp -- void token::exchange() { ... } EOSIO_DISPATCH(eosio::token, (exchange)) and then decided that if a parameter were ...
0
votes
1answer
23 views

Authorisation failure with deferred transaction

I have a contract action that does some cleanup: void token::cleanup() { ... } that I want to run asynchronously from another action like this: schedule("cleanup", 10). my scheduling method looks ...
0
votes
0answers
23 views

Exception Details: 3080006 deadline_exception: Transaction took too long

I'm getting this error and have read all there is to read on the net (which isn't much) about it. mostly I see others complaining about this error when they run an action for the first time in my ...
0
votes
1answer
18 views

Erasing records with for loops

if I want to erase a table: orderbook b(_self, _self.value); auto m = b.get_index<name("idxprod")>(); for (auto &i : m) { m.erase(i); } I get the error: Error 3160005: The table ...
3
votes
1answer
30 views

How to sort a table?

I'm following this explanation https://developers.eos.io/eosio-cpp/v1.1.0/docs/multi-index-table-tutorial using v1.5.0 of the CDT. Here's what I've got: struct [[eosio::table]] order_struct { ...
0
votes
1answer
15 views

Symbol stringification?

an action in my contract accepts an asset: void token::burn(asset a) which I want to print out: printf("Asset [%s] burnt\n", a.symbol.to_string()); except the symbol class does not offer ...
0
votes
2answers
10 views

Asset instantiation woes

if I declare an asset: asset a(10, symbol("TST", 0); and I print it: a.print(); I get pretty much what I'd expect: TST the format's not quite right (10 TST would have been better), but ...
1
vote
1answer
11 views

Multiple print statements?

given the lack of debugging facilities in EOS contract development I add print() statements to my code, but I'm finding that only the first one gets printed, so: print("HERE\n"); print("HERE\n"); ...
0
votes
1answer
31 views

no member named 'print' in 'std::__1::basic_string<char>'

if I declare a string and attempt to print it like this: std::string s; eosio::print(s); the EOS compiler pukes: In file included from t.cpp:1: In file included from ./t.hpp:4: In file included ...
1
vote
2answers
46 views

Passing a string to an action?

I have an action that needs to operate on a string: void token::MyAction(std::string key); so I would expect I can make the call like this: cleos push action MyAccount MyAction '["burn"]' -p ...
0
votes
2answers
35 views

Referring to permissioned account within contract code?

I've created a table within a contract where I want to store user information. the .emplace() method's first parameter specifies the "scope" (I guess) for data to be stored and thus the user account ...
0
votes
1answer
28 views

delay_sec is not accurate for deferred transaction

I have set some seconds but sometimes it is delayed more than 10 minutes. I know that delay_sec is not the accurate time because of the block production mechanism. The real time is much later than it ...
1
vote
2answers
29 views

Error about billed CPU time when set Hello World Smart Contract

My VM Spec (VMWare ESXI) CPU : Xeon CPU E5-2620 v2 @ 2.10GHz Memory : 8GB HDD : 70GB EOS 1.5.3 , EOS.CDT 1.4.1 Compile from Source Code with AutoBuild Scripts. I try to create first smart contract ...
0
votes
1answer
39 views

EOSIO: name.value secondary index returns end iterator, even though searched value exists in table

I've got a multi-index table going with two secondary indices: TABLE entry { uint64_t id = 0; eosio::name player; std::vector<uint16_t> allocation; ...
1
vote
1answer
16 views

Multiple Inheritance within ABI files

I have various classes that use multiple inheritance, i.e.: class A { }; class B { }; class C : public A, public B { }; Single inheritance in an ABI file is possible using the base layer as ...
0
votes
2answers
49 views

Best way to read data from contract using eosjs or Cleos

How you read the data from your contracts, just by using actions? Or there is another way? Thanks!
2
votes
3answers
42 views

Updating existing token contract code

I have deployed a token on main net and called the create method to issue tokens. However, I would like to update the token code to add an extra feature. I can't find any information on the best ...
2
votes
1answer
67 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
180 views

A possible alternative sign in/login process instead of firebase auth / amazon cognito using an eos contract?

I had the the idea of a secure alternative login process using an EOS smart contract instead of firebase or Amazon cognito. I would like to know if something like this feasible? My idea is somewhat ...
1
vote
1answer
28 views

In Eosbetdice contract, in the transfer action, why it is able to emplace a new row in this table?

In Eosbetdice contract, https://gitlab.com/EOSBetCasino/eosbetdice_public/blob/master/EOSBetDice.cpp#L193 The code of the contract in this line should be "eosio.token". I wonder why it doesn't get "...
0
votes
1answer
25 views

Blacklisting specific addresses on token::transfer

I've issued a token using eosio.token standard contract. I want to prevent transfers to a number of specific accounts, for a limited time. Since it is temporary, I think I can simply hardcode the ...
0
votes
2answers
53 views

I have got “cannot modify objects in table of another contract” when trying to modify a table in my transfer function

I saw some contract implement a handler which will be triggered when receiving EOS token via eosio.token::transfer. I tried to have the same transfer handler and change some row of my table. But I ...
1
vote
1answer
81 views

How to write a contract to stake my own token without doing transfer?

In my case, I need to write a contract which has an action can stake my own token (issued by my account with eosio.token, like TADO). If A has 10 TADO already, when he stakes 4 TADO, his balance still ...
2
votes
1answer
70 views

Using name as secondary index

I want to save name in table, and to search by it. It doesn't seems that it is possible to have secondary index with type name for some reason. I would like also to pass name in function and to have ...
0
votes
1answer
37 views

eos smart contract constructor

when is smart contract constructor triggered for the first time? I know it is triggered every time action is pushed, but what if i want something to be triggered when smart contract is deployed for ...
0
votes
1answer
97 views

What does “require_recipient” function actually do in eos?

What does "require_recipient" function actually do? What's the difference between require_recipient and inline action? If contract A calls contract B using require_recipient, can contract B use ...
2
votes
1answer
80 views

How do I create a Multi-Index DB secondary index from a String?

I'm developing a Smart Contract for EOSIO. I have a Multi-Index table with a uint64_t primary key. I'd like to add a secondary index to the table. Ideally the data I'd be indexing on would be a std::...
0
votes
1answer
52 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
27 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
49 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/...
1
vote
2answers
82 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
66 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
46 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
1answer
51 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
34 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. ...
3
votes
1answer
70 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
29 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
37 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
51 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
58 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
35 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
37 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
61 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
1answer
43 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?