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
0
votes
1answer
520 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
163 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
75 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
170 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
597 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
147 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
306 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
58 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
42 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
19 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
39 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
526 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
566 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
240 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
602 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
565 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
95 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
698 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
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
238 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
298 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
46 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
104 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
70 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
71 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
51 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
953 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
67 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
22 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
98 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
81 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
116 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
113 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
712 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
64 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
525 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
153 views

Can a malicious contract consume users' ram?

Can an evil contract fill users' ram with junk data?
2
votes
1answer
228 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
120 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
52 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
661 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
222 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
635 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 ...
3
votes
1answer
360 views

Passing the parameters in actions vector of transaction struct

In the below code, I am passing parameters to actions struct which takes account_name, action_name, permission vector and arguments. But while sending the account_name using N it is taking the exact ...
3
votes
2answers
127 views

What is needed to get the EOS ~1.1.4 tutorials working on Ubuntu 16.04 (having compiled from source)?

I've found lots of info for Dawn 3.0, but there's a note in the 1.1.0 release notes that acknowledges that the EOS Developer Portal tutorials (token, exchange, helloWorld) don't work and need updating,...
3
votes
1answer
306 views

ICO/Payment contact

Anyone is working on some ICO/Payment contacts? What I would like to learn are following functionalities within the contract: Payment, where the fee is split into 3 accounts. a) So user sends a fee ...
3
votes
1answer
108 views

Error 3030002 when trying to set contract steps

I'm following steps from exchange-tutorial-python's README file inside the Docker container: $ docker run -it eosio/eos # nodeosd.sh 2>/dev/null & # cleos wallet create Creating wallet: ...
3
votes
2answers
2k views

How to send an action from one contract to another?

From contract A, I want to send an action to contract B. How to do that? There is SEND_INLINE_ACTION but that seems to need a pointer to the contract (usually *this), correct? Solution Using action....
4
votes
3answers
173 views

How can a contract obtain and process variable data from the outside world?

Suppose I have a contract which depends on the current price of a real-world asset (like the price of gold). How would the contract obtain that price? How would I ensure that every time the contract ...

1
3 4
5
6 7
12