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
5
votes
1answer
87 views

How can you make sure you know what the contract does when you send an action?

Say you want to send an action to a smart contract, and you know the WASM of the contract. You somehow obtained the original source code which was in C++, you compiled it to WASM, and you got the same ...
0
votes
1answer
91 views

where system_contract::claimrewards function is called

Recently I've done some researches in term of how BP earning reward functions implemented. Eventually, I found out that is system_contract::claimrewards however I can't find where it's called. I ...
0
votes
1answer
235 views

How should I get the data of the multi_index database?(about contract)

The return value of the action function can only be void type. I can't get data by return value. Now I have saved multiple objects in the multi_index database. I want to get them at once, what should ...
0
votes
1answer
751 views

How to pass a list / array / vector to an action? [duplicate]

I need to pass a list of integers to an action. It would be fine to use vectors or arrays, but I can't find one that works. Using vector in the smart contract compiles fine, but then I get this error ...
0
votes
2answers
62 views

Transaction took too long while using std::shuffle

Get the error when I push a action on my contract on the local testnet: But if I remove this code from the action I called, there is no problem: class urng: Does anyone know what caused this?I just ...
0
votes
1answer
87 views

Can't use fopen, fclose, and ifstream

Here's a screenshot of the problem. This happened when I use eosiocpp to compile my .cpp file into .wast. Does the compiler not allow file reading?
0
votes
1answer
523 views

How to add a "memo" to an action?

In an action in my contract, I want to attach some text to it, so that users can see the text in their transaction history using a block explore like eosflare.io. I see that eosio.token has a "memo" ...
1
vote
1answer
169 views

How to retrieve historical EOS supply?

I know $ cleos get currency stats eosio.token EOS reports the current supply in the blockchain, but how can I get the supply through time?
0
votes
1answer
78 views

How to get current price of a custom contract token via cleos

I want to know the current price of the CET token via cleos. I can get the supply details using cleos: $ cleos get currency stats eosiochaince CET { "CET": { "supply": "900100052.0000 CET", ...
1
vote
1answer
194 views

what does the same_payer mean in eosio contract?

user_stakes.modify(sk,same_payer,[&](auto &s){ The variable same_payer confused me sometime, so, what does the same_payer mean in eosio contract ?
0
votes
1answer
605 views

Ricardian contracts

At what level are Ricardian contracts implemented? Examples I see are in the constitution . Can these be applied at the application level? Eg. A derivation contract with the terms of contract ...
1
vote
0answers
150 views

How to trigger the user account token stake or unstake automatically by using contract

Actually , I have a scenario that users need to stake his or her own certain tokens on a platform by using eosio contract without worrying the platform will take over the users's tokens. and some ...
1
vote
1answer
324 views

Error 3070002: Runtime Error Processing WASM - i64.rem_u by 0

My contract deployed fine. However, when I try to call an action I get the following error: Error 3070002: Runtime Error Processing WASM Error Details: i64.rem_u by 0 And the log from the nodeos: ...
1
vote
0answers
62 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 ...
1
vote
2answers
44 views

Is there a way to check the histroy of a contract's table?

Is there a way to check the history after deleting the information in the table? For example, check yesterday's table information.
1
vote
0answers
20 views

Hide information in the blockchain

Lets say I want to create a player vs player game with a battlefield and moving armies, the movement and data about the armies and where is it going is put on the blockchain. My question is how to ...
1
vote
1answer
41 views

Validation for contract which has data which varies

How does the EOS contract system handle data which varies? This could be from using a true random number, or receiving real-world data like a token price. Every time the contract executes, different ...
1
vote
1answer
530 views

Where is 'INLINE_ACTION_SENDER' macro defined?

I am trying to use INLINE_ACTION_SENDER to use an action from another contract but get the following error. error: use of undeclared identifier 'INLINE_ACTION_SENDER' How do I include this macro in ...
1
vote
1answer
586 views

cleos set contract error Unexpected char '60' in ""

Two weeks ago I tried to use cleos subcommands and everything worked fine. I could set contract to the accounts I created using my own smart contract code. Now whenever I tried set contract or create ...
1
vote
2answers
245 views

Can a contract trigger events in the outside world?

Is it possible for a contract to somehow trigger an event which an external process may listen for? Or is polling the only practical way currently to determine an outcome in a contract?
1
vote
1answer
625 views

How to access multi-index from other contract?

Contract A created a multi-index table pets like pets(_self, _self); ... pets.emplace(user1,...); Now in contract B, I would like to update a row like pets(N(A), N(A)); ... pets.modify(pet, user1, ....
1
vote
1answer
587 views

Error 3010008: No ABI found

I was able to push the contract to the jungle test net but i am unable to run the contract. i get this error: Error 3010008: No ABI found what am i doing wrong? thanks.
1
vote
2answers
96 views

contract deployment ubuntu 16.04

I am having issues deploying contracts on a single node test environment. I used the setup scripts and played around with the config.ini file. Everything runs and all the commands at least regarding ...
1
vote
1answer
740 views

Assertion failure after updating a smart contract with tables

Before the update Before the update of the code of my c++ smart contract, this uses to work absolutely fine. Data storing on the table and actions execution were done successfully. After the update ...
1
vote
1answer
68 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
244 views

The given contract doesn't exist in the blockchain

I have got contract code below: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace std; using namespace eosio; class deneme: contract { // @abi table ...
1
vote
1answer
299 views

how can i know if a name is account or contract?

How can i use cleos to get all rows from a table? It seems that cleos always only return 10 records? { "rows": [{ "buyer": "1111111111oo", "keys": 70, "award": 198185, "share_award": 0, "...
1
vote
1answer
47 views

hello contract: not printing the name

I just set the hello contract and pushed action hi. But it did not print the name. Here is my test command. $cleos --wallet-url http://172.18.0.1:8899 -u http://172.18.0.1:8888 push action shlee ...
1
vote
2answers
108 views

What can prevent one from changing contract code?

I find one major characteristic of EOSIO is that the smart contract code is interchangeable, so that developers can easily fix any bugs or change its logic. But what if someone changes the code to ...
1
vote
1answer
72 views

`cleos get table` not returning vector<string>

I declare a vector vector<string> data inside a contract. Contract Code: book.emplace(_self, [&](struct wname &a){ a.name = fa.pubaddress; a.namehash = ...
1
vote
1answer
73 views

What exactly the merkle function is returning?

In the below file, https://github.com/EOSIO/eos/blob/v1.7.4/libraries/chain/merkle.cpp, what do ids.front() mean?; what exactly this function Merkle is returning? Could you please explain what this ...
1
vote
1answer
52 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 "...
1
vote
2answers
969 views

in the system contract, what is required for require_auth(_self)

In the system contract (eosio_system.cpp) there are some functions which require require_auth( _self ); How is this auth level achieved by the 21 producers?
2
votes
1answer
68 views

Corrupted account name in nodeos log during action pushing

Have an issue with the action push: cleos --wallet-url "http://localhost:8889" push action contractx put '["test", "75c88c9593bec6b716f2cb9b60db79282b6f3389a39f3be9adef45e06b379b48"]' -p test Error ...
2
votes
1answer
26 views

installed Local Enviroment get "unresolvable": env.current_time error

as stated in the topic, i installed eosio new because i had a few problems with the older Version with actions in actions and now i get this error everytime i want to create a contract on the chain. ...
2
votes
1answer
99 views

EOS system contract is too large to execute in local machine!

When I set the eos system contract with mainnet-v1.0.3, it always give me a error, that the transaction is too long and give me the belong error {"now":"2018-06-14T08:16:44.376", "deadline":"2018-06-...
2
votes
1answer
82 views

Is it safe to assume that a function can't be called directly if it is not defined in the ABI?

I'm writing a function in my contract that is supposed to run only if I receive a transfer notification from "eosio.token". The way I handle eosio.token transfer notification is similar to this (but ...
2
votes
1answer
117 views

Has the exchange contract deployed to the eos mainet?

Has the exchange contract deployed to the eos mainet? When will it be available ?
2
votes
1answer
114 views

Multi index can access data in contract but (RPC) cleos get table is empty

Here is the code I deployed it with the following command: cleos set contract . demo.wast demo.abi -p demo and query it with: cleos get table demo demo demos
2
votes
2answers
730 views

recover_key in contract

Is there a specific sample code of using recover_key()? I got an error with recover_key() in contract. string msg="charlie"; checksum256 m_hash; sha256( const_cast<char*>(msg.c_str()), msg....
2
votes
2answers
67 views

A contract that generates another contract

If I want to create a smart contract with an action 'Create Game' and on calling that action a new contract be formed, how is it possible?
2
votes
2answers
536 views

Compile error: undefined symbol: apply

I am following the tutorials on EOS's Developer's Portal. My EOS build was successful. I initially had errors with BOOST but it ran fine when I installed it the second time. This is the code from ...
2
votes
2answers
154 views

Can a malicious contract consume users' ram?

Can an evil contract fill users' ram with junk data?
2
votes
1answer
229 views

set contract error

I tried to set contract with the promotion account, but kept getting this error: cleos set contract promotion car_promotion -p promotion Reading WAST/WASM from car_promotion/car_promotion.wasm... ...
2
votes
2answers
123 views

How to emit specific messages after action is executed?

In solidity, we can emit many type messages when transaction finished, but in eos, I did't find it. I see the require_receipt api to notify the listeners the action but not the action result. Anyone ...
2
votes
1answer
1k views

Is "Smart Contract" supported by EOS ? Which Language?

What is the equivalent platform of Ethereum Smart Contract in EOS ? And by which programming languages we can develop a smart contract? Is there a specific language like Solidity in Ethereum? And is ...
3
votes
1answer
53 views

When would the branch "native-contract-debugging" be merged to the master?

I've gotten a message that there would be a better method to debug a custom contract from Telegram. This would be implemented in the branch "native-contract-debugging" which would be merged to the ...
3
votes
1answer
670 views

Can actions have return types?

I've been looking at most of the example contracts and every action seems to return void. Does this mean that you can not have a return type for your actions? Instead, would you have to send a ...
3
votes
1answer
225 views

Why is action 'eosio::setcode' on the action blacklist in the mainnet?

Error 3130005: Action to execute is on the blacklist Error Details: action 'eosio::setcode' is on the action blacklist pending console output: in mainnet Why is this?
3
votes
1answer
671 views

Getting an unknown key error while transfer some EOS form one account to another

I have written an action transfer in my contract which is as below // @abi action void second::transfer( account_name from, account_name to, asset ...

1
3 4
5
6 7
12