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
1answer
60 views

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

What are the pros and cons when doing smart contract development when coming from Ethereum? How does one differ in strength and weakness?
4
votes
2answers
276 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
57 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 ...
2
votes
2answers
763 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
149 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?
2
votes
1answer
264 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 ...
2
votes
2answers
695 views

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
166 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....
6
votes
3answers
893 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 long ...
3
votes
1answer
359 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:...
3
votes
1answer
385 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
36 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
621 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
209 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 &...
2
votes
3answers
220 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?
1
vote
0answers
60 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.
0
votes
1answer
72 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....
2
votes
1answer
153 views

Are EOS smart contract self executing? Can a contract monitor an external API call from a weather site and send a transaction if it's 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 ...
2
votes
1answer
103 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
30 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 "...
2
votes
2answers
235 views

How to make a random uint64 to send to an EOS contract

My friend had made an EOS contract and he has asked me to submit a random uint64, I need to generate this in nodejs. Do I need to use a library like big number https://www.npmjs.com/package/big-...
0
votes
1answer
733 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
38 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
368 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
167 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
432 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
1answer
721 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
533 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.
7
votes
1answer
127 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
26 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
371 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 ...
2
votes
2answers
528 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 ...
1
vote
2answers
166 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
1answer
124 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
48 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 ...
1
vote
1answer
140 views

How to parse iso8601 to eos time format?

How does one parse an iso8601 string to eos time_point format?
0
votes
2answers
95 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 ...
2
votes
2answers
753 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
228 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 ...
3
votes
2answers
186 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....
1
vote
1answer
493 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
51 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 ?
5
votes
2answers
224 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/...
2
votes
1answer
212 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 ...
3
votes
1answer
366 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 ...
3
votes
1answer
258 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 ...
3
votes
1answer
138 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 ...
3
votes
1answer
852 views

What is “Transaction as Proof of Stake” (TAPOS) and when would a smart contract use it?

From: ./contracts/eosiolib/transaction.h /** * Gets the block number used for TAPOS on the currently executing transaction. * * @brief Gets the block number used for TAPOS on the currently ...
1
vote
1answer
59 views

other way to let contract account provide for cpu/bandwidth than delegatew/undelegatew?

as far as i can tell it is somehow inconvenient to let the user of an contract "pay" for the cpu time. I thought that the one who manages the contract, has to stake for cpu/bandwidth, so user can use ...
8
votes
2answers
655 views

Encrypting with a public key

I have user specific data in a table on my smart contract that I don't want others to see. Can I encrypt that data with a public key of the user? If possible then how to encrypt that data with the ...

1
5 6
7
8 9
12