Stack Exchange Network

Stack Exchange network consists of 175 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 [contract]

The tag has no usage guidance.

0
votes
2answers
29 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 ...
1
vote
1answer
41 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
2answers
61 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 ...
2
votes
0answers
53 views

Deploy Contract from browser using eosjs

so I would like to deploy an EOS contract using eosjs. I encountered several problems (especially with converting the .abi and .wasm files). All the examples either use node (so fs is available) or an ...
0
votes
1answer
31 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","...
1
vote
2answers
22 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
1answer
36 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
1answer
31 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 ...
0
votes
0answers
19 views

What is the significance of passing account_name code to this contract's action?

Link to contract void receivedTokens( const currency::transfer& t, account_name code ) { if( t.to == _self ) { string cMemo = t.memo; string stringName(...
2
votes
1answer
57 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
46 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
1answer
41 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 ...
0
votes
1answer
267 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 ...
1
vote
0answers
30 views

Ricardian on the EOS chain

I have implement Ricardian contract on my contract and can be seen in contract abi file but i have few questions Let say user binds a ricardian contract with my application and perform an transaction ...
1
vote
1answer
253 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 ...
2
votes
2answers
307 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 ...
5
votes
2answers
108 views

Where should tables be created? In the contract or in each action?

In the simple blog dapp (https://github.com/EOSIO/eosio-project-demux-example) the table (for posts) was defined in the contract but is not instantiated as a field. What are the advantages/...
1
vote
2answers
71 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 ...
2
votes
2answers
56 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
1answer
129 views

Getting account CPU usage in smart contract

Is it possible to access the CPU usage of a given account from within a smart contract? For eg. in a smart contract transfer notification, you call get_account_info(N(some_account_name)) which ...
2
votes
1answer
709 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 ...
5
votes
1answer
58 views

How does eosio support complex structure as the input of a contract's method?

AFAIK, the data type in Wasm only supports i32,i64,f32,f64, but when we use eosio contract, we can pass a string as a parameter. Anyone can tell me how eosio does that?
2
votes
2answers
351 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....
3
votes
2answers
101 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
190 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
244 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 ...
1
vote
1answer
187 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
223 views

How to use recover function in crypto.hpp to verify signature and public key

I want to sign some data in client using eosjs-ecc.sign() and result is a string like "SIG_K1_KcTmv..." I want to use the recover_key(const checksum256* digest, const char* sig, size_t siglen, char*...
3
votes
1answer
140 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?
1
vote
2answers
285 views

print in contract not showing output in eosjs docker

i want to print some logs in eosjs docker version. But somehow it is not showing anything. I have set: # print contract's output to console (eosio::chain_plugin) contracts-console = true in the ...
2
votes
1answer
93 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
0
votes
1answer
194 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 ...
1
vote
2answers
150 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
272 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.
0
votes
1answer
57 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", ...
0
votes
1answer
98 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?
3
votes
2answers
1k 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....
1
vote
1answer
382 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, ....
4
votes
2answers
330 views

How do you inherit an eosio contract?

I am trying to inherit the 'eosio.token' contract found in '/eos/contracts/eosio.token/' into my new class 'my.token' My CMakeLists.txt looks like file(GLOB ABI_FILES "*.abi") configure_file("${...
2
votes
1answer
101 views

Has the exchange contract deployed to the eos mainet?

Has the exchange contract deployed to the eos mainet? When will it be available ?
1
vote
1answer
212 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: ...
0
votes
1answer
381 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" ...
2
votes
1answer
68 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
59 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 ...
1
vote
2answers
581 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
2answers
139 views

Can a malicious contract consume users' ram?

Can an evil contract fill users' ram with junk data?
1
vote
2answers
164 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
0answers
118 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
311 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 ...
4
votes
1answer
543 views

“dice” contract “withdraw” action problem

I wonder if anyone experienced a similar problem and managed to resolve it. I'm testing the "dice" contract on my local tesnet. I've setup up all necessary contracts and could deposit assets to the "...