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
1
vote
0answers
4 views

How to tell a certain contract in indeed used in a dApp?

The dapp review sites often list the contract names a dapp is using. I see that this is added by whoever has added that dApp into the review site. But is there a verifiable way (through an explorer ...
1
vote
1answer
41 views

How can I get the balance of my account with smart contracts in cdt 1.6

All previous answers before used some function called get_balance, but there is none listed like that in the api https://eosio.github.io/eosio.cdt/1.6.0/functions.html.
1
vote
1answer
22 views

Is it possible to deploy contract via curl?

Using command line i am deploying smart contract "eosio.token". cleos -u http://127.0.0.1:8888 set contract eosio.token ./eosio.token -p eosio.token Is it possible to deploy smart contract using ...
0
votes
1answer
21 views

check (within smart contract) if an account is a proxy

How can I verify within a smart contract that an account is a proxy? I know that there is a function is_account, which verifies that a name is an existing account. Is there a way to check if an ...
2
votes
1answer
26 views

How can i burn the tokens i create with eosio.token

I want to burn the tokens i created for some reasons, I found the method "retire" in eosio.token. But, this method only change the supply of the token, the maximum supply is still the same as it is ...
1
vote
1answer
7 views

How to pass a map into an action

I'm trying to pass a map into action, but there is serialization error: Error: expected object containing data: undefined There is a function signature: void init(uint64_t id, const map<uint8_t, ...
1
vote
2answers
50 views

env.is_feature_activated error when set contract

i just trying to setup my eos enviroment , when i post the system contracts i got the error msg: Error 3070000: WASM Exception Error Details: env.is_feature_activated unresolveable enviroment: ...
1
vote
1answer
8 views

Is it possible to set up a smart contract with multiple .cpp and .hpp files?

If we want to make our smart contract code modular, and keep each class, contract, and table in its own file, is it possible to do this, and if so, how?
0
votes
0answers
9 views

Private MultiNode Testnet: Undefined Reference to secp256k1_rangeproof_info Error

I run into issues while building eosio.contracts repo. The link stage of eosio.contracts fails with errors similar to ”undefined reference to secp256k1_rangeproof_info". I have eos v1.8.1, eosio.cdt ...
1
vote
1answer
14 views

Can smart contract trigger some action on specified timestamp and change certain account balances?

Imagine I have a poll with specified timestamp for the end. At that point in time votes should be tallied and voters token balances should be adjusted in both directions (increase and decrease). How ...
0
votes
0answers
27 views

Search in multi_index table by multiple fields (compound search)

Here is defined a sample table with four fields, two of them (account and type) I am going to use in my compound search: struct [[eosio::table]] total { uint64_t id; uint64_t account; ...
1
vote
1answer
26 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
0answers
69 views

Make a transfer from contract code on behalf of user [duplicate]

Installed: eosio: 1.7.3; eosio.cdt: 1.6.1 Implemented and locally deployed: sample market contract and eosio.token contract. In order to make an inline transfer from market contract in behalf of a ...
1
vote
0answers
13 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 ...
0
votes
1answer
11 views

assertion failure with message: no balance object found

This error message occurs when trying to do a transfer: assertion failure with message: no balance object found What causes it and how can it be avoided?
0
votes
1answer
19 views

Unable to publish to Kylin

I have been developing against a local node, for which I created a key-pair. Now that it's time to publish to the testnet, I've imported said private key into Scatter and linked it to the account to ...
0
votes
0answers
8 views

How to use eosjs with scatter to deploy contract?

I am working on a use case that requires the smart contract to be deployed from frontend, and I am using Scatter as the wallet for the keys. Is there a way to deploy contracts on EOS Network using Eos....
0
votes
0answers
20 views

Block Timestamp Overflow

I am trying to build a contract and receiving this error: In file included from /usr/opt/eosio.cdt/1.6.1/bin/../include/eosiolib/contracts/eosio/system.hpp:6:[0K /usr/opt/eosio.cdt/1.6.1/bin/../...
0
votes
0answers
13 views

Function: 'find' not defined for std::vector [migrated]

only like this find data,hvae big data in vector? std::vector<uint32_t> rules; for (auto iter = rules.begin(); iter != rules.end(); ++iter) {}
1
vote
0answers
16 views

How to get a contract to accept tokens as payment

I keep getting the following error: transaction declares authority '{"actor":"test2","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [...
0
votes
0answers
8 views

Is there a way to issue tokens infinitely?

I want to design a system where token supply can grow infinitely. Is it possible not to fix total supply at the token creation moment?
0
votes
1answer
54 views

Transfer tokens inside a smart contract from an account to another account

I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two But I have to use not eosio.token contract but ...
1
vote
1answer
26 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 ...
2
votes
1answer
48 views

What is the meaning of “scope” in a Smart Contract?

Since I have read the tutorial. I don't understanding the following: Note that scopes are used to logically separate tables within a multi-index (see the eosio.token contract multi-index for an ...
0
votes
3answers
41 views

Can not find `eosio/eosio.hpp` while compiling with eosio-cpp

I used the documentation provided by EOSI. I made all the required installation as suggested in the docs. While writing the hello world contract, I face this issue when running the following command ...
2
votes
1answer
52 views

How to debug eosio::on_notify(“eosio.token::transfer”) actions?

I'm working on a contract that will run an action when receiving tokens. The following code does not run when the account receives EOS or JUNGLE tokens on the Jungle Testnet. #include "./test.hpp" .....
1
vote
1answer
30 views

How to delete record on EOS if I forget table structure

I issue an EOS token for fun half a year ago and I'm planning to release my EOS ram recently. The problem is that I forget the table structure I made before and I overwrite the contract and there is ...
0
votes
1answer
23 views

Can I use Timers?

I know that there's no timer in other smart contracts and even this is not possible in regular blockchains. But, EOS uses C++, and they already did lots stuffs which makes smart contracts more usable. ...
0
votes
0answers
21 views

How large should the 'secrets' be when doing random number generation on a smart contract?

I am trying to implement an RNG system like the following, with the hash as a SHA-1 function: Randomness without risk of anyone "knowing" it requires a three step process: both parties ...
0
votes
1answer
33 views

eosio-cpp command not found error?

When I am trying to run hello world smart contract using a command eosio-cpp -abigen -o hello.wasm hello.cpp shown an error eosio-cpp: command not found?
0
votes
2answers
35 views

Ico smart contract update

I would like to update this code, because it is CDT 1.2. I would like to update for CDT 1.5 or CDT 1.6. What do I need to change? #include <eosiolib/eosio.hpp> #include <eosiolib/currency....
1
vote
2answers
64 views

Contract compilation fails during elemental battles tutorial

I have followed the elemental battles tutorial until lesson 2 step 4, and at the end of it, the tutorial instructs to compile the existing code with eosio-cpp -o destination.abi source.cpp -abigen (...
0
votes
1answer
24 views

EOS Token contract audit issue

My token contract was done by a third party vendor that did not share source code of the token contract with me. Can you help me on how to find the code, so that I can submit it to you for audit ...
0
votes
1answer
89 views

Why is [[eosio::on_notify(“eosio.token::transfer”)]] not working?

Network: kylin testnet. I transferred eos to this contract, but it the "deposit" function was not called. What do I miss?
0
votes
1answer
23 views

Acting on upon a receipt of a token, using v1.6 c++ libraries

Let's say I wanted to act upon receipt of a token and/or a message to a smart contract. Previous versions of EOS used the apply function to do this, however as of v1.6 things have changed to pure cpp ...
0
votes
0answers
21 views

Time point to string

I am currently trying to get the current time using time_point_sec(now()); Does someone know how to convert that to a std::string?
0
votes
1answer
34 views

Using find on multi index table

I have a table defined as the following: struct [[ eosio::table, eosio::contract("voting") ]] identity { uint64_t key; key256 identityHash; time_point_sec createdAt; uint64_t ...
1
vote
0answers
21 views

Get symbol & contract from asset

I currently have an asset property that stores a value, i.e. 100 EOS which could also be another token like 100 TLOS. Is there a way to extract the symbol and possibly the token contract from that ...
3
votes
1answer
28 views

What are the advantages and disadvantages of using multiple smartcontracts?

I have noticed many EOS contract programmers choose to have a token contract and a seperate smart contract for other things to do with those tokens. What are the advantages and disadvantages to this ...
0
votes
1answer
26 views

read datastream of length 29 over by -4

enum house_status: uint64_t { NEW = 10, FULL = 20, ONGOING = 30, OVER = 40 }; struct [[eosio::table, eosio::contract("game")]] house{ uint64_t id; uint64_t owner_player_id; ...
1
vote
1answer
72 views

Serialization Error Processing WASM while following hello.cpp tutorial

I am following along the tutorial on the EOS website at https://developers.eos.io/eosio-home/docs/your-first-contract At the first smart contract development section, I cannot manage to publish the ...
0
votes
0answers
13 views

Is there an EOS-equivalent for the ERC-1404-Standard?

I recently saw a Video about the erc1404-standard and read some articles about it. I think It's an interesting standard for security-tokens and international regulatory requirements. Is there an ...
0
votes
0answers
13 views

What's the difference between “using contract::contract” and define your own constructor function when designing a eos smart contract?

I got this piece of codes from https://developers.eos.io/eosio-cpp/docs/using-multi-index-tables Here, something confused me, 1. what does this "using contract::contract" mean ? in cpp ,this means ...
1
vote
2answers
37 views

How do I confirm that the person sending an action is the same as a user in the parameter?

Specific example from a contract: ... void hi(name user){ // verification here, require_auth(user)? print(user); } ... I've tried require_auth(user) but that seems to always fail unless the user ...
0
votes
1answer
27 views

Is there a way to call a multisig approval programmatically from within a contract?

Following scenario: There's an action which requires 3 signatures - two are 'normal accounts' and the third one is like 'system or robot', which does some verifications from within the smart contract....
0
votes
1answer
29 views

How is memory aligned in the EOSIO smart contract consensus memory?

Are there any memory savings if I declare a table record that has, say, a 64-bit integer (occupies 8 bytes) and a 16-bit integer (occupies 2 bytes)? Or is it aligned at 64 bits and said record would ...
3
votes
1answer
58 views

Ricardian Contract

Does eosio also sign the transaction with the ricardian contract of user consent and/or how does the application proove that a party agreed on said ricardian contract? I have integrated the ricardian ...
0
votes
1answer
27 views

How do I access a contract class variable from an extern “C” function “void apply()”?

In some scenarios, It's convenient to configure the conditions for monitoring some certain transactions by using this method extern "C" { void apply(uint64_t receiver, uint64_t code, uint64_t ...
0
votes
0answers
15 views

Can I deploy a contract from within a contract? [duplicate]

We can create accounts from contract code: https://github.com/angelol/smart_account_creator and we can query things about accounts: https://github.com/nsjames/Account-Has-Code is there a way to ...
2
votes
1answer
64 views

Is it possible to create new contract from another?

Ethereum has a opportunity to create new contract from another. Does eosio has the same? I found a code with new account creation, but I didn't find nothing about setting code and abi from contract.