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

Anything related to decentralized application (dApp) development, concepts and possibilities with smart contracts, or technical questions for the development of smart contracts

1
vote
0answers
5 views

How do trade eosio token and other token (NFT) in contract?

I'm trying to develop NFT's contract with reference to unicoeos/eosio.nft. Also I'm trying to develop NFT's shop contract in order to trade NFT and eosio.token. The logic trading NFT and eosio....
1
vote
0answers
18 views

Send same action as `cleos push action hello hi …` in smart contract tutorial

I finished smart contract tutorial, and it worked well. Now I'm trying to send same action as cleos push action hello hi '["bob"]' -p user@active in tutorial by using RPC API, cause need to implement ...
1
vote
1answer
19 views

What are the main pros / cons for smart contract development on EOS vs Ethereum smart contracts? [on hold]

What are the pros and cons when doing smart contract development when coming from Ethereum? How does one differ in strength and weakness?
0
votes
0answers
8 views

Is there a sample code of how to link EOS with IPFS for data storage?

Let's say I am making a todo list smart contract or do I even need a smart contract for this? I want to be able to store the todo list items on IPFS storage file. Is there an example of how this can ...
1
vote
1answer
19 views

Tutorial on how to load up your own ERC20 EOS token using a template contract.

I have the following template contract: https://github.com/EOSIO/eos/tree/master/contracts/eosio.token Is there a step by step tutorial on what I need to do to load up my own token? What are the ...
1
vote
2answers
19 views

How can I find the code of Smart Contract on a EOS account?

Maybe a basic question, but how can I find the code of Smart Contract on a EOS account? For example the code on https://eosflare.io/account/betdicelucky ? I need this to audit if I can trust the code ...
2
votes
1answer
18 views

Is it possible to compile EOS contract with out 'make install' of EOSIO?

building eosio source needs pretty high resource, so I want to deploy with out build eosio source. or at least I want to compile it with out "make install". could it be possible?
1
vote
0answers
16 views

Samples with eosio.cdt v1.3.0? multi_index with secondary indexes and get_index

Has anyone been successful getting a contract which uses secondary indexes to compile against the latest versions of the CDT (1.3.2)? I'm having trouble and don't see any updated samples which use ...
1
vote
1answer
35 views

Solved - Unable to compile eosio.token

I'm following the https://developers.eos.io/eosio-home/docs/token-contract block one tutorial using the latest eosio/eos-dev docker image (v1.4.0). I have some issues when I compile eosio.token.cpp ...
1
vote
1answer
8 views

mutable globals cannot be imported: globalImport.type.isMutable

I compile hello.cpp in the examples folder in eosio.cdt version1.3.1, which has a lot of updates compares to version 1.2.X. then completely follow the smart contracts tutorials in https://developers....
1
vote
0answers
14 views

Why the first time I execute an action I get “Error 3080006: transaction took too long”?

WHAT I WANT Call an action and see it succeed at the first execution. WHAT IS NOT WORKING The function, which I am executing, the first time fails with error: Error 3080006: Transaction took too ...
2
votes
1answer
28 views

How the IBC works exactly?

I am curious about how to transfer tokens between two chains. As I understand I need two smart contracts on different chains and a process of transfering tokens to the second chain will look like this:...
2
votes
1answer
27 views

Why smart contract function fails with “Error 3090004: Missing required authority”?

WHAT I WANT From the contract mycontract I want to call a function function1. The function function1 calls another function of mycontract called function2. The function function2 calls an action of ...
1
vote
0answers
15 views

How to make real time my contract transition history

I want to make real time my contract transition history,Do I have to learn what components of EOS blockchain?
1
vote
2answers
37 views

No matching constructor for initialization AddressBook example

Dependencies: EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1 My code: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; CONTRACT ...
1
vote
1answer
27 views

multi_index in eos with AddressBook example

I building AddressBook by link https://developers.eos.io/eosio-home/docs/data-persistence, Dependencies: EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1 Here is my code: #include &...
1
vote
0answers
15 views

How to detect an account is a contract account or not

I want to exclude all contract account to use my contract. How can I detect the account has deployed contract or not?
0
votes
0answers
26 views

How can i prevent another contract call my contract's method?

how can i prevent another contract call my deployed contract? Or how can i know that the caller is an eos account with contract or not. Thanks.
1
vote
1answer
18 views

Is there a way to mark accounts like give an account a property value?

Let's say I'm making a game character and each eos account is a unique character. Is there a way to mark an account with different properties like strength, speed, durability, etc....
1
vote
1answer
18 views

Are EOS smart contract self executing? Can a contract monitor an external api call from a weather site and send a transaction if its sunny?

Ethereum contracts require someone to execute the contract and are not self aware. Are EOS contracts self executing if some external thing happens like the weather changing when detected from a ...
1
vote
1answer
29 views

How to setup action access control?

Let's say contract-A has a couple of actions defined. If access to one of the contract-A's action, say action1(), needs to be controlled on account basis, how to do it? For example, only few ...
1
vote
1answer
19 views

About authorities

On eosio.token.cpp, there are transfer function with require_auth(from). So executing this contact needa "from" active permission. For some reason, I change require_auth parameter from "from" to "...
0
votes
1answer
40 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
15 views

EOS smart contract upgrading/recompiling, variables and symbol mappings

EOS allows to reset the contract code payload, unlike some other blockchains: https://www.reddit.com/r/eos/comments/91aqjx/how_many_contracts_can_an_account_have_on_the_eos/e2ww4la/ How the code ...
1
vote
1answer
22 views

Trying to pass a sha256 hash to my contract and store it

I'm new to the EOS platform. For my use case I'm trying to pass a sha256 hash to a function in my contract and store it in a table which is indexed by that hash. I've realized you can't have the ...
0
votes
1answer
27 views

Contract Table Query Exception

As i was following eosio developers documentation #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; using namespace std; class addressbook : public ...
2
votes
1answer
37 views

How can I send or store an arbitrary text message to another EOS account?

I wan't to be able to send a text string to another EOS account. How can this be done? Are there any mobile wallets that support this?
1
vote
0answers
20 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
36 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
2answers
32 views

How to convert from name type to account_name type in contract?

I know how to do the other way round but don't know how to convert from name to account_name unless I convert it to string first. Please help. Thanks.
4
votes
0answers
43 views

Using “native” wat/wasm function in smart-contract

I have to do some heavy computation in my smart-contract, like say a+b. Fortunately, I have written some very efficient implementation in "native" (web)assembly, like: File add.wast: (module (func ...
1
vote
0answers
20 views

How to check if an account has smart contract in my smart contract? [duplicate]

We don't want the account that hold a smart contract to run our smart contract. How can we check this? THanks.
2
votes
1answer
41 views

Receiving EOS tokens in the contract's action

I am working on a DAPP which requires users to pay a small amount of EOS in order to participate in the DAPP. In ethereum, every transaction has msg.value which specifies the amount of ether in the ...
1
vote
2answers
37 views

How does EOS address its Smart Contracts?

Ethereum (for comparison purposes only), uses the address of the creator, the nonce, which is keccak (does EOS use this type of hashing?) hashed with the senders address(roughly- see related question ...
1
vote
0answers
17 views

Smart contract error while calling recover_key

Specs I am using the function recover_key from the library crypto.h at the following link: https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/crypto.h Code int compressed_size = ...
1
vote
1answer
27 views

How to check if smartcontract action has been actually run? How to count how many times?

Imagine an action, which is not const, and sometimes (but not always) modify a defined multi index. I would like to count, how many times a specific action was run. I do not want to introduce any ...
0
votes
0answers
16 views

Remove ram functions from system contract?

I want to remove whole ram functionality from the default eosio.system contract. I want to set up a private network without trading ram How can I do that??
0
votes
0answers
11 views

How to find my token in wallet app like imtoken?

I have iussed a simple smart contract token on eos mainnet (ex, name AAA).It works fine by using cleos to transfer tokens between other mainnet accounts. However, I don't know how to use some app like ...
1
vote
1answer
14 views

How to parse iso8601 to eos time format?

How does one parse an iso8601 string to eos time_point format?
0
votes
2answers
32 views

A contract without struct and multi index table

Actually, I am looking to create a contract in which a variable can be set and later on can be retrieved. All the contracts available there involves struct and multi index table. In EOS, is it ...
0
votes
0answers
42 views

std::to_string not working anymore after using the eosio-cpp to generate wasm

i used eosio-cpp to generate my wasm but now everytime i used something like std::to_string(uint64_t) (same error with uint8_t/uint16_t/uint32_t) in my contract i get the following error: Error ...
2
votes
2answers
53 views

eosio-cpp: command not found

Is there an alias or PATH that we need to set for eosio-cpp to be accessible? Here's what I'm seeing: ~/eos/contracts/youvote $ eosio-cpp --help eosio-cpp: command not found I can access it via: ~/...
1
vote
1answer
37 views

Cleos cannot find contract directory

I am trying the get started guide but I get stuck in the hello world smart contract. Here is the console log. root@d75d5dde1190:/home/savvas/EOS/contracts/hello# ls hello.abi hello.cpp hello.wasm ...
2
votes
2answers
52 views

Meaning of N() function in multi_index

What is the role of N() in defining tables using multi_index. The primary key function does not return string. Why so? e.g. string primary_key() const {return Some_String_Object}. This throws an error....
0
votes
1answer
31 views

Verify user's signature in contract

User A has signed a message msg with signature sig.How can the third party verify this message in a contract? The verify method contract is like this: void verify_user_sig(account_name user,string ...
0
votes
1answer
24 views

Rewards on private network

I want to have rewards mechanism in private network with two bps how can I do that? is there any way to modify current reward mechanism ?
2
votes
1answer
47 views

Multi-index table logic

I'm new to smart contracts and I'm having difficulty understanding the logic behind instantiating multi-index tables and how they persist. For example in the addressbook example, it seems a new ...
2
votes
1answer
75 views

How to push a vector to an action

I'm troubled with a problem about how I can use command line cleos push action to push a vector to an already existing action, such as: void vectortest(const std::vector &vec) ; Anyone who can ...
2
votes
1answer
39 views

Ram used in transactions?

Can anyone specifically tell me where we are using the ram suppose I am a dapp developer and I have staked some ram for accounts I am going to create Questions are For every transaction made by ...
2
votes
1answer
48 views

EOSIO account and smart contract

I have some questions about the account and smart contract: From google and my research, I found that one account can have only one smart contract, why? It seems you can't have the same action name ...