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 [contract]

The tag has no usage guidance.

0
votes
0answers
16 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(...
0
votes
0answers
19 views

Serialization Error Processing WASM

So I have nodeos up and running perfectly. I created a directory for a test project where I'm trying to use the eosio.token files in eosio.cdt to create a new token. When I run... cleos set ...
1
vote
1answer
24 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
19 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
24 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
104 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
24 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
0answers
57 views

Error 3070002: Runtime Error Processing WASM

I am getting this error on the testnet: Error 3070002: Runtime Error Processing WASM Error Details: access violation pending console output: testdauser11.hpp file: #include "../eosiolib/eosio.hpp" #...
1
vote
1answer
100 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
1answer
200 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
66 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
64 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
51 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?
1
vote
1answer
77 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 ...
0
votes
0answers
50 views

recover_key error

When calling recover_key, I get the following error: thread-0 static_variant.hpp:339 set_which Error unpacking field _storage {"field":"_storage"} thread-0 raw.hpp:368 operator() error ...
2
votes
1answer
401 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
49 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
208 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
91 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
114 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
203 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
108 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
121 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
115 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
202 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 ...
0
votes
0answers
9 views

How to change cmake makefiles to use c source in contract

How can I use c code in my contract? Mainly how to change the cmake make file system to include a c file for my contract.
2
votes
1answer
86 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
166 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
114 views

The given contract doesnt' 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
172 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
56 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
71 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
831 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
229 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
246 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
93 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
176 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
0answers
84 views

Updating eosio.system contract to latest version

I see that 1.0.7 includes a few changes to the eosio.system contract. I have a multi-node testnet fully installed and running fine. Are there any steps needed to update the content of that eosio....
0
votes
1answer
285 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
59 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
47 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
374 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
118 views

Can a malicious contract consume users' ram?

Can an evil contract fill users' ram with junk data?
1
vote
2answers
118 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
97 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
201 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
459 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 "...
4
votes
3answers
82 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 ...
2
votes
1answer
81 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
2answers
75 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 ...